API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console
Concept

Multi-tenancy

Reading time · 6 minUpdated · 1 May 2026

Codemeta OS is a multi-tenant SaaS. Every tenant is isolated at the data level — every record carries a tenantId reference, and every API query is required to filter by tenant.

The X-Tenant-Id header

Every request to /api/v1/... needs X-Tenant-Id. If it is missing, the API responds with 400 Bad Request.

GET /api/v1/tickets HTTP/1.1
Host: os.codemeta.de
X-Tenant-Id: 0192f2c0-8d1c-7a3b-9e4f-d3e7f1a2b5c8
Cookie: codemeta-session=…

The value is the UUIDv7 of the tenant. You can find out which tenants are assigned to your account via the user profile endpoint.

User-to-tenant mapping

An account can belong to multiple tenants at the same time (typical for IT service provider (MSP) staff with customer tenant access). After sign-in, you can see which tenants are available to your account via the tenants endpoint.

What does this mean for your code?

  • Cache cookie + header per tenant. Store cookies.txt and the tenantId together. If your application works with multiple tenants, requests run in separate sessions per tenant.
  • Never set tenantId as a body field. The API derives it exclusively from the header. A tenantId body field is ignored or rejected.
  • Don’t guess the tenant on a 403. If a GET returns 403, check the data scopes first – not the tenant. Learn more under Permissions & scopes.

Search