Internal Documentation internal
TalkIDE internal documentation

Update the current user’s tenant name and/or slug. Requires a valid JWT access token. The tenant is resolved from the authenticated user — no tenant ID is needed in the URL.

  • Both name and slug are required in the request body.
  • The slug must be unique across all tenants in the system.
  • The slug must be lowercase alphanumeric characters and hyphens only (pattern: ^[a-z0-9-]+$).
  • Only the tenant owner can update the tenant.
  • Returns the full updated tenant on success.
sequenceDiagram
    actor User

    User->>+FE: fills Tenant Settings form

    FE->>FE: validate form
    alt form is invalid
        FE-->>User: show error messages <br> disable submit button
    end

    User->>FE: submits Tenant Settings form

    FE->>+BE: PUT /api/v1/tenant <br> Authorization: Bearer {accessToken} <br> UpdateTenantRequest

    BE->>BE: validate request
    alt request is invalid
        BE-->>FE: 400 Bad Request <br> ErrorResponse
    end

    BE->>BE: resolve tenant from JWT
    alt access token missing or invalid
        BE-->>FE: 401 Unauthorized <br> ErrorResponse
    end

    BE->>DB: check if slug is taken by another tenant
    alt slug already taken
        BE-->>FE: 409 Conflict <br> ErrorResponse
    end

    BE->>DB: UPDATE tenant SET name, slug, updated_at

    BE->>-FE: 200 OK <br> TenantResponse

    FE->>-User: show success message, display updated settings

PUT /api/v1/tenant UpdateTenantRequest:

{
  "name": "Míra's Studio",
  "slug": "mira-studio"
}

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"
  }
}

400 Bad Request (validation) ErrorResponse:

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Validation failed",
  "errors": [
    { "field": "slug", "message": "must match ^[a-z0-9-]+$" }
  ]
}

401 Unauthorized (missing or invalid access token) ErrorResponse:

{
  "status": 401,
  "code": "AUTHENTICATION_FAILED",
  "message": "Access token is missing or invalid"
}

409 Conflict (slug already taken) ErrorResponse:

{
  "status": 409,
  "code": "CONFLICT_TENANT",
  "message": "Slug is already taken by another tenant"
}

Frontend

Validations

FieldConstraintsSizePatternNote
namenot_blank1 - 100
slugnot_blank1 - 50^[a-z0-9-]+$Lowercase alphanumeric and hyphens only

Backend

Validations

FieldConstraintsSizePatternNote
namenot_blank1 - 100
slugnot_blank1 - 50^[a-z0-9-]+$Must be unique across all tenants

Test Cases

GIVENWHENTHEN
authenticated user, valid name and slug (slug unchanged)PUT /tenant is called200 OK with updated tenant returned
authenticated user, valid name and new unique slugPUT /tenant is called200 OK with updated tenant returned
authenticated user, slug already taken by another tenantPUT /tenant is called409 CONFLICT_TENANT error response is returned
name is blankPUT /tenant is called400 VALIDATION_ERROR error response is returned
name longer than 100 charactersPUT /tenant is called400 VALIDATION_ERROR error response is returned
slug is blankPUT /tenant is called400 VALIDATION_ERROR error response is returned
slug longer than 50 charactersPUT /tenant is called400 VALIDATION_ERROR error response is returned
slug contains uppercase charactersPUT /tenant is called400 VALIDATION_ERROR error response is returned
slug contains spaces or special charactersPUT /tenant is called400 VALIDATION_ERROR error response is returned
invalid request (empty body)PUT /tenant is called400 VALIDATION_ERROR error response is returned
no Authorization headerPUT /tenant is called401 AUTHENTICATION_FAILED error response is returned
expired access tokenPUT /tenant is called401 AUTHENTICATION_FAILED error response is returned

Was this page helpful?

Thanks for the feedback.