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

# Who Am I

> Check an API key and resolve an agent's Agent ID to the numeric IDs other routes take.

Takes a Tuner API key only. Returns the key's workspace, the key's name and last four
characters, and, when `agent_remote_identifier` is sent, that agent.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json get /api/v1/whoami
openapi: 3.1.0
info:
  title: Tuner API
  description: >-
    Send calls to Tuner and manage agents, evaluation settings, simulations and
    workspace settings.
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    description: Send call recordings and transcripts to Tuner and retrieve call details.
    x-group: Calls
  - name: workspaces
    description: >-
      Manage your workspaces, the API keys used to access them, and their PII
      redaction and data retention settings.
    x-group: Workspaces
  - name: simulation
    description: >-
      Run simulated calls against your agents, manage simulation profiles, and
      look up the caller personas and background-noise environments they can
      use.
    x-group: Simulation
  - name: scenarios
    description: Manage the test scenarios that simulated calls follow.
    x-group: Scenarios
  - name: replay-testing
    description: >-
      Replay recorded caller audio against a new version of your agent: upload
      or extract voice clips from real calls, then run them as replay runs.
    x-group: Replay Testing
  - name: agents
    description: Create, update and list the voice agents connected to your workspace.
    x-group: Agents
  - name: agent-settings
    description: >-
      Configure how Tuner evaluates an agent's calls, including evaluations,
      call outcomes, intents, data extraction, rules and alerts, plus the
      agent's SIP and outbound call configuration.
    x-group: Agent Settings
  - name: traces
    description: Send OpenTelemetry traces from your agent to Tuner.
    x-group: Traces
  - name: providers
    description: List the voice providers Tuner can connect to.
    x-group: Providers
paths:
  /api/v1/whoami:
    get:
      tags:
        - workspaces
      summary: Who Am I
      description: >-
        Check an API key and resolve an agent's Agent ID to the numeric IDs
        other routes take.


        Takes a Tuner API key only. Returns the key's workspace, the key's name
        and last four

        characters, and, when `agent_remote_identifier` is sent, that agent.
      operationId: whoami_api_v1_whoami_get
      parameters:
        - name: agent_remote_identifier
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              An agent's Agent ID in Tuner (Agent Settings > Agent Connection >
              Agent ID). When sent, the matching agent of the key's workspace is
              returned.
            examples:
              - booking-staging
            title: Agent Remote Identifier
          description: >-
            An agent's Agent ID in Tuner (Agent Settings > Agent Connection >
            Agent ID). When sent, the matching agent of the key's workspace is
            returned.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiResponse'
        '401':
          description: >-
            No `Authorization` header, or a credential that is not a Tuner API
            key.
          content:
            application/json:
              example:
                code: invalid_api_key
                detail: This endpoint requires a Tuner API key.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Unknown or revoked API key.
          content:
            application/json:
              example:
                code: invalid_api_key
                detail: Invalid API key.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            `agent_remote_identifier` was sent and no agent in the key's
            workspace has it.
          content:
            application/json:
              example:
                code: agent_not_found
                detail: Agent with remote identifier booking-staging not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    WhoamiResponse:
      properties:
        workspace:
          $ref: '#/components/schemas/WhoamiWorkspace'
        api_key:
          $ref: '#/components/schemas/WhoamiApiKey'
        agent:
          anyOf:
            - $ref: '#/components/schemas/WhoamiAgent'
            - type: 'null'
          description: The agent with `agent_remote_identifier`; null when it was not sent.
      type: object
      required:
        - workspace
        - api_key
        - agent
      title: WhoamiResponse
      description: The workspace and key behind an API key, and optionally an agent.
    ErrorResponse:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
          description: Machine-readable error code. Branch on this, not on `detail`.
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - code
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WhoamiWorkspace:
      properties:
        id:
          type: integer
          title: Id
          description: Workspace ID.
          examples:
            - 12
        name:
          type: string
          title: Name
          description: Workspace name.
          examples:
            - Acme
      type: object
      required:
        - id
        - name
      title: WhoamiWorkspace
      description: The workspace the API key belongs to.
    WhoamiApiKey:
      properties:
        name:
          type: string
          title: Name
          description: Name of the API key.
          examples:
            - ci-staging
        last_four:
          type: string
          title: Last Four
          description: Last four characters of the key.
          examples:
            - 9f3a
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the key was created.
      type: object
      required:
        - name
        - last_four
        - created_at
      title: WhoamiApiKey
      description: The API key the request was made with. The key itself is never returned.
    WhoamiAgent:
      properties:
        id:
          type: integer
          title: Id
          description: Tuner's numeric agent ID, used as `{agent_id}`.
          examples:
            - 77
        remote_identifier:
          type: string
          title: Remote Identifier
          description: The agent's Agent ID in Tuner.
          examples:
            - booking-staging
        name:
          type: string
          title: Name
          description: Agent name.
          examples:
            - Booking (staging)
      type: object
      required:
        - id
        - remote_identifier
        - name
      title: WhoamiAgent
      description: The agent matching `agent_remote_identifier`.
    ErrorCode:
      type: string
      enum:
        - invalid_api_key
        - insufficient_access
        - insufficient_credits
        - workspace_not_found
        - agent_not_found
        - scenario_not_found
        - run_not_found
        - no_scenarios_for_tag
        - run_too_large
        - unresolved_name
        - run_in_flight
        - simulation_not_configured
        - run_start_failed
        - rate_limited
        - validation_error
        - internal_error
      title: ErrorCode
      description: Machine-readable `code` on every error response.
    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
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````

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