Identity API

Whoami

Retrieves the details about the current authenticated entity used to access the API.

GET /whoami

Example

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

Response

Responds with HTTP 200. Either user or account may be nil, depending on how you are authenticated.

Example when authenticated with an Account access token
{
  "data": {
    "user": null,
    "account": {
      "id": 1,
      "email": "example-account@example.com",
      "plan_identifier": "dnsimple-professional",
      "created_at": "2015-09-18T23:04:37Z",
      "updated_at": "2016-06-09T20:03:39Z"
    }
  }
}
Example when authenticated with an User access token
{
  "data": {
    "user": {
      "id": 1,
      "email": "example-user@example.com",
      "created_at": "2015-09-18T23:04:37Z",
      "updated_at": "2016-06-09T20:03:39Z"
    },
    "account": null
  }
}

Errors

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