monorepo/cloud/maplepress-backend/docs/API/get-tenant-by-id.md

1.3 KiB

Get Tenant by ID

GET /api/v1/tenants/{id}

Retrieve tenant information by tenant ID.

Authentication: Required (JWT Bearer token)

Headers:

  • Authorization: JWT {access_token}

URL Parameters:

Parameter Type Required Description
id UUID Yes Tenant ID

Example Request:

curl -X GET http://localhost:8000/api/v1/tenants/850e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response (200 OK):

{
  "id": "850e8400-e29b-41d4-a716-446655440000",
  "name": "TechStart Inc",
  "slug": "techstart",
  "status": "active",
  "created_at": "2024-10-24T00:00:00Z",
  "updated_at": "2024-10-24T00:00:00Z"
}

Error Responses:

This endpoint returns errors in RFC 9457 (Problem Details for HTTP APIs) format.

Content-Type: application/problem+json

401 Unauthorized:

{
  "type": "about:blank",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authentication required"
}

404 Not Found:

{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "Tenant not found"
}

500 Internal Server Error:

{
  "type": "about:blank",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "Failed to retrieve tenant"
}