openapi: 3.1.0
info:
  title: Relay Admin API
  version: 1.0.0
  description: Platform-administration endpoints for authorized Relay staff.
servers:
  - url: https://api.relay.techminemw.com/api/v1/admin
security:
  - bearerAuth: []
paths:
  /plans:
    get:
      operationId: listRelayPlans
      responses:
        '200': {description: Versioned plan catalogue}
        '403': {description: Platform administrator role required}
  /tenants:
    get:
      operationId: listRelayTenants
      responses:
        '200': {description: Tenant registry}
    post:
      operationId: provisionRelayTenant
      responses:
        '201': {description: Tenant, administrator membership and subscription created}
        '422': {description: Validation failed}
  /tenants/{tenant}:
    parameters:
      - in: path
        name: tenant
        required: true
        schema: {type: string, format: uuid}
    get:
      operationId: getRelayTenant
      responses:
        '200': {description: Tenant detail}
        '404': {description: Tenant not found}
    patch:
      operationId: updateRelayTenant
      responses:
        '200': {description: Tenant updated}
  /tenants/{tenant}/suspend:
    post:
      operationId: suspendRelayTenant
      parameters:
        - in: path
          name: tenant
          required: true
          schema: {type: string, format: uuid}
      responses:
        '200': {description: Tenant suspended}
        '422': {description: Founding tenant protection or invalid state}
  /tenants/{tenant}/activate:
    post:
      operationId: activateRelayTenant
      parameters:
        - in: path
          name: tenant
          required: true
          schema: {type: string, format: uuid}
      responses:
        '200': {description: Tenant activated}
  /tenants/{tenant}/subscription:
    post:
      operationId: changeRelayTenantSubscription
      parameters:
        - in: path
          name: tenant
          required: true
          schema: {type: string, format: uuid}
      responses:
        '201': {description: Subscription changed}
  /subscriptions:
    get:
      operationId: listRelaySubscriptions
      responses:
        '200': {description: Platform subscription registry}
components:
  securitySchemes:
    bearerAuth: {type: http, scheme: bearer, bearerFormat: Sanctum}
