platform-api (0.3.0)

Download OpenAPI specification:

Tenants, legal entities and branches of the pawnshop SaaS.

system

Health and version, the same in every service

Liveness and database check

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "database": "up"
}

Code the running image was built from (read by the status page)

Responses

Response samples

Content type
application/json
{
  • "service": "platform-api",
  • "commit": "string",
  • "buildTime": "string",
  • "source": "pawnshop/pawnshopapp/platform-api"
}

tenants

Pawnshop businesses using the platform; each gets its own Keycloak realm

All tenants, newest first

Needs permission tenant.read (platform staff).

Authorizations:
keycloak

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a tenant for its owner's email and provision its realm

Needs permission tenant.create (platform staff). The name starts as the local part of the owner's email; the owner changes it later. The realm is provisioned right away through identity with the caller's token; if that fails, the tenant is still created (realmProvisioned: false) and POST /tenants/{tenantId}/provision retries.

Authorizations:
keycloak
Request Body schema: application/json
required
ownerEmail
required
string <email> <= 254 characters

Responses

Request samples

Content type
application/json
{
  • "ownerEmail": "owner@example.com"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "ownerEmail": "user@example.com",
  • "displayName": "string",
  • "status": "provisioning",
  • "realmProvisioned": true,
  • "createdAt": "2019-08-24T14:15:22Z"
}

Provision the tenant's realm again (safe to repeat)

Needs permission tenant.create. Brings the realm to the current template.

Authorizations:
keycloak
path Parameters
tenantId
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "ownerEmail": "user@example.com",
  • "displayName": "string",
  • "status": "provisioning",
  • "realmProvisioned": true,
  • "createdAt": "2019-08-24T14:15:22Z"
}

settings

Platform-wide settings

The platform-wide settings

Needs permission settings.read or settings.manage (platform staff).

Authorizations:
keycloak

Responses

Response samples

Content type
application/json
{
  • "invitationExpiry": 1
}

Change the platform-wide settings

Needs permission settings.manage (platform staff).

Authorizations:
keycloak
Request Body schema: application/json
required
invitationExpiry
required
integer [ 1 .. 720 ]

Hours an owner's invitation stays valid before it must be resent (ADR 0011); default 72

Responses

Request samples

Content type
application/json
{
  • "invitationExpiry": 1
}

Response samples

Content type
application/json
{
  • "invitationExpiry": 1
}