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

# Set campaign workflow

> Sets or replaces a campaign's workflow. Attempts must be in chronological order and follow-up times must fall within the campaign's working hours. Completed or archived campaigns cannot be changed.



## OpenAPI

````yaml /openapi.json put /api/campaigns/{id}/workflow
openapi: 3.0.3
info:
  title: AgentCallback Public API
  version: 1.3.0
  description: >-
    Public, customer-callable AgentCallback APIs for calls, voice agents,
    campaigns, CSV uploads, phone numbers, and voices.


    **API keys:** Sign in to your AgentCallback account and open **Dashboard >
    API Keys** to create an API key. Send the key with every request using the
    `x-api-key` header.
servers:
  - url: https://www.agentcallback.com
    description: AgentCallback API server
security: []
tags:
  - name: Authentication
    description: Credential validation and API access.
  - name: Calls
    description: Create calls and retrieve call results.
  - name: Voice Agents
    description: Create and manage voice agent scripts.
  - name: Campaigns
    description: Create and manage batch call campaigns, including multi-attempt workflows.
  - name: File Uploads
    description: Upload and list CSV contact files for campaigns.
  - name: Phone Numbers
    description: List organization phone numbers.
  - name: Voices
    description: Browse voices and fetch voice previews.
paths:
  /api/campaigns/{id}/workflow:
    put:
      tags:
        - Campaigns
      summary: Set campaign workflow
      description: >-
        Sets or replaces a campaign's workflow. Attempts must be in
        chronological order and follow-up times must fall within the campaign's
        working hours. Completed or archived campaigns cannot be changed.
      parameters:
        - name: id
          in: path
          required: true
          description: Campaign identifier
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        description: Workflow configuration.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignWorkflowRequest'
            example:
              workflow_config:
                retryOutcomes:
                  - CALLEE_DID_NOT_PICKUP
                  - VOICE_MAIL
                attempts:
                  - day: 0
                    startTime: '00:00'
                    doubleDial: false
                  - day: 1
                    startTime: '16:00'
                    doubleDial: true
                  - day: 3
                    startTime: '10:00'
                    doubleDial: false
                timezone: America/Los_Angeles
      responses:
        '200':
          description: Campaign workflow updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignWorkflowUpdateResponse'
        '400':
          description: Invalid workflow or campaign cannot be changed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Authenticated caller does not have access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Campaign not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    CampaignWorkflowRequest:
      type: object
      additionalProperties: false
      properties:
        workflow_config:
          $ref: '#/components/schemas/CampaignWorkflow'
      required:
        - workflow_config
    CampaignWorkflowUpdateResponse:
      allOf:
        - $ref: '#/components/schemas/Success'
        - type: object
          properties:
            message:
              type: string
            workflow_config:
              allOf:
                - $ref: '#/components/schemas/CampaignWorkflow'
              nullable: true
          required:
            - message
            - workflow_config
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        details:
          nullable: true
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items: {}
        code:
          type: string
      required:
        - success
        - error
    CampaignWorkflow:
      type: object
      additionalProperties: false
      description: >-
        A chronological, multi-attempt calling sequence for each campaign
        contact.
      properties:
        retryOutcomes:
          type: array
          description: >-
            Call outcomes that advance a contact to the next attempt. Defaults
            to CALLEE_DID_NOT_PICKUP and VOICE_MAIL when omitted.
          items:
            type: string
          example:
            - CALLEE_DID_NOT_PICKUP
            - VOICE_MAIL
        attempts:
          type: array
          minItems: 1
          description: >-
            Attempts in chronological order. The entry { day: 0, startTime:
            "00:00", doubleDial: false } defines only the first attempt and
            dials once. Add a second item to schedule a second attempt. The
            initial entry's doubleDial value controls whether that first attempt
            is dialed twice.
          items:
            $ref: '#/components/schemas/CampaignWorkflowAttempt'
        timezone:
          type: string
          example: America/Los_Angeles
          description: >-
            Optional IANA timezone for workflow attempt times. Inherits the
            campaign timezone when omitted.
      required:
        - attempts
      example:
        retryOutcomes:
          - CALLEE_DID_NOT_PICKUP
          - VOICE_MAIL
        attempts:
          - day: 0
            startTime: '00:00'
            doubleDial: false
          - day: 1
            startTime: '16:00'
            doubleDial: true
          - day: 3
            startTime: '10:00'
            doubleDial: false
        timezone: America/Los_Angeles
    Success:
      type: object
      properties:
        success:
          type: boolean
          example: true
      required:
        - success
    CampaignWorkflowAttempt:
      type: object
      additionalProperties: false
      description: One call attempt in a campaign workflow.
      properties:
        day:
          type: integer
          minimum: 0
          description: >-
            Day offset from when the contact enters the campaign. Use 0 for the
            initial attempt.
        startTime:
          type: string
          pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
          example: '16:00'
          description: >-
            Attempt time in 24-hour HH:mm format. The synthetic initial attempt
            uses 00:00 and follows the campaign start time.
        doubleDial:
          type: boolean
          default: false
          description: Whether to call twice back-to-back for this attempt.
      required:
        - day
        - startTime
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Create and manage API keys in your AgentCallback account under Dashboard
        > API Keys.

````