> ## 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 an organization snapshot

> Creates a new organization (with credentials, dynamic properties, and pipelines) by cloning the snapshot inside a single transaction. Optionally seeds a first admin user with cloned automations, prompts, and templates. Superadmin only.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/org-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/org-snapshots/{id}/apply:
    post:
      tags:
        - Org Snapshots
      summary: Apply an organization snapshot
      description: >-
        Creates a new organization (with credentials, dynamic properties, and
        pipelines) by cloning the snapshot inside a single transaction.
        Optionally seeds a first admin user with cloned automations, prompts,
        and templates. Superadmin only.
      operationId: post_org_snapshot_apply
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplyOrgSnapshotRequest'
      responses:
        '201':
          description: Snapshot applied – new organization created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplyOrgSnapshotResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSnapshotErrorResponse'
        '403':
          description: Forbidden – superadmin role required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSnapshotErrorResponse'
        '404':
          description: Snapshot not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSnapshotErrorResponse'
        '409':
          description: Conflict – organization name, phone, or user email already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSnapshotErrorResponse'
        '422':
          description: Mongoose validation failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSnapshotErrorResponse'
        '500':
          description: Failed to apply snapshot – all changes rolled back
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSnapshotErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ApplyOrgSnapshotRequest:
      type: object
      properties:
        orgName:
          type: string
        orgPhone:
          type: string
          description: >-
            Organization phone (must start with +1 or +91 followed by 10
            digits).
        orgAddress:
          type: string
        firstUser:
          $ref: '#/components/schemas/ApplyOrgSnapshotFirstUser'
      required:
        - orgName
        - orgPhone
        - orgAddress
      additionalProperties: false
      example:
        orgName: NewOrg Holdings
        orgPhone: '+14155550100'
        orgAddress: 100 King St W, Toronto, ON
        firstUser:
          email: admin@neworg.example
          password: TempPass!2026
          fullName: Morgan Admin
          designation: Operations Lead
    ApplyOrgSnapshotResponse:
      type: object
      properties:
        message:
          type: string
        result:
          type: object
          properties:
            organizationId:
              type: string
            organizationName:
              type: string
            userId:
              type: string
              nullable: true
            userEmail:
              type: string
              nullable: true
            cloned:
              type: object
              properties:
                pipelines:
                  type: integer
                automations:
                  type: integer
                prompts:
                  type: integer
                templates:
                  type: integer
              additionalProperties: true
          additionalProperties: true
      additionalProperties: true
      example:
        message: Snapshot applied
        result:
          organizationId: 64ee9a8b1e7f2a0011223400
          organizationName: NewOrg Holdings
          userId: 64ee9a8b1e7f2a0011223499
          userEmail: admin@neworg.example
          cloned:
            pipelines: 3
            automations: 12
            prompts: 20
            templates: 30
    OrgSnapshotErrorResponse:
      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
    ApplyOrgSnapshotFirstUser:
      type: object
      properties:
        email:
          type: string
          format: email
        password:
          type: string
          minLength: 8
        fullName:
          type: string
        phoneNumber:
          type: string
          description: >-
            Optional E.164-style phone (must start with +1 or +91 followed by 10
            digits).
        designation:
          type: string
      required:
        - email
        - password
        - fullName
      additionalProperties: false
      example:
        email: admin@neworg.example
        password: TempPass!2026
        fullName: Morgan Admin
        phoneNumber: '+14155550111'
        designation: Operations Lead
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````