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

# Exchange provider OAuth code

> Exchange a provider OAuth code for provider tokens.



## OpenAPI

````yaml https://api.foreverbetter.xyz/openapi.json post /connections/{provider}/token
openapi: 3.1.0
info:
  title: ForeverBetter API
  version: 0.4.8
  description: >-
    ForeverBetter API and MCP-compatible service for genetics, biomarkers,
    wearables, lab locator handoffs, and dashboard specs.
servers:
  - url: https://api.foreverbetter.xyz
security:
  - bearerAuth: []
paths:
  /connections/{provider}/token:
    post:
      summary: Exchange provider OAuth code
      description: Exchange a provider OAuth code for provider tokens.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - code
                - client_id
                - client_secret
                - redirect_uri
              additionalProperties: false
              properties:
                code:
                  type: string
                client_id:
                  type: string
                client_secret:
                  type: string
                redirect_uri:
                  type: string
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````