Creates a read-only MCP token for the authenticated user in an organization. The token grants access to a selected set of projects until a specified expiration time.
https://api.doboard.com/{account_id}/mcp_token_add
account_id identifies the organization. Use the account associated with the authenticated user session. The same endpoint path is used on https://api-next.doboard.com.
POST only. Send parameters as application/x-www-form-urlencoded. A raw JSON request body is not parsed by this endpoint.
session_id.REGULAR, PROJECT_MANAGER, and ADMIN. Guests are not allowed.user_id does not select another owner.| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
session_id |
string | Yes | — | Valid user session for this organization. |
name |
string | Yes | — | Token name. Leading and trailing spaces are trimmed. The resulting name must be non-empty and no longer than 128 characters. |
project_ids |
string containing a JSON array | Yes | — | Up to 1,000 positive integer project IDs, each no greater than 4,294,967,295. Every project must exist, not be removed, and be accessible to the user. Example: [101,202]. |
expires_at |
datetime string | Yes | — | Future expiration time in UTC, exactly YYYY-MM-DD HH:MM:SS; maximum lifetime is 90 days. |
access_type |
enum | No | READ |
Only READ is supported. Other values, including an empty string, are rejected. |
An empty project array ([]) is valid and grants no project access. Omitting project_ids or sending an empty string is invalid. Duplicate IDs are removed and the result is sorted numerically. The 1,000-item limit is checked before deduplication. JSON strings such as ["101"], objects, fractional IDs, zero and negative IDs are invalid.
expires_at has no default; an empty value, an invalid date or a past/current expiration time is rejected. An empty or whitespace-only name is rejected.
expires_at must be strictly in the future and no more than 90 days (90 × 86,400 seconds) from the time the server validates the request.Both limit violations return HTTP 400, without a numeric error_no:
error_message |
Meaning |
|---|---|
Token lifetime must not exceed 90 days. |
The requested expiration is too far in the future. |
Maximum of 10 active tokens per user and account reached. |
All 10 active-token slots for this user and organization are occupied. |
Regular user-session calls to token creation and revocation normally share the API's IP-based write-request quotas with other write methods:
| Window | Shared request limit |
|---|---|
| 1 minute | 80 |
| 1 hour | 800 |
| 1 day | 3,200 |
These are shared request quotas, not the limit on how many tokens can exist. Server-side exemptions may apply. When this regular-request limiter rejects a call, the current API returns HTTP 500 with error_no=429 and error_message="Too Many Requests".
The MCP connection's own request limits are separate from these session-authenticated management calls.
The organization, project and token IDs in these examples are fictional. Replace YOUR_SESSION_ID with a real session and select projects available in your account.
POST /42/mcp_token_add HTTP/1.1
Host: api.doboard.com
Content-Type: application/x-www-form-urlencoded
session_id=YOUR_SESSION_ID&name=ChatGPT%20read-only&project_ids=%5B101%2C202%5D&expires_at=2027-01-01%2000%3A00%3A00&access_type=READ
Equivalent cURL request:
curl --request POST 'https://api.doboard.com/42/mcp_token_add' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'session_id=YOUR_SESSION_ID' \
--data-urlencode 'name=ChatGPT read-only' \
--data-urlencode 'project_ids=[101,202]' \
--data-urlencode 'expires_at=2027-01-01 00:00:00' \
--data-urlencode 'access_type=READ'
HTTP 200 on success:
{
"data": {
"operation_status": "SUCCESS",
"token_id": 9001,
"mcp_token": "dbmcp_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"name": "ChatGPT read-only",
"project_ids": [101, 202],
"access_type": "READ",
"expires_at": "2027-01-01 00:00:00"
}
}
The token value above is a fictional format example, not a usable credential.
| Field | Type | Description |
|---|---|---|
data.operation_status |
string | SUCCESS when the token has been created. |
data.token_id |
integer | Identifier used to list or revoke the token. |
data.mcp_token |
string | The full secret token, returned only during creation. |
data.name |
string | Trimmed token name. |
data.project_ids |
array of integers | Deduplicated and sorted project IDs. |
data.access_type |
string | READ. |
data.expires_at |
string | Accepted UTC expiration time. |
| HTTP Code | error_no |
Condition |
|---|---|---|
400 |
Not included in method validation responses | Required fields are missing, the name or date is invalid, project_ids is invalid, access_type is unsupported, the lifetime exceeds 90 days, or the user already has 10 active tokens in this organization. See error_message. |
401 |
401 |
Missing or invalid session. |
403 |
403 |
User role is not permitted, a requested project is inaccessible, or an MCP credential is used to call the management endpoint. |
405 |
0 in the current generic response |
Request method is not POST. |
500 |
2 |
The shared API account-status check rejects creation for a suspended or paused organization. |
500 |
429 in the shared regular-request limiter |
The applicable global API request quota is exceeded. |
503 |
Not included in the method response | Token creation cannot complete because storage is unavailable. Message: MCP token storage is unavailable.. |
500 |
May vary by failure path | Other internal failure, including failures before method-specific error handling. |
A method validation response has this shape; it does not include error_no or data.operation_message:
{
"data": {
"operation_status": "FAILED"
},
"error_message": "name and expires_at are required."
}
Current validation messages include Only READ access_type is supported. and Valid name and future expires_at (UTC YYYY-MM-DD HH:MM:SS) are required.
Storage-unavailable responses use the same response shape as validation errors, with error_message="MCP token storage is unavailable." and no error_no.
data.mcp_token when it is issued. It cannot be retrieved later: the server stores only its SHA-256 hash./mcp with Authorization: Bearer <mcp_token>. The MCP URL does not include account_id.created_at and updated_at are generated by MySQL NOW(); expires_at is interpreted in UTC.