Skip to content

Add user to project

POST
/project/{id}/users
curl --request POST \
--url https://testomato.com/api/project/5e9602e7a39e5a46428b457f/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "admin@testomato.com", "role": 5 }'

Add a new user to the project

id
required
string

A unique project ID

Example
5e9602e7a39e5a46428b457f
Media typeapplication/json
object
email

User email

string
role

4 - Project Admin 5 - Project Developer 6 - Project Guest

string
Allowed values: 4 5 6
Example
{
"email": "admin@testomato.com",
"role": 5
}

User was successfully added to the project

Media typeapplication/json
object
email

Main user email

string
phone

A phone number (optional) and not required

string format: nullable
confirmTokenExpiration

Date and time when current common confirm token expires

object
date
string format: date-time
timezone_type
integer format: int32
timezone
string
name

User name

string
confirmed

Was user email confirmed?

boolean
timezone

User time zone name

string
reportPeriod
string
Allowed values: week
notificationEmail
string format: nullable
notificationDelay
integer format: int32
apiKey

User API Key

string
id
string
role
object
id
string
users_id
string format: nullable
name
string
permissions
Array<string>
systemRole
boolean
permissionsSwitches

Project permissions for current user

object
read

Can the current user view results?

boolean
run

Can the current user run checks?

boolean
editTest

Can the current user edit tests?

boolean
edit

Can the current user edit project settings?

boolean
manageUsers

Can the current user manage other users?

boolean
default: true
apiKey

Can the current user view the API key?

boolean
default: true
leave

Can the current user leave the project?

boolean
default: true
isPayer

Is user owner of the Project?

boolean
canBeRemoved
boolean
Example
{
"email": "roman@testomato.com",
"confirmTokenExpiration": {
"date": "2022-10-21 13:10:35.000000",
"timezone_type": 3,
"timezone": "Europe/Prague"
},
"name": "John Tomatoseeds",
"timezone": "Europe/Prague",
"reportPeriod": "week",
"notificationEmail": "roman+notifications@testomato.com",
"notificationDelay": 1,
"apiKey": "abcdef",
"id": 7,
"role": {
"id": 4,
"name": "project admin",
"permissions": [
[
"read",
"run",
"editTests",
"edit",
"manageUsers",
"apiKey"
]
],
"systemRole": true,
"permissionsSwitches": {
"manageUsers": true,
"apiKey": true,
"leave": true
}
},
"isPayer": false,
"canBeRemoved": true
}

The API token is missing, malformed or expired. Request a new one from POST /api/authenticate.

Media typeapplication/json
object
message

Error message text

string
default: Access denied! Please log in to access this resource.
code

Error code number

integer
default: 401
ok
boolean
error
boolean
default: true
Example
{
"message": "Access denied! Please log in to access this resource.",
"code": 401,
"ok": false,
"error": true
}

The token is valid but the operation is not allowed. Two distinct causes:

  • the subscription plan does not include API access — every endpoint returns this, regardless of the resource
  • the account lacks the required role on the project — reading needs read, changing checks needs editTests, and so on. See Project permissions.
Media typeapplication/json
object
message

Error message text

string
default: Sorry! Your current plan does not support access to Testomato API.
code

Error code number

integer
default: 403
ok
boolean
error
boolean
default: true
Example
{
"message": "Sorry! Your current plan does not support access to Testomato API.",
"code": 403,
"ok": false,
"error": true
}