Update Project
Rename a project of the active tenant.
PATCH /api/projects/:id
Rename a project. The name is the only editable field of a project, so name is required even though the method is PATCH. The root audience is edited through PATCH /api/audience-criterias/:id — see Projects → Root audience.
Auth: Required — project:update permission
This endpoint is tenant-level: it ignores the x-project-id header.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | UUID | Project ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | New project name (max 255 characters). Must be unique within the tenant, compared case-insensitively; a project can change the casing of its own name |
isMain cannot be changed: sending it (or any field other than name) responds 400.
Example
curl -X PATCH https://api.reten.ai/api/projects/b7e4d2c1-6a5f-4e3d-9c8b-7a6f5e4d3c2b \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"name": "Food Service Norte"
}'const id = "b7e4d2c1-6a5f-4e3d-9c8b-7a6f5e4d3c2b";
const response = await fetch(`https://api.reten.ai/api/projects/${id}`, {
method: "PATCH",
headers: {
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Food Service Norte",
}),
});
const project = await response.json();import requests
project_id = "b7e4d2c1-6a5f-4e3d-9c8b-7a6f5e4d3c2b"
response = requests.patch(
f"https://api.reten.ai/api/projects/{project_id}",
headers={
"Authorization": "Bearer <token>",
"x-tenant-id": "<tenant-id>",
},
json={
"name": "Food Service Norte",
},
)
project = response.json()Response 200 OK
{
"id": "b7e4d2c1-6a5f-4e3d-9c8b-7a6f5e4d3c2b",
"name": "Food Service Norte",
"rootAudienceId": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"isMain": false
}Error Responses
| Status | Description |
|---|---|
400 | id is not a valid UUID |
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:update permission — Required permissions: project:update |
404 | No project with that id exists in the tenant — El proyecto no existe. |
409 | Another project of the tenant already has that name (case-insensitive) — Ya existe un proyecto con el nombre "<name>". |