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": "161",
      "type": "users",
      "attributes": {
        "email": "user161@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": "8961224843354450c00e3f148c0b9ddef0d7fbf3a3b690003a09ef2e1984a750",
        "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/163

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": "163",
    "type": "users",
    "attributes": {
      "email": "user163@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 59,
      "default_organization_slug": "59-organization59",
      "intercom_hash": "b9d3d6917adc31e29fac4be288e5b07ea44936925076cee71692903faab8a599",
      "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/165

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/166

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": "166",
    "type": "users",
    "attributes": {
      "email": "user166@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 61,
      "default_organization_slug": "61-organization61",
      "intercom_hash": "decc64e1904291e90e9c538493d1d80bab8d23a99dd9d956b485342e215eecf0",
      "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/167

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/168/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": "168",
    "type": "users",
    "attributes": {
      "email": "user168@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 63,
      "default_organization_slug": "63-organization63",
      "intercom_hash": "9e65ae45370b823b13a1cb2e1baec4012bf205e965e03133f487f9185e3193a1",
      "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/170/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": "170",
    "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": 65,
      "default_organization_slug": "65-organization65",
      "intercom_hash": "3bfea29866a481fa859192842c51527dd003d186574c4e89bd05b65cd3642e84",
      "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 20 Sep 2021