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

# Bulk-move all matching contacts to a target pipeline stage

> Moves every contact matching the supplied filter into the given pipeline stage. `targetStageId` and `targetStatus` are both required; the server resolves the underlying `pipelineId` from `targetStageId` and writes all three. For each contact whose status, pipelineStage, or pipelineId actually changes, the server records a stage-transition history entry, emits a `contact_updated` socket event, and writes a manual-event audit entry (`CONTACT_UPDATE`). Filter semantics are identical to `query-count`: either provide `stageIds[]` or `orgWide: true`.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/contacts/query-bulk-move
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/contacts/query-bulk-move:
    put:
      tags:
        - Contacts
      summary: Bulk-move all matching contacts to a target pipeline stage
      description: >-
        Moves every contact matching the supplied filter into the given pipeline
        stage. `targetStageId` and `targetStatus` are both required; the server
        resolves the underlying `pipelineId` from `targetStageId` and writes all
        three. For each contact whose status, pipelineStage, or pipelineId
        actually changes, the server records a stage-transition history entry,
        emits a `contact_updated` socket event, and writes a manual-event audit
        entry (`CONTACT_UPDATE`). Filter semantics are identical to
        `query-count`: either provide `stageIds[]` or `orgWide: true`.
      operationId: put_contact_query_bulk_move
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactBulkQueryMoveRequest'
      responses:
        '200':
          description: Move applied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactBulkQueryMoveResponse'
        '400':
          description: >-
            Missing `stageIds[]` (when not `orgWide`), or missing
            `targetStageId`/`targetStatus`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ContactBulkQueryMoveRequest:
      allOf:
        - $ref: '#/components/schemas/ContactBulkQueryFilter'
      type: object
      properties:
        targetStageId:
          type: string
          description: Pipeline-stage ID to move matched contacts into.
        targetStatus:
          type: string
          description: Status string to set alongside the new stage.
      required:
        - targetStageId
        - targetStatus
      additionalProperties: true
      example:
        stageIds:
          - 64b2c3d4e5f60012345678aa
        orgWide: false
        targetStageId: 64b2c3d4e5f60012345678bb
        targetStatus: Contacted
    ContactBulkQueryMoveResponse:
      type: object
      properties:
        message:
          type: string
        modifiedCount:
          type: integer
          description: Number of contacts whose status/stage actually changed.
        matchedCount:
          type: integer
          description: Total contacts matched by the filter.
      required:
        - message
        - modifiedCount
        - matchedCount
      additionalProperties: true
      example:
        message: Successfully moved 1428 contact(s)
        modifiedCount: 1428
        matchedCount: 1500
    LegacyErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        data: {}
      additionalProperties: true
      example:
        error: Attachment not found
        message: Attachment not found
    ContactBulkQueryFilter:
      type: object
      description: >-
        Shared filter shape used by `query-count`, `query-bulk-move`,
        `query-bulk-delete`, and `query-bulk-export`. Either supply `stageIds[]`
        OR set `orgWide: true`. `pipelineType` selects whether the operation
        runs against the Contact or Application collection.
      properties:
        stageIds:
          type: array
          items:
            type: string
          description: One or more pipeline-stage IDs. Required unless `orgWide` is `true`.
        pipelineType:
          type: string
          enum:
            - Contact
            - Application
          description: Which collection to target. Defaults to `Contact`.
        orgWide:
          type: boolean
          description: >-
            When `true`, ignore `stageIds` and run across the whole
            organization.
        ownerFilter:
          type: string
          description: >-
            Owner-based scope (e.g. `owned`, `unowned`) — same semantics as the
            Contacts list view.
        advancedParams:
          type: object
          additionalProperties: true
          description: >-
            Optional advanced filter object (same shape as the Contacts list
            view).
      additionalProperties: true
      example:
        stageIds:
          - 64b2c3d4e5f60012345678aa
        pipelineType: Contact
        ownerFilter: unowned
        advancedParams:
          createdAfter: '2026-01-01T00:00:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````