---
title: "Create User with Role"
method: POST
path: "/users/create"
tags: ["User Management", "Users"]
---

# Create User with Role

`POST /users/create`

## Request

- Base URL: `https://api.synup.com/api/v4`
- URL: `https://api.synup.com/api/v4/users/create`
- Auth: none required
- TypeScript: <https://skmtc.dev/synup/apis/synup-api/docs/users/create/post.ts> (a function with typed inputs; its response is checked against the schema)

This API creates a new user with the specified role and attributes.

**Behavior:**
- Assigns the user a specific role based on permissions.
- Configures user attributes such as name, email, and access level.

## Headers

- `Authorization` string

## Request body

- object
  - `input` CreateUserInput, required
    - `email` string, email, required: User's email address
    - `roleId` string, required: ID of the role to assign to the user
    - `firstName` string, required: User's first name
    - `directCustomer` boolean, required: Indicates if the user is a direct customer

## Response `200`

User created successfully

- CreateUserResponse
  - `data` object
    - `addUser` object
      - `success` boolean: Indicates if the user creation was successful
      - `errors` string[]: Array of error messages if any
      - `user` CreatedUserV2
        - `id` string: Unique identifier for the created user
        - `createdAt` string, date-time: Timestamp when the user was created
        - `directCustomer` boolean: Indicates if the user is a direct customer
        - `email` string, email: User's email address
        - `firstName` string: User's first name
        - `lastName` string, nullable: User's last name
        - `inviteStatus` 'ACTIVE' | 'INVITE_SENT' | 'RESEND_INVITE': Current status of the user's invitation
        - `customRole` object
          - `id` string: Role identifier
          - `name` string: Role name
        - `accountId` string: ID of the account the user belongs to
        - `preferences` object
          - `locale` string: User's locale preference
          - `dateFormat` string, nullable: User's preferred date format
          - `timezone` string, nullable: User's timezone preference
          - `columnOrder` string, nullable: User's column order preference

## Other responses

- `400`: Bad Request - Invalid input parameters
- `401`: Unauthorized - Valid API key required
- `403`: Forbidden - Insufficient permissions to create users

---

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