Collaborators API

List collaborators

GET /:account/domains/:domain/collaborators

List collaborators for the domain in the account.

Parameters

Name Type Description
:account integer The account id
:domain string, integer The domain name or id

Example

List all collaborators for the domain example.com in the account 1010:

curl  -H 'Authorization: Bearer <token>' \
      -H 'Accept: application/json' \
      https://api.dnsimple.com/v2/1010/domains/example.com/collaborators

Response

Responds with HTTP 200.

{
  "data": [
    {
      "id": 100,
      "domain_id": 1,
      "domain_name": "example.com",
      "user_id": 999,
      "user_email": "existing-user@example.com",
      "invitation": false,
      "created_at": "2016-10-07T08:53:41Z",
      "updated_at": "2016-10-07T08:53:41Z",
      "accepted_at": "2016-10-07T08:53:41Z"
    },
    {
      "id": 101,
      "domain_id": 1,
      "domain_name": "example.com",
      "user_id": null,
      "user_email": "invited-user@example.com",
      "invitation": true,
      "created_at": "2016-10-07T08:51:12Z",
      "updated_at": "2016-10-07T08:51:12Z",
      "accepted_at": null
    }
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 30,
    "total_entries": 2,
    "total_pages": 1
  }
}

Errors

Responds with HTTP 401 in case of case of authentication issues.

Add a collaborator

At the time of the add, a collaborator may or may not have a DNSimple account.

In case the collaborator doesn’t have a DNSimple account, the system will invite her/him to register to DNSimple first and then to accept the collaboration invitation.

In the other case, she/he is automatically added to the domain as collaborator. She/he can decide to reject the invitation later.

POST /:account/domains/:domain/collaborators

Parameters

Name Type Description
:account integer The account id
:domain string, integer The domain name or id

Example

Add a collaborator for the domain example.com in the account 1010:

curl  -H 'Authorization: Bearer <token>' \
      -H 'Accept: application/json' \
      -H 'Content-Type: application/json' \
      -X POST \
      -d '<json>' \
      https://api.dnsimple.com/v2/1010/domains/example.com/collaborators

Input

Name Type Description
email string Required.
Example
{
  "email": "existing-user@example.com"
}

Response

When the collaborator already has a DNSimple account:

{
  "data": {
    "id": 100,
    "domain_id": 1,
    "domain_name": "example.com",
    "user_id": 999,
    "user_email": "existing-user@example.com",
    "invitation": false,
    "created_at": "2016-10-07T08:53:41Z",
    "updated_at": "2016-10-07T08:53:41Z",
    "accepted_at": "2016-10-07T08:53:41Z"
  }
}

When the collaborator doesn’t have a DNSimple account:

{
  "data": {
    "id": 101,
    "domain_id": 1,
    "domain_name": "example.com",
    "user_id": null,
    "user_email": "invited-user@example.com",
    "invitation": true,
    "created_at": "2016-10-07T08:51:12Z",
    "updated_at": "2016-10-07T08:51:12Z",
    "accepted_at": null
  }
}

Responds with HTTP 201 on success.

Errors

Responds with HTTP 400 if the collaborator cannot be added.

Responds with HTTP 401 in case of case of authentication issues.

Remove a collaborator

DELETE /:account/domains/:domain/collaborators/:collaborator

Parameters

Name Type Description
:account integer The account id
:domain string, integer The domain name or id
:collaborator integer The collaborator id

Example

Remove a collaborator 100 from the domain example.com in the account 1010:

curl  -H 'Authorization: Bearer <token>' \
      -H 'Accept: application/json' \
      -X DELETE \
      https://api.dnsimple.com/v2/1010/domains/example.com/collaborators/100

Response

Responds with HTTP 204 on success.

Errors

Responds with HTTP 400 if the collaborator cannot be removed

Responds with HTTP 401 in case of case of authentication issues.