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
| Name | Type | Required | Description |
|---|---|---|---|
input | object | required | |
input.email | string | required | User's email address |
input.roleId | string | required | ID of the role to assign to the user |
input.firstName | string | required | User's first name |
input.directCustomer | boolean | required | Indicates 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
}
}'const res = await fetch('https://api.synup.com/api/v4/users/create', {
method: 'POST',
headers: {
Authorization: 'API YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"input": {
"email": "user@example.com",
"roleId": "Q3VzdG9tUm9sZToyMDgzMQ==",
"firstName": "John",
"directCustomer": true
}
}),
});
const data = await res.json();import requests
res = requests.post(
"https://api.synup.com/api/v4/users/create",
headers={
"Authorization": "API YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"input": {
"email": "user@example.com",
"roleId": "Q3VzdG9tUm9sZToyMDgzMQ==",
"firstName": "John",
"directCustomer": True
}
},
)
data = res.json()req, _ := http.NewRequest("POST", "https://api.synup.com/api/v4/users/create", bytes.NewBufferString(payload))
req.Header.Set("Authorization", "API YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Responses
| Status | Description |
|---|---|
200 | User created successfully |
400 | Bad Request - Invalid input parameters |
401 | Unauthorized - Valid API key required |
403 | Forbidden - 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
| Name | Type | Required | Description |
|---|---|---|---|
data | object | optional | |
data.addUser | object | optional | |
data.addUser.success | boolean | optional | Indicates if the user creation was successful |
data.addUser.errors | array of string | optional | Array of error messages if any |
data.addUser.user | object | optional | |
data.addUser.user.id | string | optional | Unique identifier for the created user |
data.addUser.user.createdAt | string | optional | Timestamp when the user was created |
data.addUser.user.directCustomer | boolean | optional | Indicates if the user is a direct customer |
data.addUser.user.email | string | optional | User's email address |
data.addUser.user.firstName | string | optional | User's first name |
data.addUser.user.lastName | string | optional | User's last name |
data.addUser.user.inviteStatus | string | optional | Current status of the user's invitationACTIVEINVITE_SENTRESEND_INVITE |
data.addUser.user.customRole | object | optional | |
data.addUser.user.customRole.id | string | optional | Role identifier |
data.addUser.user.customRole.name | string | optional | Role name |
data.addUser.user.accountId | string | optional | ID of the account the user belongs to |
data.addUser.user.preferences | object | optional | |
data.addUser.user.preferences.locale | string | optional | User's locale preference |
data.addUser.user.preferences.dateFormat | string | optional | User's preferred date format |
data.addUser.user.preferences.timezone | string | optional | User's timezone preference |
data.addUser.user.preferences.columnOrder | string | optional | User's column order preference |