# Client API: Account team

> Invite people to your account, give each a role and remove them.

Source: https://www.coritan.com/docs/api/reference/client/account-team/

Invite people to your account, give each a role and remove them. Accept an invitation, list the accounts you can act for, and leave a team. Send `X-Coritan-Account` to act for another account.

Base URL: `https://api.coritan.com/api/v1`. Paths below are complete.

To try these requests in the browser, open the [interactive Client API reference](https://api.coritan.com/docs).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/account/invitations/{token}`](#op-get-api-v1-account-invitations-token) | What an invitation offers, for the page that accepts it |
| POST | [`/api/v1/account/invitations/{token}/accept`](#op-post-api-v1-account-invitations-token-accept) | Accept invitation |
| GET | [`/api/v1/account/members`](#op-get-api-v1-account-members) | The account's owner, its members and the invitations not yet accepted |
| POST | [`/api/v1/account/members`](#op-post-api-v1-account-members) | Invite an address to the team with a role |
| PATCH | [`/api/v1/account/members/{member_id}`](#op-patch-api-v1-account-members-member-id) | Give a member, or a waiting invitation, another role |
| DELETE | [`/api/v1/account/members/{member_id}`](#op-delete-api-v1-account-members-member-id) | Remove a member, or withdraw an invitation |
| GET | [`/api/v1/account/memberships`](#op-get-api-v1-account-memberships) | The accounts the signed-in person can act for, and their role in each |
| DELETE | [`/api/v1/account/memberships/{membership_id}`](#op-delete-api-v1-account-memberships-membership-id) | Leave a team the signed-in person belongs to |

### What an invitation offers, for the page that accepts it {#op-get-api-v1-account-invitations-token}

`GET /api/v1/account/invitations/{token}`

What an invitation offers, for the page that accepts it.
``email_matches`` says whether the signed-in account can accept it.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `token` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Accept invitation {#op-post-api-v1-account-invitations-token-accept}

`POST /api/v1/account/invitations/{token}/accept`

Join the team the invitation is for, as the account signed in with the
address it was sent to.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `token` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### The account's owner, its members and the invitations not yet accepted {#op-get-api-v1-account-members}

`GET /api/v1/account/members`

The account's owner, its members and the invitations not yet accepted.
``seats_used`` counts the owner, every member and every invitation that
can still be accepted, as the ``team_members`` entitlement does.
``seats_limit`` is that entitlement's limit (-1 for no limit), or null
while plans do not apply to the account.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |

### Invite an address to the team with a role {#op-post-api-v1-account-members}

`POST /api/v1/account/members`

Invite an address to the team with a role. The link in the email
works for ``INVITE_DAYS`` days, for the account with that address only.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `email` | string (email) | yes |
| `role` | string, one of `admin`, `technical`, `billing`, `readonly` | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Give a member, or a waiting invitation, another role {#op-patch-api-v1-account-members-member-id}

`PATCH /api/v1/account/members/{member_id}`

Give a member, or a waiting invitation, another role.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `member_id` | path | integer | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `role` | string, one of `admin`, `technical`, `billing`, `readonly` | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Remove a member, or withdraw an invitation {#op-delete-api-v1-account-members-member-id}

`DELETE /api/v1/account/members/{member_id}`

Remove a member, or withdraw an invitation. A removed member can no
longer act for the account; what they did stays in the audit log.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `member_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### The accounts the signed-in person can act for, and their role in each {#op-get-api-v1-account-memberships}

`GET /api/v1/account/memberships`

The accounts the signed-in person can act for, and their role in each.
Send ``X-Coritan-Account: <owner_user_id>`` to act for one.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |

### Leave a team the signed-in person belongs to {#op-delete-api-v1-account-memberships-membership-id}

`DELETE /api/v1/account/memberships/{membership_id}`

Leave a team the signed-in person belongs to.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `membership_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
