Collaborators
POST
Create one or more collaborators. The following is the JSON that is posted.
[ { "account_id": "<string>", "email": "<string>", "role": "<enum{'admin', 'editor'}>", "website_ids": [ "<string>" ] }]account_idis the unique identifier of the account which owns the collaborator.emailis the email address of the collaboratorroleis one of the following values -adminoreditor. Please see here for details.website_idsis an array of website unique identifiers. This field is only provided if theroleiseditor.
At least 1 object is required in the request.
The response is an array of objects. If the collaborator can be created successfully, the object will have the following shape:
{ "_idx": <integer>, "id": "<string>", "account_id": "<string>", "email": "<string>", "first_name": "<string|null>", "last_name": "<string|null>", "invitation_url": "<string|null>", "invitation_status": "<enum{'pending', 'accepted'}>", "role": "<enum{'admin', 'editor'}>", "website_ids": [ "<string>" ]}_idxis the index in the original array of objects posted.idis the unique identifier of the collaborator.account_idis the unique identifier of the account which owns the collaborator.emailis the email address of the collaborator.first_nameis the Given name of the collaborator if provided by the collaborator upon signing in for the first time.last_nameis the Surname of the collaborator if provided by the collaborator upon signing in for the first time.invitation_urlis the URL sent to the collaborator so they can activate their account. If the invitation has been accepted, this field is null.invitation_statusindicates whether or not the invite has been accepted.roleis one of the following values -adminoreditor. Please see here for details.website_idsis an array of website unique identifiers. This field is only provided if theroleiseditor.
If one of the collaborators cannot be created, the object will be an error object. If the error is a validation error, there will be a field called validation errors.
Example 1
Request for a single collaborator
Request
POST https://api.termly.io/v1/collaborators
[ { "account_id": "acct_1234", "role": "admin" }]Response
[ { "_idx": 0, "id": "col_1", "account_id": "acct_1234", "first_name": null, "last_name": null, "role": "admin", "invitation_url": "https://app.termly.io/invitation", "invitation_status": "accepted" }]Example 2
Request for a single collaborator with an email address that is in use
Request
POST https://api.termly.io/v1/collaborators
[ { "account_id": "acct_1234", "role": "admin" }]Response
[ { "_idx": 0, "account_id": "acct_1234", "error": "validation_error", "validation_errors": [ { "email": "email_in_use" } ] }]