Skip to content
Browse docs

Tenants & members

The 9 endpoints /api/v1 serves under Tenants & members.

POST /api/v1/tenants

http
POST /api/v1/tenants
  • Auth: required
  • Body: { name, slug, dataRegion? } (Zod)
  • 201
  • 409 — slug already in use

POST /api/v1/tenants/:id/members

http
POST /api/v1/tenants/:id/members
  • Auth: required (owner|admin)
  • Body: { email, role }
  • 201
  • 403

PUT /api/v1/tenants/:id/members/:userId

http
PUT /api/v1/tenants/:id/members/:userId
  • Auth: required (owner|admin)
  • Body: { role }
  • 200
  • 403

DELETE /api/v1/tenants/:id/members/:userId

http
DELETE /api/v1/tenants/:id/members/:userId
  • Auth: required (owner|admin)
  • 200
  • 403 — cannot remove the last owner (PLAN-RULE-05)

POST /api/v1/tenants/:id/api-keys

http
POST /api/v1/tenants/:id/api-keys
  • Auth: required (owner|admin — JWT only, X-API-Key not accepted)
  • Body: { name } (Zod: 1..80 chars)
  • 201
  • 400
  • 403
  • 404 — not a tenant member (PLAN-RULE-01)

GET /api/v1/tenants/:id/api-keys

http
GET /api/v1/tenants/:id/api-keys
  • Auth: required (tenant member)
  • 200
  • 404 — not a tenant member

DELETE /api/v1/tenants/:id/api-keys/:keyId

http
DELETE /api/v1/tenants/:id/api-keys/:keyId
  • Auth: required (owner|admin)
  • 200
  • 403
  • 404 — another tenant's key, or no such key

POST /api/v1/oauth/token

http
POST /api/v1/oauth/token
  • Auth: none — o par no body É a credencial
  • Body: { grant_type: 'client_credentials', client_id, client_secret, scope? }
  • 200
  • 400
  • 401

DELETE /api/v1/tenants/:id/m2m-credential

http
DELETE /api/v1/tenants/:id/m2m-credential
  • Auth: required (owner|admin)
  • 200
  • 403
  • 404