> ## 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.

# Create an identity

> Creates a new identity with a unique external_id. If an identity with the same external_id already exists, the operation will fail. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.



## OpenAPI

````yaml post /v2/identities
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:
    post:
      tags:
        - Identities
      summary: Create an identity
      description: >-
        Creates a new identity with a unique external_id. If an identity with
        the same external_id already exists, the operation will fail. Use this
        endpoint to add users from your system to orq.ai for tracking their
        usage and engagement.
      operationId: CreateIdentity
      requestBody:
        description: Identity profile information
        content:
          application/json:
            schema:
              type: object
              properties:
                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'
              required:
                - external_id
      responses:
        '201':
          description: Created Identity
          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
                  workspace_id:
                    type: string
                    format: uuid
                    description: >-
                      Unique identifier for the workspace to which the contact
                      belongs
                    example: 550e8400-e29b-41d4-a716-446655440000
                  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
                required:
                  - _id
                  - external_id
                  - workspace_id
              example:
                _id: contact_01ARZ3NDEKTSV4RRFFQ69G5FAV
                external_id: user_12345
                workspace_id: 550e8400-e29b-41d4-a716-446655440000
                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'
      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"]
            });

            const identity = await orq.identities.create({
              externalId: "user_12345",
              displayName: "Jane Smith",
              email: "jane.smith@example.com",
              tags: ["premium", "beta-user"],
              metadata: {
                department: "Engineering",
                role: "Senior Developer"
              }
            });

            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"))

            identity = orq.identities.create(
                external_id="user_12345",
                display_name="Jane Smith",
                email="jane.smith@example.com",
                tags=["premium", "beta-user"],
                metadata={
                    "department": "Engineering",
                    "role": "Senior Developer"
                }
            )

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

````