---
title: "Create a user"
method: POST
path: "/users"
tags: ["Users"]
---

# Create a user

`POST /users`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/users`
- Auth: HTTP bearer

Add a user to the organization. 

 **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

To use this endpoint, select **Write Users** under the Setup & Administration category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

## Request body

- CreateUserRequest: The user creation arguments
  - `authType` 'default' | 'saml', required: The authentication type the user uses to authenticate. To use SAML this organization must have a configured SAML integration. Valid values: `default`, `saml`.
  - `email` string, required: The email address of this user.
  - `expireAt` string: For users with temporary access, this is the expiration datetime in RFC3339 format
  - `name` string, required: The first and last name of the user.
  - `roles` CreateUserRequestRoles[], required: The list of roles that applies to this user. A user may have "organizational" roles, which apply to the user at the organizational level, and "tag-specific" roles, which apply to the user for a given tag.
    - `roleId` string, required: The unique ID for the role.
    - `tagId` string: ID of the tag this role applies to.

## Response `200`

Newly created user object with ID.

- UserResponse: A single user.
  - `data` User: A user object.
    - `authType` 'default' | 'saml', required: The authentication type the user uses to authenticate. To use SAML this organization must have a configured SAML integration. Valid values: `default`, `saml`.
    - `email` string, required: The email address of this user.
    - `id` string, required: ID of the user.
    - `name` string, required: The first and last name of the user.
    - `roles` UserRoleAssignment[], required: The list of roles that applies to this user. A user may have "organizational" roles, which apply to the user at the organizational level, and "tag-specific" roles, which apply to the user for a given tag.
      - `expireAt` string: For user account expiration, the access expiration datetime in RFC3339 format
      - `role` UserRole: A user role object.
        - `id` string: The unique ID for the role.
        - `name` string: The name of the role.
      - `tag` TagTinyResponse: A minified tag object
        - `id` string: ID of the tag.
        - `name` string: Name of the tag.
        - `parentTagId` string: If this tag is part a hierarchical tag tree, this is the ID of the parent tag, otherwise this will be omitted.

## Other responses

- `default`: Error response

---

[API](https://skmtc.dev/samsara/apis/samsara-api.md) - [All operations](https://skmtc.dev/samsara/apis/samsara-api/llms.txt) - [OpenAPI document](https://skmtc.dev/samsara/apis/samsara-api/revisions/a9e35d4999be?raw)
