Create a new account (organization) and link the current user to it.
If the user has no account yet, pass account_id=0 to initialize the first one.
account_id
is passed as a request parameter, not in the URL path.account_id=0
if the user has no accounts yet.This endpoint supports both:
(Parameters and behavior are identical.)
POST https://api.doboard.com/account_add
Body:
{
"session_id": "abc123xyz",
"account_id": 0,
"org_name": "Acme Robotics",
"name": "Alice Johnson",
"position": "CTO"
}
In this example:
account_id=0
means the user has no accounts yet, so a new one will be created.
session_id
authenticates the caller.
org_name
sets the new organization’s name.
name
/ position
set the user’s profile within the new org.
If the account ID in the URL does not match the one tied to the session, the request will be rejected.
Required
Valid session_id
(no guest tokens).
The user must have a confirmed email to proceed; otherwise, the request fails with a dedicated error.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
session_id |
string |
Yes | – | Authenticated user session ID |
account_id |
int |
Yes | – | Account context for the request — set to 0 if the user has no accounts yet |
org_name |
string |
Yes | – | Organization name (max 255 chars) |
name |
string |
No | – | Display name of the user within the org (max 255 chars) |
position |
string |
No | – | User’s position/title in the org (max 128 chars) |
On success, the API returns the newly created account ID:
{
"data": {
"operation_status": "SUCCESS",
"user_id": 123,
"account_id": 456,
"accounts": [/* updated account list */]
}
}
HTTP Code | error_no |
Message | Description |
---|---|---|---|
401 |
– | Unauthorized |
Missing or invalid session_id |
200 |
1401 |
account_id is required |
account_id parameter missing |
200 |
1402 |
Waiting for email confirmation |
User’s email not confirmed |
200 |
1403 |
org_name is required |
Organization name missing |
200 |
1404 |
Account Not Found |
Invalid or inaccessible account context |
500 |
0 |
Internal API Error |
Internal error |