Manage users via API
Learn how to manage Axiom users via API.
This page explains how to manage users programmatically via the API.
Prerequisites
- Create an Axiom account.
- Create a dataset in Axiom where you send your data.
- Create an API token in Axiom with permissions to create, read, update, and delete users.
- In the code samples below, replace
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Create users
To create a user, send a POST request to the users
endpoint. In the body of the request, specify the following:
name
email
role
For example:
The example response contains the user ID that you can later use to access the user programmatically.
For more information, see the API reference.
Get information about users
Get information about all users
To get information about all the users in your Axiom organization, send a GET request to the users
endpoint. For example:
The example response is a list of user objects. Each object contains a unique user ID that you can later use to access the user programmatically.
For more information, see the API reference.
Get information about specific user
To get information about a specific user, send a GET request to the users/ID
endpoint where ID
is the unique ID of the user. For example:
Example response:
For more information, see the API reference.
Update users
To update the name of your own user, send a PUT request to the users/ID
endpoint where ID
is the unique ID of your user.
Using this endpoint, you can change the name of your own user. Authorize the request with a personal access token (PAT).
You cannot change the names of other users, you cannot change properties other than your name, and you cannot use an API token to authorize the request.
In the body of the request, specify the new name in the name
field. For example:
Example response:
For more information, see the API reference.
Delete users
To delete a user, send a DELETE request to the users/ID
endpoint where ID
is the unique ID of the user. For example:
For more information, see the API reference.
Was this page helpful?