Skip to main content

Create a membership

Creates a doc membership for the specified user or company.

Parameters

user
string
ID of the user. Provide either user or company.
company
string
ID of the company. Provide either company or user.
role
enum
required
The role. One of document_admin, document_manager, document_editor, document_viewer.
notification
string
The message to be sent to the user. If omitted, no notification will be sent.

Returns

Returns the added label object. Throws an error if some parameters are not valid.

post
/api/docs/{id}/memberships
curl -X POST https://{workspace}.kitchen.co/api/docs/{id}/memberships \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Authorization: Bearer {API_KEY}'
Response
{
"id": "nms_99fd10deda4c58d31ab7a1fb",
"user": {
"created_at": "2024-03-11T15:37:23+00:00",
"email": "john.doe@example.net",
"group": "client",
"id": "u_c01bb6102b6ddadd4b1f020e",
"language": null,
"name": "John Doe",
"phone": null,
"role": "member",
"timezone": null,
"title": null,
"company": null,
"updated_at": "2024-03-11T15:37:23+00:00",
"username": "johndoe"
},
"company": null,
"role": "document_viewer"
}