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

# Calculate auto-segmented campaign schedule

> Returns a suggested segment schedule for a campaign given the total contact count. For limited plans the response respects the organization's daily SMS quota and skips fully booked days; for unlimited plans contacts are split into 100-per-day segments. Each segment carries a UTC ISO scheduledDate.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/campaigns/auto-segment
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/campaigns/auto-segment:
    post:
      tags:
        - Campaigns
      summary: Calculate auto-segmented campaign schedule
      description: >-
        Returns a suggested segment schedule for a campaign given the total
        contact count. For limited plans the response respects the
        organization's daily SMS quota and skips fully booked days; for
        unlimited plans contacts are split into 100-per-day segments. Each
        segment carries a UTC ISO scheduledDate.
      operationId: post_campaigns_auto_segment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutoSegmentRequest'
      responses:
        '200':
          description: Auto-segment plan returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoSegmentResponse'
        '400':
          description: totalContacts is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    AutoSegmentRequest:
      type: object
      properties:
        totalContacts:
          type: integer
          minimum: 1
        firstSegmentDate:
          type: string
          description: >-
            Optional YYYY-MM-DD date in the user/browser local timezone for the
            first segment.
        firstSegmentTime:
          type: string
          description: >-
            Optional HH:mm time in the user/browser local timezone. Defaults to
            10:00 when omitted.
      required:
        - totalContacts
      additionalProperties: true
      example:
        totalContacts: 500
        firstSegmentDate: '2026-05-20'
        firstSegmentTime: '10:00'
    AutoSegmentResponse:
      type: object
      properties:
        success:
          type: boolean
        segments:
          type: array
          items:
            $ref: '#/components/schemas/AutoSegmentSegment'
        totalSegments:
          type: integer
        warnings:
          type: array
          items:
            type: string
      required:
        - success
        - segments
        - totalSegments
        - warnings
      additionalProperties: true
      example:
        success: true
        segments:
          - id: seg-1
            scheduledDate: '2026-05-20T17:00:00.000Z'
            contactCount: 100
          - id: seg-2
            scheduledDate: '2026-05-21T17:00:00.000Z'
            contactCount: 100
        totalSegments: 5
        warnings: []
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: string
      additionalProperties: true
      example:
        success: false
        message: Validation error
        error: name is required
    AutoSegmentSegment:
      type: object
      properties:
        id:
          type: string
        scheduledDate:
          type: string
          format: date-time
          description: UTC ISO timestamp.
        contactCount:
          type: integer
      required:
        - id
        - scheduledDate
        - contactCount
      additionalProperties: false
      example:
        id: seg-1
        scheduledDate: '2026-05-20T17:00:00.000Z'
        contactCount: 100
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````