Skip to main content
POST/companies/:id/add_member/

Company add member

You can add an employee (a user) to a company.

Attributes

Optional unless marked required

idintegerrequired
A unique identifier for the company which is given by User automatically.
user_idintegerone of
A unique identifier for the user which is given by User automatically. Send this or user_custom_id.
user_custom_idstringone of
A unique identifier for the user which is provided by the client. Send this or user_id.

Send one of user_id and user_custom_id to point at the contact. Adding a contact that's already a member of the company answers 201 again, not an error.

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/companies/:id/add_member/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"user_id": 1884
}'

Response examples​

{
"success": true
}

A 400 comes with one of these messages:

MessageWhen
'user_id' or 'user_custom_id' field is necessary.The body has neither field.
Given value is not matching any user.No contact has that user_id or user_custom_id.

Response fields​

Fields returned in the 201 Created response body.

successboolean
true when the contact was added to the company.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.