Creates a team role in the organization’s catalog and returns its identifier.
https://api.doboard.com/{account_id}/role_add
account_id is the numeric organization identifier associated with the user session.
GET, POST.
For GET, send parameters in the query string. For POST, use application/x-www-form-urlencoded.
POST is recommended because the method creates a record.
Requires a valid user session_id.
Only ADMIN and PROJECT_MANAGER users can create team roles. Guest sessions are not supported.
Public task tokens, public project tokens and MCP tokens do not provide access to this method.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id |
string | Yes | — | Authenticated session ID. |
name |
string | Yes | — | Role name. Truncated to the first 255 characters. |
color |
string | No | null |
Exactly six hexadecimal characters without a leading #. Example: 0066FF. |
role_type |
enum | No | PERMANENT |
PERMANENT or TEMPORARY. |
name is rejected.color must contain exactly six hexadecimal characters.color or sending an empty value creates a role without a color.role_type or sending an empty value uses PERMANENT.role_type must match one of the supported uppercase values.POST /42/role_add HTTP/1.1
Host: api.doboard.com
Content-Type: application/x-www-form-urlencoded
session_id=YOUR_SESSION_ID&name=Support&color=0066FF&role_type=PERMANENT
POST /42/role_add HTTP/1.1
Host: api.doboard.com
Content-Type: application/x-www-form-urlencoded
session_id=YOUR_SESSION_ID&name=Release+coordinator&role_type=TEMPORARY
Equivalent cURL request for a permanent role:
curl --request POST 'https://api.doboard.com/42/role_add' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'session_id=YOUR_SESSION_ID' \
--data-urlencode 'name=Support' \
--data-urlencode 'color=0066FF' \
--data-urlencode 'role_type=PERMANENT'
All identifiers in examples are illustrative.
{
"data": {
"operation_status": "SUCCESS",
"role_id": 3
}
}
| Field | Description |
|---|---|
data.operation_status |
SUCCESS when creation succeeds. |
data.role_id |
Integer identifier of the created role. |
The response does not contain the complete role object. Use role_get with the returned identifier to retrieve it.
| HTTP Code | error_no |
Message | Description |
|---|---|---|---|
401 |
401 |
session_id Unknown |
Missing or invalid session. |
403 |
403 |
Permission denied |
The user is not permitted to create roles. |
200 |
3801 |
name is required |
Role name is missing or empty. |
200 |
3802 |
color must be between 000000 and FFFFFF |
A nonempty color is not exactly six hexadecimal characters. |
200 |
3803 |
role_type must be in ('PERMANENT','TEMPORARY') |
Unsupported nonempty role type. |
200 |
0 |
Internal API Error |
The role could not be created. |
Example validation response:
{
"data": {
"operation_status": "FAILED",
"operation_message": "role_type must be in ('PERMANENT','TEMPORARY')"
},
"error_message": "role_type must be in ('PERMANENT','TEMPORARY')",
"error_no": 3803
}
users_count=0.TEMPORARY does not set an expiration date. This method has no date or duration parameters."0" as empty: it is rejected as a name and treated as an omitted optional color or role type.