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

# Issue a Public API access token

> Issues an opaque Bearer access token for server-to-server Public API integrations using the OAuth client credentials grant. Authenticate the client with HTTP Basic auth: `Authorization: Basic base64(client_id:client_secret)`.



## OpenAPI

````yaml /openapi/public-v1.json post /public/v1/oauth/token
openapi: 3.1.0
info:
  title: FITsociety Public API v1
  version: 1.0.0
  description: >-
    Developer Public API endpoints under `/public/v1`. This reference is
    filtered to OAuth/Bearer Public API resources and excludes provider callback
    receivers, storefront routes, public widgets, wishlist routes, and
    access-device validation endpoints.
  contact:
    name: FITsociety Engineering
servers:
  - url: https://api.fitsociety.io
    description: Production
security: []
tags:
  - name: OAuth
    description: Public API OAuth endpoints for server-to-server client credentials.
  - name: Health
    description: Public API token health checks.
  - name: Platform
    description: >-
      Inspect Public API client context, capabilities, scopes, and redacted
      audit logs.
  - name: Company Catalog
    description: Read and manage company profile metadata and locations.
  - name: Clients
    description: >-
      Create and manage clients through the Public API using Bearer access
      tokens.
  - name: Coaches
    description: Retrieve coaches for the authenticated company via integrations.
  - name: Calendar Events
    description: Read Public API calendar events.
  - name: Calendar Templates
    description: >-
      Read and manage event types and event templates used by calendar
      availability and bookings.
  - name: Calendar Extensions
    description: >-
      Read recurring bookings, booking requests, calendar tasks, and
      availability closure metadata.
  - name: Availability
    description: Read bookable availability slots and signed availability tokens.
  - name: Availability Management
    description: >-
      Manage coach and location availability templates used to derive bookable
      slots.
  - name: Bookings
    description: Read and manage Public API bookings.
  - name: Finance
    description: >-
      Read invoices, payments, products, subscriptions, memberships, and credits
      with guarded finance writes.
  - name: Webhooks
    description: >-
      Manage outbound webhook subscriptions and inspect delivery attempts
      through Public API Bearer endpoints.
  - name: Measurements
    description: Read and write client measurement entries.
  - name: Progress Photos
    description: Read client progress photo metadata and short-lived signed media URLs.
  - name: Forms
    description: Read form metadata and submissions, and assign forms.
  - name: Documents
    description: Read document and folder metadata only.
  - name: Habits
    description: Read habits and habit entries.
  - name: Goals
    description: Read client goal summaries.
  - name: Messaging
    description: Read client chat and message metadata.
  - name: Reports
    description: Read aggregate attendance, revenue, and retention summaries.
paths:
  /public/v1/oauth/token:
    post:
      tags:
        - OAuth
      summary: Issue a Public API access token
      description: >-
        Issues an opaque Bearer access token for server-to-server Public API
        integrations using the OAuth client credentials grant. Authenticate the
        client with HTTP Basic auth: `Authorization: Basic
        base64(client_id:client_secret)`.
      operationId: postPublicV1OauthToken
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - grant_type
              properties:
                grant_type:
                  type: string
                  enum:
                    - client_credentials
                  example: client_credentials
                scope:
                  type: string
                  example: clients:write
                  description: >-
                    Optional space-separated subset of the scopes assigned to
                    the client. If omitted, all assigned client scopes are
                    issued.
      responses:
        '200':
          description: Access token issued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiTokenResponse'
        '400':
          description: Invalid grant type or invalid scope
        '401':
          description: Invalid client credentials
      security:
        - PublicOAuthClientBasicAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST \
              -u "<client_id>:<client_secret>" \
              -H "Content-Type: application/x-www-form-urlencoded" \
              -d "grant_type=client_credentials&scope=clients:write" \
              https://api.fitsociety.io/public/v1/oauth/token
components:
  schemas:
    PublicApiTokenResponse:
      type: object
      required:
        - access_token
        - token_type
        - expires_in
        - scope
      properties:
        access_token:
          type: string
          example: fspt_0123456789abcdef0123456789abcdef0123456789abcdef
        token_type:
          type: string
          enum:
            - Bearer
          example: Bearer
        expires_in:
          type: integer
          example: 3600
        scope:
          type: string
          example: clients:write
  securitySchemes:
    PublicOAuthClientBasicAuth:
      type: http
      scheme: basic
      description: >-
        Public API OAuth client credentials for `/public/v1/oauth/token`. Use
        `client_id` as the username and `client_secret` as the password.

````