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

# Get Pattern Instance



## OpenAPI

````yaml https://api.aiql.io/openapi.json get /patterns/{id}/instances/{instanceId}
openapi: 3.1.0
info:
  title: aiql-api
  version: 0.1.0
servers:
  - url: https://api.aiql.io
security: []
tags:
  - name: Health
    description: Service health checks.
  - name: Workspaces
    description: Workspace management.
  - name: Ingestions
    description: Document ingestion pipeline.
  - name: Queries
    description: Natural-language queries.
  - name: Sources
    description: Ingested sources and their contents.
  - name: Requests
    description: Source addition/removal requests awaiting review.
  - name: Request Changes
    description: Individual source add/remove changes on a request.
  - name: Request Reviews
    description: Reviews of a request, including draft and submit.
  - name: Request Comments
    description: Comments on a request review.
  - name: Canvases
    description: Brainstorm canvases.
  - name: Dashboards
    description: Dashboards.
  - name: Presentations
    description: Slide presentations.
  - name: Patterns
    description: User-defined ontology patterns and matched instances.
  - name: Written Documents
    description: Authored documents.
  - name: Prompts
    description: Reusable prompt templates.
  - name: Apps
    description: Workspace automations.
  - name: Tools
    description: Standalone convert/split/shape/extract tools.
  - name: Realtime
    description: Voice session mint and tool execution.
  - name: Connectors
    description: Connector catalog and connect flows.
  - name: Connections
    description: Workspace connector connections.
  - name: Chat Completions
    description: OpenAI-compatible chat completions over workspace queries.
paths:
  /patterns/{id}/instances/{instanceId}:
    get:
      tags:
        - Patterns
      summary: Get Pattern Instance
      operationId: get_pattern_instance_patterns__id__instances__instanceId__get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Id
        - name: instanceId
          in: path
          required: true
          schema:
            type: string
            title: Instanceid
        - name: AiQL-Workspace
          in: header
          required: true
          schema:
            type: string
            description: ID of the workspace the request operates on.
            title: Aiql-Workspace
          description: ID of the workspace the request operates on.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatternInstanceDetail'
        '401':
          description: 'Authentication failed: missing or invalid API key.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl https://api.aiql.io/patterns/ptn_6e4c/instances/{instanceId} \
              -H "Authorization: Bearer $AIQL_API_KEY" \
              -H "AiQL-Workspace: $AIQL_WORKSPACE_ID"
        - lang: python
          label: Python SDK
          source: |-
            import os
            from aiql import AiQL

            client = AiQL(api_key=os.environ["AIQL_API_KEY"])

            instance = client.patterns.instances.get("ptn_6e4c", "ins_1a2b")
        - lang: typescript
          label: TypeScript SDK
          source: >-
            import { AiQL } from "@aiql.io/sdk";


            const client = new AiQL({ apiKey: process.env.AIQL_API_KEY });


            const instance = await client.patterns.instances.get("ptn_6e4c",
            "ins_1a2b");
components:
  schemas:
    PatternInstanceDetail:
      properties:
        instance:
          $ref: '#/components/schemas/PatternInstance'
        members:
          items:
            $ref: '#/components/schemas/PatternMember'
          type: array
          title: Members
        links:
          items:
            $ref: '#/components/schemas/PatternLink'
          type: array
          title: Links
      type: object
      required:
        - instance
        - members
        - links
      title: PatternInstanceDetail
    ErrorResponse:
      type: object
      title: ErrorResponse
      properties:
        detail:
          type: string
          title: Detail
      required:
        - detail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PatternInstance:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence
        completeness:
          anyOf:
            - type: number
            - type: 'null'
          title: Completeness
        status:
          type: string
          title: Status
        member_count:
          type: integer
          title: Member Count
        source_document_ids:
          items:
            type: string
          type: array
          title: Source Document Ids
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - name
        - summary
        - confidence
        - completeness
        - status
        - member_count
        - created_at
        - updated_at
      title: PatternInstance
    PatternMember:
      properties:
        id:
          type: string
          title: Id
        slot_key:
          type: string
          title: Slot Key
        class_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Class Name
        entity_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Label
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        properties:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Properties
        confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence
        source_document_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Document Id
        source_database:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Database
        source_entity_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Entity Id
        shape:
          anyOf:
            - type: string
            - type: 'null'
          title: Shape
        render_as:
          anyOf:
            - type: string
            - type: 'null'
          title: Render As
      type: object
      required:
        - id
        - slot_key
        - entity_label
        - name
        - confidence
        - source_document_id
        - source_database
        - source_entity_id
      title: PatternMember
    PatternLink:
      properties:
        source_id:
          type: string
          title: Source Id
        target_id:
          type: string
          title: Target Id
        slot_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Slot Key
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence
        source_document_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Document Id
        source_relationship_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Relationship Id
      type: object
      required:
        - source_id
        - target_id
      title: PatternLink
    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:
    HTTPBearer:
      type: http
      description: API key or UI session JWT passed as a Bearer token.
      scheme: bearer

````

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