Skip to content
SynupAPI
Get an API key
POSTapi.synup.com/api/v4/users/create

Create User with Role

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.
Requires an API key. Send it as Authorization: API <your-key> — see Getting started.

Parameters

Body

NameTypeRequiredDescription
inputobjectrequired
input.emailstringrequiredUser's email address
input.roleIdstringrequiredID of the role to assign to the user
input.firstNamestringrequiredUser's first name
input.directCustomerbooleanrequiredIndicates if the user is a direct customer

Request

Request
curl -X POST 'https://api.synup.com/api/v4/users/create' \
  -H 'Authorization: API YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "input": {
    "email": "user@example.com",
    "roleId": "Q3VzdG9tUm9sZToyMDgzMQ==",
    "firstName": "John",
    "directCustomer": true
  }
}'

Responses

StatusDescription
200User created successfully
400Bad Request - Invalid input parameters
401Unauthorized - Valid API key required
403Forbidden - Insufficient permissions to create users
Example response
{
  "data": {
    "addUser": {
      "success": true,
      "errors": [],
      "user": {
        "id": "VXNlcjoxNjUzNjA=",
        "createdAt": "2025-02-03 10:25:44 UTC",
        "directCustomer": true,
        "email": "user@example.com",
        "firstName": "John",
        "lastName": null,
        "inviteStatus": "INVITE_SENT",
        "customRole": {
          "id": "Q3VzdG9tUm9sZToyMDgzMQ==",
          "name": "Admin"
        },
        "accountId": "QWNjb3VudDoxNjE1NA==",
        "preferences": {
          "locale": "en-US",
          "dateFormat": null,
          "timezone": null,
          "columnOrder": null
        }
      }
    }
  }
}

Response body

NameTypeRequiredDescription
dataobjectoptional
data.addUserobjectoptional
data.addUser.successbooleanoptionalIndicates if the user creation was successful
data.addUser.errorsarray of stringoptionalArray of error messages if any
data.addUser.userobjectoptional
data.addUser.user.idstringoptionalUnique identifier for the created user
data.addUser.user.createdAtstringoptionalTimestamp when the user was created
data.addUser.user.directCustomerbooleanoptionalIndicates if the user is a direct customer
data.addUser.user.emailstringoptionalUser's email address
data.addUser.user.firstNamestringoptionalUser's first name
data.addUser.user.lastNamestringoptionalUser's last name
data.addUser.user.inviteStatusstringoptionalCurrent status of the user's invitation
ACTIVEINVITE_SENTRESEND_INVITE
data.addUser.user.customRoleobjectoptional
data.addUser.user.customRole.idstringoptionalRole identifier
data.addUser.user.customRole.namestringoptionalRole name
data.addUser.user.accountIdstringoptionalID of the account the user belongs to
data.addUser.user.preferencesobjectoptional
data.addUser.user.preferences.localestringoptionalUser's locale preference
data.addUser.user.preferences.dateFormatstringoptionalUser's preferred date format
data.addUser.user.preferences.timezonestringoptionalUser's timezone preference
data.addUser.user.preferences.columnOrderstringoptionalUser's column order preference