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

> ## Agent Instructions
> To set up traceroot in a repository, follow the setup prompt in https://traceroot.ai/docs/getting-started/coding-agents.md.

# Whoami

> Check which traceroot project and workspace an API key belongs to. Useful for confirming that a credential is valid and correctly scoped.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/public/whoami
openapi: 3.1.0
info:
  title: traceroot Public API
  version: 0.1.0
servers:
  - description: traceroot Cloud
    url: https://app.traceroot.ai
  - description: Self-hosted
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: http://localhost:8000
        description: Your traceroot backend URL
security: []
paths:
  /api/v1/public/whoami:
    get:
      tags:
        - Whoami
      summary: Whoami
      description: Return the identity the authenticated API key maps to.
      operationId: whoami
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication service unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    WhoamiResponse:
      description: >-
        Identity a project API key resolves to, for `login` / `status`.


        Name fields are nullable: they depend on what the internal
        key-validation

        contract returns, and the backend never fabricates them. The full API
        token

        is never included — only ``key_hint``.


        ``key_scope`` is the exception to the nullability above, deliberately. A

        holder asking what their key may do needs an answer, not a maybe: a null

        would have to be handled by every caller and would mean the same thing
        the

        narrow scope already means. It is a closed set of values rather than a
        free

        string so a client can exhaust it.
      properties:
        host:
          title: Host
          type: string
        key_hint:
          anyOf:
            - type: string
            - type: 'null'
          title: Key Hint
        key_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Key Name
        key_scope:
          enum:
            - ingest
            - admin
          title: Key Scope
          type: string
        project_id:
          title: Project Id
          type: string
        project_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Name
        ui_base_url:
          title: Ui Base Url
          type: string
        workspace_id:
          title: Workspace Id
          type: string
        workspace_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Workspace Name
      required:
        - project_id
        - project_name
        - workspace_id
        - workspace_name
        - key_name
        - key_hint
        - key_scope
        - host
        - ui_base_url
      title: WhoamiResponse
      type: object
    ErrorResponse:
      description: >-
        The canonical public error envelope (matches the gateway's normalized
        shape).
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

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