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

# Get apply references (pipeline stages and agents)

> Returns the source pipeline-stage and agent references captured in the snapshot, plus the caller-organization pipelines and agents available as mapping targets when applying the snapshot.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/user-snapshots/{id}/apply-refs
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/user-snapshots/{id}/apply-refs:
    get:
      tags:
        - User Snapshots
      summary: Get apply references (pipeline stages and agents)
      description: >-
        Returns the source pipeline-stage and agent references captured in the
        snapshot, plus the caller-organization pipelines and agents available as
        mapping targets when applying the snapshot.
      operationId: get_user_snapshot_apply_refs
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Apply refs returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSnapshotApplyRefsResponse'
        '400':
          description: Missing organization context or invalid id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSnapshotErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSnapshotErrorResponse'
        '404':
          description: Snapshot not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSnapshotErrorResponse'
        '500':
          description: Failed to retrieve apply refs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSnapshotErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UserSnapshotApplyRefsResponse:
      type: object
      properties:
        stageRefs:
          type: array
          items:
            $ref: '#/components/schemas/UserSnapshotPipelineStageRef'
        agentRefs:
          type: array
          items:
            $ref: '#/components/schemas/UserSnapshotPipelineStageRef'
        targetPipelines:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              name:
                type: string
              stages:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    color:
                      type: string
                      nullable: true
                  additionalProperties: true
            additionalProperties: true
        targetAgents:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              name:
                type: string
              description:
                type: string
                nullable: true
            additionalProperties: true
      additionalProperties: true
      example:
        stageRefs:
          - automationName: Move to Contacted on first reply
            field: targetStage
            value: Contacted
            refType: pipelineStage
            fieldLocation: actions
        agentRefs: []
        targetPipelines:
          - _id: 64eea1110000000000000010
            name: Sales Funnel
            stages:
              - name: New Lead
                color: '#3B82F6'
              - name: Reached Out
                color: '#F59E0B'
              - name: Closed Won
                color: '#10B981'
        targetAgents:
          - _id: 64eea1110000000000000060
            name: Default Agent
            description: Standard AI agent.
    UserSnapshotErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        details: {}
      additionalProperties: true
      example:
        error: Snapshot not found
        message: No snapshot exists with the given id
    UserSnapshotPipelineStageRef:
      type: object
      properties:
        automationName:
          type: string
        field:
          type: string
        value:
          type: string
        refType:
          type: string
          enum:
            - pipelineStage
            - agent
        triggerLogicType:
          type: string
          nullable: true
        fieldLocation:
          type: string
          enum:
            - actions
            - conditions
      required:
        - automationName
        - field
        - value
        - refType
      additionalProperties: true
      example:
        automationName: Move to Contacted on first reply
        field: targetStage
        value: Contacted
        refType: pipelineStage
        fieldLocation: actions
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````