> ## Documentation Index
> Fetch the complete documentation index at: https://levers9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth

> With a token in the Authorization header, says which workspace it belongs to. Without one, on a controlplane whose database has no workspace yet, creates the first workspace and returns its admin token, but only when the request carries the controlplane's bootstrap secret in the Grpc-Metadata-X-Levers9-Bootstrap-Secret header (LEVERS9_BOOTSTRAP_SECRET on the controlplane; unset means bootstrap is off).



## OpenAPI

````yaml /api-reference/openapi/controlplane.openapi.json post /auth/authorize
openapi: 3.0.0
info:
  title: levers9 controlplane API
  version: 1.0.0
  description: >-
    REST view of the levers9 controlplane gRPC service, served by the
    controlplane on port 1994. Authenticate with `Authorization: Bearer
    <token>`.
servers:
  - url: https://levers9.uselevers.com
    description: local controlplane
  - url: https://api.uselevers.com
    description: hosted
security:
  - bearer: []
tags:
  - name: ControlPlaneService
paths:
  /auth/authorize:
    post:
      tags:
        - ControlPlaneService
      summary: Auth
      description: >-
        With a token in the Authorization header, says which workspace it
        belongs to. Without one, on a controlplane whose database has no
        workspace yet, creates the first workspace and returns its admin token,
        but only when the request carries the controlplane's bootstrap secret in
        the Grpc-Metadata-X-Levers9-Bootstrap-Secret header
        (LEVERS9_BOOTSTRAP_SECRET on the controlplane; unset means bootstrap is
        off).
      operationId: ControlPlaneService_Authorize
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/controlplaneAuthorizeResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
components:
  schemas:
    controlplaneAuthorizeResponse:
      type: object
      properties:
        ok:
          type: boolean
        workspaceId:
          type: string
        newToken:
          type: string
        errorMsg:
          type: string
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.