---
title: "Create a membership"
method: POST
path: "/membership/"
tags: ["memberships"]
---

# Create a membership

`POST /membership/`

Ensures an active membership for the given email will be provisioned.

- If the user already exists, they will be added to the requestor's organization.
- If it doesn't exist, a new user will be provisioned.

This request requires "Manage Organization" permissions.

As a security precaution, this operation requires the organization to have the
"Restrict new users to emails from these domains" setting enabled, and the new
member's email address must belong to one of its verified domains.

## Request body

- CreateMembership
  - `email` string, email, required
  - `role_id` string, required — One of `superuser`, `user`, or `restricteduser` for the corresponding predefined role, or the ID of a custom [Role](https://developer.close.com/api/resources/roles). The role must not grant the `manage_organization` permission.

## Response `200`

Successful response

## Other responses

- `400` — Invalid membership data, including an email address that does not belong to one of the organization's verified domains.
- `401` — Unauthorized
- `403` — Membership creation is not permitted because the requestor cannot manage the organization, the verified domain restriction is disabled, or the requested role grants the `manage_organization` permission.
- `404` — Not found

---

[API](https://skmtc.net/close/apis/close-api.md) · [All operations](https://skmtc.net/close/apis/close-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/close/close-api/revisions/0dcf3303e9d7/schema)
