Get the current user’s tenant settings. Requires a valid JWT access token. The tenant is resolved from the authenticated user — no tenant ID is needed in the URL.
- In MVP, each user owns exactly one tenant, so the backend resolves the tenant directly from the JWT.
- Returns the tenant’s id, name, slug, createdAt, and updatedAt fields.
- Only the tenant owner can access this endpoint.
sequenceDiagram
actor User
User->>+FE: navigates to Tenant Settings page
FE->>+BE: GET /api/v1/tenant <br> Authorization: Bearer {accessToken}
BE->>BE: resolve tenant from JWT
alt access token missing or invalid
BE-->>FE: 401 Unauthorized <br> ErrorResponse
end
BE->>DB: SELECT tenant WHERE owner_id = userId
BE->>-FE: 200 OK <br> TenantResponse
FE->>-User: display tenant settings
GET /api/v1/tenant (no request body)
200 OK TenantResponse:
{
"data": {
"id": 1,
"name": "Míra's Studio",
"slug": "mira-studio",
"createdAt": "2026-04-01T08:00:00Z",
"updatedAt": "2026-04-29T10:00:00Z"
}
}
401 Unauthorized (missing or invalid access token) ErrorResponse:
{
"status": 401,
"code": "AUTHENTICATION_FAILED",
"message": "Access token is missing or invalid"
}
Frontend
Validations
| Field | Constraints | Size | Pattern | Note |
|---|---|---|---|---|
| (no input fields — read-only view) |
Backend
Validations
| Field | Constraints | Size | Pattern | Note |
|---|---|---|---|---|
| (no request body — tenant resolved from JWT) |
Test Cases
| GIVEN | WHEN | THEN |
|---|---|---|
| authenticated user with an existing tenant | GET /tenant is called | 200 OK with tenant details returned |
| no Authorization header | GET /tenant is called | 401 AUTHENTICATION_FAILED error response is returned |
| expired access token | GET /tenant is called | 401 AUTHENTICATION_FAILED error response is returned |
Was this page helpful?
Thanks for the feedback.