Create users

Learn how to create new users

Description

The following route can be used to create new users.

Endpoint

POST https://sentry.aleno.ai/users

Query parameters

No query parameters.

Payload

NameRequiredTypeDescription

users

required

List of UserCreateData

List that contains data related to users you want to create. Data description can be found bellow

UserCreateData description

UserCreateData is an object that describes users you want to create.

NameRequiredTypeDescription

userName

optional

string or null

user name you want to set for this user. If none provided, will be set to null.

userContext

optional

string or null

A context associated to the user. If none provided, will be set to null.

User information will be linked to any alert sent by Sentry. UserContext can be used used on alert reception to get context of this user related to the alert. If you want to set a complex userContext (for instance an object with multiple fields), you can pass a stringified JSON object then parse it on client side.

CURL example

curl -X POST \
  https://sentry.aleno.ai/users \
  -H 'accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "users": [
        { "userName": "Alice", "userContext": "alice_context" },
        { "userName": "Bob", "userContext": "bob_context" },
        { "userName": "Charlie", "userContext": "charlie_context" }
    ]
}'

Result

Returns list of User objects corresponding to new users.

{
    "data": [
        {
            "id": "a675415b-62d6-4400-87dc-7f50b24a99cf",
            "accountId": "938862f0-f629-413d-bc88-a7a4fe54e2ad",
            "userName": "Alice",
            "userContext": "alice_context",
            "createdAt": "2024-03-18T14:45:14.747Z",
            "updatedAt": "2024-03-18T14:45:14.747Z"
        },
        {
            "id": "4272ce81-df38-4232-9b4d-46ad4f40d4f9",
            "accountId": "938862f0-f629-413d-bc88-a7a4fe54e2ad",
            "userName": "Bob",
            "userContext": "bob_context",
            "createdAt": "2024-03-18T14:45:14.747Z",
            "updatedAt": "2024-03-18T14:45:14.747Z"
        },
        {
            "id": "f188a27c-3e87-44dd-8930-7fc16e3eb2ad",
            "accountId": "938862f0-f629-413d-bc88-a7a4fe54e2ad",
            "userName": "Charlie",
            "userContext": "charlie_context",
            "createdAt": "2024-03-18T14:45:14.747Z",
            "updatedAt": "2024-03-18T14:45:14.747Z"
        }
    ]
}

Last updated