Create Project
Create a project in the active tenant, together with its root audience.
POST /api/projects
Create a project in the active tenant. The project is created together with its root audience, Toda la empresa (the active commerces), in a single operation: the response already carries its rootAudienceId.
Auth: Required — project:create permission
This endpoint is tenant-level: it ignores the x-project-id header.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Project name (max 255 characters). Must be unique within the tenant, compared case-insensitively |
name is the only accepted field. A new project is never the main project: sending isMain (or any other field) responds 400.
Example
curl -X POST https://api.reten.ai/api/projects \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"name": "Food Service"
}'const response = await fetch("https://api.reten.ai/api/projects", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Food Service",
}),
});
const project = await response.json();import requests
response = requests.post(
"https://api.reten.ai/api/projects",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
json={
"name": "Food Service",
},
)
project = response.json()Response 201 Created
{
"id": "b7e4d2c1-6a5f-4e3d-9c8b-7a6f5e4d3c2b",
"name": "Food Service",
"rootAudienceId": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"isMain": false
}Error Responses
| Status | Description |
|---|---|
400 | name missing or empty — El nombre del proyecto es obligatorio. |
400 | name is not a string — El nombre del proyecto debe ser texto. |
400 | name is longer than 255 characters — El nombre del proyecto no puede superar los 255 caracteres. |
400 | Unknown field in the body, such as isMain — property isMain should not exist |
401 | Missing or invalid authentication token |
403 | Missing the project:create permission — Required permissions: project:create |
409 | Another project of the tenant already has that name (case-insensitive) — Ya existe un proyecto con el nombre "<name>". |