User

These endpoints allows to retrieve the users on this account and their preferences such as local time zone, default currency, language and date format. For a full description of the user model see User model definition.

List Users

List all the users on this Capsule account.

GET
https://api.capsulecrm.com/api/v2/users

Query Parameters

Name Type Description
embed Array of String

Can be used to specify extra entities to fully include in the result. If provided, should be a comma separated list of strings. Can be empty or party.

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property users which is an array of User objects. In the case of an invalid request, an error message will be returned, as described in the errors section.

HTTP/1.1 200
{
  "users" : [ {
    "id" : 1,
    "locale" : "en_GB",
    "currency" : "EUR",
    "roles" : {
      "isAccountOwner" : true,
      "isAccountAdmin" : true
    },
    "party" : {
      "id" : 1,
      "type" : "person",
      "firstName" : "Scott",
      "lastName" : "Spacey",
      "pictureURL" : "http://assets0.zestia.biz:11564/theme/default/images/person_avatar_70.png"
    },
    "username" : "scott",
    "timezone" : "Europe/London",
    "lastLoginAt" : "2015-12-11T14:01:15Z",
    "previousLoginAt" : "2015-12-10T16:27:01Z",
    "loggedIn" : true,
    "name" : "Scott Spacey"
  }, {
    "id" : 12345682,
    "locale" : "en_GB",
    "currency" : "GBP",
    "roles" : {
      "isAccountOwner" : false,
      "isAccountAdmin" : false
    },
    "party" : {
      "id" : 448488,
      "type" : "person",
      "firstName" : "John",
      "lastName" : "Spacey",
      "pictureURL" : "https://assets0.zestia.biz/theme/default/images/person_avatar_70.png"
    },
    "username" : "john",
    "timezone" : "Europe/London",
    "lastLoginAt" : "2015-11-24T16:45:53Z",
    "previousLoginAt" : "2015-11-24T16:25:58Z",
    "loggedIn" : false,
    "name" : "John Spacey"
  } ]
}

Show Current User

Shows the details of the user the provided access token is associated with. In most of the cases this will be user who approved your application.

GET
https://api.capsulecrm.com/api/v2/users/current

Query Parameters

Name Type Description
embed Array of String

Can be used to specify extra entities to fully include in the result. If provided, should be a comma separated list of strings. Can be empty or party.

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property user which is a User object.

HTTP/1.1 200
{
  "user" : {
    "id" : 1,
    "locale" : "en_GB",
    "currency" : "EUR",
    "roles" : {
      "isAccountOwner" : true,
      "isAccountAdmin" : true
    },
    "party" : {
      "id" : 1,
      "type" : "person",
      "firstName" : "Scott",
      "lastName" : "Spacey",
      "pictureURL" : "http://assets0.zestia.biz:11564/theme/default/images/person_avatar_70.png"
    },
    "username" : "scott",
    "timezone" : "Europe/London",
    "lastLoginAt" : "2015-12-11T14:01:15Z",
    "previousLoginAt" : "2015-12-10T16:27:01Z",
    "loggedIn" : true,
    "name" : "Scott Spacey"
  }
}

Show User

Retrieve a specific user by their unique id

GET
https://api.capsulecrm.com/api/v2/users/{userId}

Query Parameters

Name Type Description
embed Array of String

Can be used to specify extra entities to fully include in the result. If provided, should be a comma separated list of strings. Can be empty or party.

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property user which is a User object.

HTTP/1.1 200
{
  "user" : {
    "id" : 1,
    "locale" : "en_GB",
    "currency" : "EUR",
    "roles" : {
      "isAccountOwner" : true,
      "isAccountAdmin" : true
    },
    "party" : {
      "id" : 1,
      "type" : "person",
      "firstName" : "Scott",
      "lastName" : "Spacey",
      "pictureURL" : "http://assets0.zestia.biz:11564/theme/default/images/person_avatar_70.png"
    },
    "username" : "scott",
    "timezone" : "Europe/London",
    "lastLoginAt" : "2015-12-11T14:01:15Z",
    "previousLoginAt" : "2015-12-10T16:27:01Z",
    "loggedIn" : true,
    "name" : "Scott Spacey"
  }
}