Viewer

Authentication: All endpoints require an Authorization: Bearer <access token> header.

Most endpoints require an X-Company-ID: <company_id> header to scope requests to a specific company. This is the recommended header for most API operations.

Some endpoints require an X-Location-ID: <location_id> header when the query doesn't accept a locationId parameter.

See Authentication for details on how to obtain and use these headers.

Query Viewer

GraphQL Query

query Viewer {
  viewer {
    user {
      id
      fullName
      email
    }
    employees {
      company {
        id
        name
      }
      location {
        id
        name
      }
    }
  }
}

Example Variables

{}

Example Response

{
  "data": {
    "viewer": {
      "user": {
        "id": "53350",
        "fullName": "Roubler Support",
        "email": "api_user@roubler.com"
      },
      "employees": [
        {
          "company": {
            "id": "4",
            "name": "Roubler UK"
          },
          "location": {
            "id": "6",
            "name": "Roubler UK"
          }
        },
        {
          "company": {
            "id": "10",
            "name": "Roubler Dev"
          },
          "location": {
            "id": "143",
            "name": "Roubler Dev"
          }
        },
        {
          "company": {
            "id": "999",
            "name": "Integration Sandbox"
          },
          "location": {
            "id": "12325",
            "name": "Integration Sandbox"
          }
        }
      ]
    }
  }
}