Projects
Commercial channels within a tenant — each project is a data boundary with its own root audience.
Overview
A project is a commercial channel within a tenant. It is a data boundary: every audience, event filter, Activity Generation Config, activity and activity result belongs to exactly one project from the moment it is created, and it never moves to another project.
Every tenant has at least one project — its main project, marked with isMain: true. Every tenant starts with a main project named General; in tenants that existed before projects were introduced, it holds all their earlier data. The main project can be renamed; the isMain mark cannot be changed.
Projects can also be managed from the Reten administration panel, under Settings → Projects.
Project properties
| Property | Type | Description |
|---|---|---|
id | UUID | Project ID |
name | string | Project name, unique within the tenant (case-insensitive) |
rootAudienceId | UUID | ID of the project's root audience |
isMain | boolean | true for the tenant's main project |
Root audience
Every project is created together with its root audience, named Toda la empresa (the whole company): the active commerces. Its ID is returned as rootAudienceId, and audience responses mark it with isRoot: true.
- Every audience of the project is evaluated within its root audience: the SQL of any other audience is intersected with it (see Generate SQL).
- The root audience is edited like any other audience, with
PATCH /api/audience-criterias/:id, but editing it also requires theproject:updatepermission. Without it, the API responds403—No tiene permiso para editar la audiencia raíz del proyecto. - The root audience cannot be deleted:
DELETE /api/audience-criterias/:idresponds409—La audiencia raíz de un proyecto no se puede eliminar.
Choosing the project of a request
The project endpoints (/api/projects) are tenant-level: they ignore the x-project-id header, because they are where a client discovers the projects it can work with.
The endpoints that read or write project data are project-scoped: each request works in exactly one project, taken from the x-project-id header or, for a project API key, from the key itself. The exceptions are GET /api/integration/activities/tasks and POST /api/integration/activity-results/tasks, which are project-optional: there the header is optional and, when sent, narrows the request to that project. See Authentication → Project Context.
Permissions
| Permission | Grants | Roles |
|---|---|---|
project:view | List the tenant's projects | super_admin, admin, fde, supervisor, operator, viewer |
project:create | Create projects | super_admin, admin, fde |
project:update | Rename projects and edit their root audience | super_admin, admin, fde |