HeadSpin Documentation
Documentation

Admin API

API Reference

Get user information

Get user information

Route Method
/v0/admin/user GET

Example

Get user information of all users in the org.


curl -X GET -H "Authorization: Bearer <your_api_token>" "https://api-dev.headspin.io/v0/admin/user"

Optional Parameters

  • <code class="dcode">/v0/admin/user?user_id=&lt;user-id&gt;</code>
  • <code class="dcode">/v0/admin/user?email=&lt;email&gt;</code>
  • By passing either <code class="dcode">user_id</code> or <code class="dcode">email</code> as a query parameter, you can get information about a specific user.
  • Otherwise, the API will return information of all users in the org.

Example


curl -X GET -H "Authorization: Bearer <your_api_token>" "https://api-dev.headspin.io/v0/admin/user?user_id=c5384afc-4b95-4dd5-8882-f6480bae066d" 
curl -X GET -H "Authorization: Bearer <your_api_token>" "https://api-dev.headspin.io/v0/admin/user?email=foo@bar.com"

Response

A JSON object in the form of <code class="dcode">{"users": [...]}</code> that has a list of user information.

An example:


{"users": [
  {
    "user_id": UUID, 
    "name": str, 
    "email": str, 
    "teams": [
      {
        "team_id": UUID, 
        "api_tokens": [str, ...]
      },
      ...
    ], 
    "org_id": UUID,
    "admin": bool, 
    "org_owner": bool
  },
  ...
]}
  • <code class="dcode">{"status": "Forbidden", "status_node: 403}</code> if a non-org owner tries to access the API.
  • <code class="dcode">{"status": "User not found.", "status_node: 404}</code> if the user is not found.
  • <code class="dcode">{"status": "Internal Server Error", "status_node: 500}</code> if there is an internal server error.