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": "91",
      "type": "users",
      "attributes": {
        "email": "user91@email.com",
        "first_name": "test first name",
        "last_name": "test last name",
        "time_zone": null,
        "avatar_url": null,
        "default_organization_id": 41,
        "default_organization_slug": "41-organization41",
        "intercom_hash": "c7d89bb85d3b2e592848af3422980b87198bb893c95557d1bebfe5a0b3fc48d7",
        "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
      }
    }
  ],
  "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
  }
}

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

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": "93",
    "type": "users",
    "attributes": {
      "email": "user93@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 43,
      "default_organization_slug": "43-organization43",
      "intercom_hash": "259eb6c53250fd53d0522a66e4028a8fd69ed420b281982ee97bba0dd2542b9a",
      "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
    }
  },
  "meta": {}
}

GET  /api/v2/users/95

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

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": "96",
    "type": "users",
    "attributes": {
      "email": "user96@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 45,
      "default_organization_slug": "45-organization45",
      "intercom_hash": "9826445fdaf183f05c933acabbf87a98841caf9755c8c6fb352f6fdd6fdf950f",
      "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
    }
  },
  "meta": {}
}

PATCH  /api/v2/users/97

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/98/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": "98",
    "type": "users",
    "attributes": {
      "email": "user98@email.com",
      "first_name": "test first name",
      "last_name": "test last name",
      "time_zone": null,
      "avatar_url": null,
      "default_organization_id": 47,
      "default_organization_slug": "47-organization47",
      "intercom_hash": "1fdca0f7c4e50cfce4029fb02f24336a0ce7e510d191fd745d5ee5de341ab256",
      "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
    }
  },
  "meta": {}
}

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/100/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": "100",
    "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": 49,
      "default_organization_slug": "49-organization49",
      "intercom_hash": "66916c25812a13c6b4e9a98d33fb440312e687736ef44f09af72c5b00b75fe4c",
      "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
    }
  },
  "meta": {}
}

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 Oct 2020