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

# Apply a user snapshot

> Creates a new user in the caller organization and clones the snapshot automations, prompts, and templates (with pipeline-stage and agent mappings) inside a single transaction. Same-org applies skip automations and templates to avoid duplicates.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/user-snapshots/{id}/apply
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:
    post:
      tags:
        - User Snapshots
      summary: Apply a user snapshot
      description: >-
        Creates a new user in the caller organization and clones the snapshot
        automations, prompts, and templates (with pipeline-stage and agent
        mappings) inside a single transaction. Same-org applies skip automations
        and templates to avoid duplicates.
      operationId: post_user_snapshot_apply
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplyUserSnapshotRequest'
      responses:
        '201':
          description: Snapshot applied – new user created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplyUserSnapshotResponse'
        '400':
          description: Validation error
          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'
        '409':
          description: Conflict – new user email already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSnapshotErrorResponse'
        '422':
          description: Mongoose validation failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSnapshotErrorResponse'
        '500':
          description: Failed to apply snapshot – all changes rolled back
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSnapshotErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ApplyUserSnapshotRequest:
      type: object
      properties:
        pipelineMapping:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: string
          description: >-
            Per-automation map of source pipeline stage value → target stage
            value.
        sourceStatusesMapping:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: >-
            Per-automation override for sourceStatuses array (mapped target
            stages).
        agentMapping:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: string
          description: Per-automation map of source agent name/id → target agent _id.
        selectedPromptNames:
          type: array
          items:
            type: string
          description: 'Same-org apply only: subset of snapshot prompt names to clone.'
        applyAutomations:
          type: boolean
          default: true
        applyPrompts:
          type: boolean
          default: true
        applyTemplates:
          type: boolean
          default: true
        newUser:
          $ref: '#/components/schemas/ApplyUserSnapshotNewUser'
      required:
        - newUser
      additionalProperties: false
      example:
        pipelineMapping:
          Move to Contacted on first reply:
            Contacted: Reached Out
        agentMapping: {}
        applyAutomations: true
        applyPrompts: true
        applyTemplates: true
        newUser:
          email: casey@acme.example
          password: TempPass!2026
          fullName: Casey New
          accessRole: SALES_REP
    ApplyUserSnapshotResponse:
      type: object
      properties:
        message:
          type: string
        result:
          type: object
          properties:
            userId:
              type: string
            userEmail:
              type: string
            cloned:
              type: object
              properties:
                automations:
                  type: integer
                prompts:
                  type: integer
                templates:
                  type: integer
              additionalProperties: true
            mapped:
              type: object
              properties:
                prompts:
                  type: integer
              additionalProperties: true
            skipped:
              type: object
              properties:
                automations:
                  type: integer
                templates:
                  type: integer
              additionalProperties: true
          additionalProperties: true
      additionalProperties: true
      example:
        message: Snapshot applied
        result:
          userId: 64ee9a8b1e7f2a001122339c
          userEmail: casey@acme.example
          cloned:
            automations: 5
            prompts: 8
            templates: 12
          mapped:
            prompts: 0
          skipped:
            automations: 0
            templates: 0
    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
    ApplyUserSnapshotNewUser:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
          minLength: 8
        fullName:
          type: string
        phoneNumber:
          type: string
          pattern: ^(\+1|\+91)\d{10}$
          description: >-
            Optional E.164-style phone (must start with +1 or +91 followed by 10
            digits).
        designation:
          type: string
        accessRole:
          type: string
          enum:
            - ADMIN
            - DEPARTMENT_HEAD
            - SALES_REP
      required:
        - email
        - password
        - fullName
        - accessRole
      additionalProperties: false
      example:
        email: casey@acme.example
        password: TempPass!2026
        fullName: Casey New
        phoneNumber: '+14155550177'
        designation: Account Executive
        accessRole: SALES_REP
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````