# Manage members and roles

> Invite people to run your organization with you, give each a role, link a member to a customer account and remove access.

Source: https://docs.coritan.com/organizations/members-and-roles/

In the dashboard:

- /dashboard/organizations/…/members: https://www.coritan.com/dashboard/organizations

Members are the people who run your organization with you. Each member is a Coritan account with a role that decides what they can see and change in the organization's tabs, in the staff console and through the Organization API. Add a member when someone joins your team, and remove them when they leave.

## Before you begin

- You need the owner or admin role to add, change or remove members. Every member can see the list; the others see the note **Changes here need an owner or admin**.
- Decide on a role. [Organization roles and permissions](/organizations/roles-and-permissions/) says what each one can do.

## Add a member

1. In the [dashboard](https://www.coritan.com/dashboard/organizations), open the organization, then the **Members** tab.
2. Select **Add member**.
3. Enter their **Email** and, if you like, their **Name**.
4. Choose a **Role**. The description under the list says what the role can do.
5. Give them a way to sign in:
   - Leave **Email an invitation** ticked to email them a link to set their password, or
   - enter a **Temporary password** of at least 8 characters and share it with them yourself.

   A person who is new to Coritan needs one of the two. For someone who already has a Coritan account, leave **Temporary password** empty: they sign in with the password they have.
6. Under **Storefront account**, choose which customer account the member uses when they buy from your storefront:
   - **Their own account, by email**: the customer account with their email, created the first time they sign in to the staff console.
   - **An existing customer account**: choose it under **Customer account**.
   - **Create a customer account now**, with their email.
   - **No storefront account**: they only use the staff console.
7. Select **Add member**.

The dashboard confirms who was added and with which role. An invited member gets an email with a link to set their password on your storefront domain, at `/staff/reset-password`. Members sign in to the organization's tabs on coritan.com, and to the [staff console](/organizations/staff-console/sign-in/) with the same email and password.

## Change a member's role

1. Open the **Members** tab.
2. Choose the new role in the member's **Role** column.

The change applies at once, and it signs the member out of every open staff console session, so their next session carries the new role. The owner's role cannot be changed here.

## Change a member's storefront account

1. In the **Storefront account** column, select **Manage** next to the member.
2. Under **Change it to**, choose **Attach an existing customer** and pick the account, or **Create a new customer account**.
3. Select **Attach account** or **Create and attach**.

To make the member console-only, select **Detach account** instead. The customer account itself stays as it is, with its services and invoices.

## Remove a member

1. Select the bin icon at the end of the member's row.
2. Type `remove` to confirm, then select **Remove member**.

The member loses access to the organization at once and every staff console session they have ends. Their Coritan account and their storefront customer account, if they have one, are kept. The owner cannot be removed: ownership moves only when Coritan support transfers it.

## Troubleshooting

`User is already a member`
: That email already belongs to a member of this organization. Change their role instead.

`Set a temporary password or send an invite email`
: The email is new to Coritan, so the member needs a way to sign in. Tick **Email an invitation** or enter a **Temporary password**.

`That email belongs to a suspended or closed platform account`
: The Coritan account with that email cannot sign in, so it cannot become a member.

`Set a password from the invite email before signing in`
: The member tried to sign in to the staff console before following the invitation link. Ask them to open the email, or add a temporary password for them.

## Related

- [Organization roles and permissions](/organizations/roles-and-permissions/)
- [Manage the staff team and console settings](/organizations/staff-console/team-and-settings/)
- [Read the organization audit log](/organizations/audit-log/)

## With the API

List the members with any member's token. Each entry has the member's `id`, `user_id`, `role`, `email`, names, `joined_at`, `customer_link_mode` and `linked_customer_id`.

```bash
curl https://api.coritan.com/api/v1/orgs/acme/members \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

Add a member as an owner or admin. The body takes `email`, `role` (`support_tier1` when you leave it out), `name`, `password` (at least 8 characters), `send_invite_email` (`false` when you leave it out), `customer_link` (`auto`, `existing`, `create` or `none`) and `customer_id` for `existing`.

```bash
curl -X POST https://api.coritan.com/api/v1/orgs/acme/members \
  -H "Authorization: Bearer $CORITAN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email": "alex@example.com", "name": "Alex Example", "role": "support_tier2", "send_invite_email": true, "customer_link": "auto"}'
```

The answer is `201` with the new member. `role` takes `admin`, `billing`, `support_tier3`, `support_tier2`, `support_tier1` or `readonly`; `owner` answers `400 Use transfer-ownership to assign owner`.

Change a role with `PATCH /api/v1/orgs/acme/members/{member_id}` and a body of `{"role": "billing"}`, and remove a member with `DELETE /api/v1/orgs/acme/members/{member_id}`. Both answer `400` for the owner.

Read a member's storefront account with `GET /api/v1/orgs/acme/members/{member_id}/customer-link`. Attach one with `PUT` on the same path and a body of `{"mode": "existing", "customer_id": 812}`, or `{"mode": "create"}` to make one with the member's email. `DELETE` on the path makes the member console-only.

## API

- `GET /api/v1/orgs/{org_slug}/members`: List members (https://docs.coritan.com/api/reference/organizations/organizations-members/members/#op-get-api-v1-orgs-org-slug-members)
- `POST /api/v1/orgs/{org_slug}/members`: Invite member (https://docs.coritan.com/api/reference/organizations/organizations-members/members/#op-post-api-v1-orgs-org-slug-members)
- `PATCH /api/v1/orgs/{org_slug}/members/{member_id}`: Update member (https://docs.coritan.com/api/reference/organizations/organizations-members/members/#op-patch-api-v1-orgs-org-slug-members-member-id)
- `DELETE /api/v1/orgs/{org_slug}/members/{member_id}`: Remove member (https://docs.coritan.com/api/reference/organizations/organizations-members/members/#op-delete-api-v1-orgs-org-slug-members-member-id)
- `GET /api/v1/orgs/{org_slug}/members/{member_id}/customer-link`: The storefront customer account this member is on, if any (https://docs.coritan.com/api/reference/organizations/organizations-members/members-customer-link/#op-get-api-v1-orgs-org-slug-members-member-id-customer-link)
- `PUT /api/v1/orgs/{org_slug}/members/{member_id}/customer-link`: Set member customer link (https://docs.coritan.com/api/reference/organizations/organizations-members/members-customer-link/#op-put-api-v1-orgs-org-slug-members-member-id-customer-link)
- `DELETE /api/v1/orgs/{org_slug}/members/{member_id}/customer-link`: Make the member console-only; the customer account itself is untouched (https://docs.coritan.com/api/reference/organizations/organizations-members/members-customer-link/#op-delete-api-v1-orgs-org-slug-members-member-id-customer-link)
