API Documentation

API Endpoint

Users

Users

GET /api/v2/users
Requestsreturns usersreturns :unauthorized

GET  /api/v2/users

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "126",
      "type": "users",
      "attributes": {
        "email": "user126@email.com",
        "first_name": "test first name",
        "last_name": "test last name",
        "time_zone": null,
        "avatar_url": null,
        "default_organization_id": 49,
        "default_organization_slug": "49-organization49",
        "intercom_hash": "599b64241a91d6ca842df5a5fbc14e989ae2d98657eaa5770ff3434b83343e37",
        "beta_features": [],
        "newsletter_consent": false,
        "newsletter_consent_at": null,
        "ical_token": null,
        "preferences": null,
        "sysadmin": false,
        "sysadmin_permissions": [],
        "two_factor_auth": false,
        "sso_provision": false,
        "account_access_expires_at": null
      }
    }
  ],
  "links": {
    "first": "http://www.example.com/api/v2/users?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://www.example.com/api/v2/users?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200,
    "settings": {}
  }
}

GET  /api/v2/users?token=invalid

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses401
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "401",
      "code": "invalid_auth_token",
      "title": "Unauthenticated",
      "detail": "You are not authenticated",
      "source": {
        "pointer": null
      }
    }
  ]
}

Gets users
GET/api/v2/users


GET /api/v2/users/1
Requestsreturns userreturns :not_found

GET  /api/v2/users/128

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "128",
    "type": "users",
    "attributes": {
      "email": "user128@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 51,
      "default_organization_slug": "51-organization51",
      "intercom_hash": "05e6b32c722a9d8e86b9a724b976bd7f895db1d19edb6162824d2cd687f8c541",
      "beta_features": [],
      "newsletter_consent": false,
      "newsletter_consent_at": null,
      "ical_token": null,
      "preferences": null,
      "sysadmin": false,
      "sysadmin_permissions": [],
      "two_factor_auth": false,
      "sso_provision": false,
      "account_access_expires_at": null
    }
  },
  "meta": {
    "settings": {}
  }
}

GET  /api/v2/users/130

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses404
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "404",
      "code": "record_not_found",
      "title": "Record Not Found",
      "detail": "The requested record was not found",
      "source": {
        "pointer": null
      }
    }
  ]
}

Gets a user
GET/api/v2/users/{id}

URI Parameters
HideShow
id
number (required) Example: 1

user id


PATCH /api/v2/users/1
Requestsupdates userreturns error

PATCH  /api/v2/users/131

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "users",
    "attributes": {
      "default_organization_id": 2
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "131",
    "type": "users",
    "attributes": {
      "email": "user131@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 53,
      "default_organization_slug": "53-organization53",
      "intercom_hash": "226382fe8e6203fbf9420915d2d5c98042a7a1edd5d0e3152ad20a79fd4f216e",
      "beta_features": [],
      "newsletter_consent": false,
      "newsletter_consent_at": null,
      "ical_token": null,
      "preferences": null,
      "sysadmin": false,
      "sysadmin_permissions": [],
      "two_factor_auth": false,
      "sso_provision": false,
      "account_access_expires_at": null
    }
  },
  "meta": {
    "settings": {}
  }
}

PATCH  /api/v2/users/132

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "users",
    "attributes": {
      "first_name": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/first_name"
      }
    }
  ]
}

Update a user
PATCH/api/v2/users/{id}

URI Parameters
HideShow
id
number (required) Example: 1

user id


PATCH /api/v2/users/1/update_password
Requestsupdates password

PATCH  /api/v2/users/133/update_password

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "users",
    "attributes": {
      "current_password": "abc123123",
      "password": "abc123456"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "133",
    "type": "users",
    "attributes": {
      "email": "user133@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 55,
      "default_organization_slug": "55-organization55",
      "intercom_hash": "d1a73734a7e6505278839dafa3337b7c31f37b23561c1d077ad5dbc8816d80a2",
      "beta_features": [],
      "newsletter_consent": false,
      "newsletter_consent_at": null,
      "ical_token": null,
      "preferences": null,
      "sysadmin": false,
      "sysadmin_permissions": [],
      "two_factor_auth": false,
      "sso_provision": false,
      "account_access_expires_at": null
    }
  },
  "meta": {
    "settings": {}
  }
}

Update password for a user
PATCH/api/v2/users/{id}/update_password

URI Parameters
HideShow
id
number (required) Example: 1

user id


PATCH /api/v2/users/1/update_email
Requestsupdates user

PATCH  /api/v2/users/135/update_email

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "users",
    "attributes": {
      "current_password": "abc123123",
      "email": "new@email.com"
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "135",
    "type": "users",
    "attributes": {
      "email": "new@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 57,
      "default_organization_slug": "57-organization57",
      "intercom_hash": "9620c1124fc6117f382d79d982d4e5c40336af1f5fe4d557be0df3f59d1c0e71",
      "beta_features": [],
      "newsletter_consent": false,
      "newsletter_consent_at": null,
      "ical_token": null,
      "preferences": null,
      "sysadmin": false,
      "sysadmin_permissions": [],
      "two_factor_auth": false,
      "sso_provision": false,
      "account_access_expires_at": null
    }
  },
  "meta": {
    "settings": {}
  }
}

Update email for a user
PATCH/api/v2/users/{id}/update_email

URI Parameters
HideShow
id
number (required) Example: 1

user id


Generated by aglio on 14 Apr 2021