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

# Exchange an API secret for a token

> Obtain a Bearer token for use with API endpoints that require authentication.



## OpenAPI

````yaml /api-reference/openapi.json post /auth/get_token
openapi: 3.1.0
info:
  title: Synthpop API
  description: >-
    The Synthpop public API. Create and manage Tasks, upload documents, and
    retrieve structured results.
  version: 1.0.0pre
servers:
  - url: https://app.synthpop.ai/public/v1
    description: Production
  - url: https://stage.synthpop.ai/public/v1
    description: Staging
security: []
tags:
  - name: Authentication
    description: |-

      API endpoints to obtain credentials.
              
  - name: Tasks
    description: >

      API endpoints to create, update and fetch Tasks and Task metadata.


      All the endpoints in this section other than "Get File Download Link"
      return a `TaskDetail`

      object. It contains the following:

      * Summary information for the task, such as IDs, a user friendly name, the
      Task's current
        status and time stamps.
      * Data Items associated with the Task:
        * Data Items are either Text, JSON or a link to a file.
        * A Data Item has a `group` tag. Tasks will have an `inputs` group (for Data Items uploaded)
          or an `outputs` group (for Data Items generated). There might be other tags for
          intermediate output for specific types of Tasks.
        * When analyzing the content of a data item, the result of the analysis is represented as
          `record_groups` within the Data Item. Record groups have:
          * A Record Type, identifying the type of data detected (e.g: insurance card, patient
            form, ...)
          * An optional timestamp that is derived from the content, signifying when the record
            group was created (eg.: date of service for a clinical visit).
  - name: Task List
    description: Retrieve a filtered and ordered list of Tasks.
paths:
  /auth/get_token:
    post:
      tags:
        - Authentication
      summary: Exchange an API secret for a token
      description: >-
        Obtain a Bearer token for use with API endpoints that require
        authentication.
      operationId: p_api_get_token_auth_get_token_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetTokenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTokenResponse'
        '400':
          description: Malformed API secret.
        '403':
          description: Invalid or obsolete API secret.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GetTokenRequest:
      properties:
        api_secret:
          type: string
          title: Api Secret
          description: >-
            The API secret. The API secret can be generated or reset via the
            Synthpop UI by an admin user.
      type: object
      required:
        - api_secret
      title: GetTokenRequest
    GetTokenResponse:
      properties:
        token:
          type: string
          title: Token
          description: A valid bearer token to use for API calls requiring authentication.
        org_settings:
          anyOf:
            - $ref: '#/components/schemas/OrgSettings'
            - type: 'null'
          description: Settings details about the organization associated with the token.
      type: object
      required:
        - token
      title: GetTokenResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    OrgSettings:
      properties:
        name:
          type: string
          title: Name
          description: The name of the organization.
        external_callback_enabled:
          type: boolean
          title: External Callback Enabled
          description: Whether callback is enabled for the organization.
        external_read_enabled:
          type: boolean
          title: External Read Enabled
          description: Whether auto upload is enabled for the organization.
      type: object
      required:
        - name
        - external_callback_enabled
        - external_read_enabled
      title: OrgSettings
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````