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

# Retrieve an identity

> Retrieves detailed information about a specific identity using their identity ID or external ID from your system.



## OpenAPI

````yaml get /v2/identities/{id}
openapi: 3.1.0
info:
  title: orq.ai API
  version: '2.0'
  description: orq.ai API documentation
servers:
  - url: https://api.orq.ai
security:
  - ApiKey: []
tags:
  - name: Guardrail Rules
  - name: Policies
  - name: Routing Rules
  - name: Files
    description: File upload and retrieval operations.
  - name: FilesService
  - name: Projects
    description: Projects organize resources within a workspace
  - name: ProjectsService
  - name: Skills
    description: >-
      Skills are modular instructions you can use to codify processes and
      conventions
  - name: SkillsService
  - name: Responses
  - description: >-
      Run agents on a cadence — cron, interval, or one-off. Minimum firing
      interval is 1 hour.
    name: Agent Schedules
  - name: Reporting
    description: >-
      GenAI reporting API over canonical analytics rollups. Accepts a metric
      name, time range, grain, group-by, and filters; returns a typed time
      series and optional totals.
  - name: ReportingService
    description: |-
      ReportingService exposes a single QueryReport RPC that maps allowlisted
       analytics payloads onto safe rollup queries. Callers never send SQL;
       the backend picks the rollup family and grain from the metric
       catalogue, the requested range, and the requested grouping.
externalDocs:
  url: https://docs.orq.ai
  description: orq.ai Documentation
paths:
  /v2/identities/{id}:
    get:
      tags:
        - Identities
      summary: Retrieve an identity
      description: >-
        Retrieves detailed information about a specific identity using their
        identity ID or external ID from your system.
      operationId: RetrieveIdentity
      parameters:
        - schema:
            type: string
            description: Unique identity id or external id
          required: true
          description: Unique identity id or external id
          name: id
          in: path
        - schema:
            type:
              - boolean
              - 'null'
            default: false
            description: Include usage metrics of the last 30 days for the identity.
          required: false
          description: Include usage metrics of the last 30 days for the identity.
          name: include_metrics
          in: query
      responses:
        '200':
          description: Identity details
          content:
            application/json:
              schema:
                type: object
                properties:
                  _id:
                    type: string
                    format: ulid
                    description: >-
                      Unique ULID (Universally Unique Lexicographically Sortable
                      Identifier) for the contact
                    example: contact_01ARZ3NDEKTSV4RRFFQ69G5FAV
                  external_id:
                    type: string
                    minLength: 1
                    maxLength: 120
                    description: >-
                      Unique string value to identify the contact user in the
                      customer's system. This should be the same ID you use in
                      your system to reference this user.
                    example: user_12345
                  display_name:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Display name or nickname of the contact user. This is
                      typically shown in user interfaces.
                    example: Jane Smith
                  email:
                    type:
                      - string
                      - 'null'
                    format: email
                    description: Email address of the contact user
                    example: jane.smith@example.com
                  avatar_url:
                    type:
                      - string
                      - 'null'
                    format: uri
                    description: URL linking to the contact user's avatar image
                    example: https://example.com/avatars/jane-smith.jpg
                  tags:
                    type: array
                    items:
                      type: string
                    description: >-
                      Array of tags associated with the contact. Useful for
                      organizing and filtering contacts by categories,
                      departments, or custom classifications.
                    example:
                      - premium
                      - beta-user
                      - enterprise
                  metadata:
                    type: object
                    additionalProperties: {}
                    description: >-
                      Additional custom metadata associated with the contact as
                      key-value pairs. Use this to store any extra information
                      specific to your application.
                    example:
                      department: Engineering
                      role: Senior Developer
                      subscription_tier: premium
                      last_login: '2024-01-15T10:30:00Z'
                  created:
                    anyOf:
                      - format: date-time
                        type: string
                      - format: date-time
                        type: string
                    default: '2026-05-14T21:19:47.506Z'
                    readOnly: true
                    format: date-time
                    description: The date and time the resource was created
                  updated:
                    anyOf:
                      - type: string
                        format: date-time
                        default: '2026-05-14T21:19:47.508Z'
                      - format: date-time
                        type: string
                    readOnly: true
                    format: date-time
                    description: The date and time the resource was last updated
                  metrics:
                    type:
                      - object
                      - 'null'
                    properties:
                      total_cost:
                        type: number
                        description: Total cost in dollars of the last 30 days
                        example: 100
                      total_tokens:
                        type: number
                        description: Total tokens of the last 30 days
                        example: 1000
                      total_requests:
                        type: number
                        description: Total requests of the last 30 days
                        example: 1000
                      error_rate:
                        type: number
                        description: Error rate of the last 30 days as a ratio (0–1)
                        example: 22
                    required:
                      - total_cost
                      - total_tokens
                      - total_requests
                      - error_rate
                required:
                  - _id
                  - external_id
              example:
                _id: contact_01ARZ3NDEKTSV4RRFFQ69G5FAV
                external_id: user_12345
                display_name: Jane Smith
                email: jane.smith@example.com
                avatar_url: https://example.com/avatars/jane-smith.jpg
                tags:
                  - premium
                  - beta-user
                metadata:
                  department: Engineering
                  role: Senior Developer
                  subscription_tier: premium
                created: '2024-01-15T10:30:00Z'
                updated: '2024-01-15T10:30:00Z'
        '404':
          description: Identity not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                required:
                  - error
              example:
                error: Identity not found
        '500':
          description: Failed to fetch metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                required:
                  - error
              example:
                error: Failed to fetch metrics
      x-code-samples:
        - lang: typescript
          label: Node.js
          source: >-
            import { Orq } from "@orq-ai/node";


            const orq = new Orq({
              apiKey: process.env["ORQ_API_KEY"]
            });


            // Retrieve by identity ID

            const identity = await
            orq.identities.retrieve("contact_01ARZ3NDEKTSV4RRFFQ69G5FAV");


            // Or retrieve by external ID

            const identityByExternalId = await
            orq.identities.retrieve("user_12345");


            console.log(identity);
        - lang: python
          label: Python
          source: >-
            from orq_ai_sdk import Orq

            import os


            orq = Orq(api_key=os.getenv("ORQ_API_KEY"))


            # Retrieve by identity ID

            identity =
            orq.identities.retrieve("contact_01ARZ3NDEKTSV4RRFFQ69G5FAV")


            # Or retrieve by external ID

            identity_by_external_id = orq.identities.retrieve("user_12345")


            print(identity)
components:
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````