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

> ## Agent Instructions
> Use the public API base URL: https://api.teamfollowup.ai/api.
> Authenticate public API requests with Authorization: Bearer YOUR_API_KEY.
> Use product-owned terms: agents, campaigns, projects (GoHighLevel sub-accounts), contacts, calls, outcomes, skills, cadences, phone numbers.
> Scope requests by locationId rather than projectName.
> Read the guide linked from each API reference group before recommending an endpoint.

# Get campaign

> Read the campaign bound to this agent, grouped into trigger, capabilities, tools, calling and outcomes. Outbound/inbound booking calendars belong to capabilities.appointment_booking; confirmation calendars belong to trigger. Only installed abilities are listed, with their inventory version and freshness. A shared agent may belong to several campaigns: provide locationId and campaignId together to choose one. Calendar administration lives in your connected CRM. Required scope: campaigns:read.

Required API key scope: `campaigns:read`.



## OpenAPI

````yaml /openapi.yaml get /api/agent-builder/agents/{id}/campaign
openapi: 3.1.0
info:
  title: TFUAI Server API
  version: 1.0.0
  description: >-
    API reference for the TFUAI SaaS server.


    All published endpoints are mounted under `/api`. Responses use a standard
    envelope: `{ "success": true, ... }` on success and `{ "success": false,
    "error": "..." }` on failure.


    Product API modules are being launched module by module. This spec currently
    exposes only contracted public modules.


    Authenticate public API requests with an API key in the `Authorization`
    header: `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://api.teamfollowup.ai
    description: Production API origin. Public API paths are under /api.
security: []
tags:
  - name: Agents
    description: >-
      Build the conversation: identity and settings, script, lead context and
      split testing.
  - name: Analytics
    description: >-
      Understand call volume, pickup, booking and transfer metrics within the
      selected reporting scope.
  - name: Billing
    description: >-
      Balances, spend, purchases and sub-account rebilling. Reference and guides
      only; the builder chatbot has no billing playbook.
  - name: Calls
    description: >-
      Review completed calls, recordings, transcripts and campaign run history;
      distinguish observation from placing a new call.
  - name: Campaigns
    description: >-
      Configure what starts calls, who is eligible, calling windows, caller IDs,
      activation and the actions that follow each outcome.


      What runs after a call lands: for each outcome (booked, opted out, asked
      for a callback…), an ordered chain of actions — tag the contact, move a
      pipeline stage, send an SMS, book an appointment. Stored as a graph:
      `nodes` are the actions, `edges` say what follows what, and
      `dispositionEntries` maps each outcome to the node its chain starts at.


      **Pick the narrowest endpoint that does the job.**


      | To | Call | |

      | --- | --- | --- |

      | See what fires per outcome | `GET .../workflow?view=summary` | Reads as
      plain text, no graph walking |

      | Add steps to an outcome | `POST .../outcomes/{outcome}/nodes` | Server
      derives node ids, edge ids, handles, layout |

      | Change a message, tag or setting | `PATCH .../workflow` | Merges;
      carries no graph, so it cannot damage one |

      | Remove one step | `DELETE .../nodes/{nodeId}` | Also re-links the chain
      around it |

      | Author or replace the whole graph | `PUT .../workflow` | Replaces
      everything you send |


      `PUT` is the only one that can re-wire, position nodes, build an `if`,
      save an unconfigured draft, or copy a whole workflow — and the only one
      that can overwrite a change someone else made after you read it. Use it
      when you are genuinely authoring the graph, and send `expectedVersion`
      when you do. For everything else the narrower endpoints are both easier
      and safer.
  - name: Contacts
    description: >-
      Find contacts and their calls, manage do-not-call status and identify
      internal contacts excluded from reporting.
  - name: In-call Capabilities
    description: >-
      Configure actions and instructions the agent uses during a live call:
      booking, transfers, lookups and custom skills.
  - name: Master agent
    description: >-
      Run a shared agent and campaign across linked projects; manage
      inheritance, local bindings, synchronization and rollout readiness.
  - name: Native Calendar
    description: >-
      The diary of a sub-account with no CRM: its bookable calendars, the free
      slots they offer, and the appointments on them. Availability is computed
      per request against live bookings and is never cached, because a cached
      slot is one somebody else has already taken.
  - name: Native Contacts
    description: >-
      The people a sub-account with no CRM calls, and the fields it keeps on
      them. This is the system of record for those contacts: there is nowhere
      else they exist. A sub-account with a CRM keeps its contacts there and
      every operation here answers 400 for it.
  - name: Phone Numbers
    description: >-
      Find and manage caller IDs, assign numbers to campaigns and understand
      connected Twilio numbers.
  - name: Projects
    description: >-
      Understand project ownership, inspect configuration and validate the local
      resources used by a campaign.
  - name: TFU Live
    description: >-
      Build one TFU Live agent with its Brain, Voice and equipped actions;
      connect it through shared Campaigns.
  - name: Voices
    description: >-
      Browse the voice catalogue and select a voice; configure speech and
      listening behavior in Agents.
paths:
  /api/agent-builder/agents/{id}/campaign:
    get:
      tags:
        - Campaigns
      summary: Get campaign
      description: >-
        Read the campaign bound to this agent, grouped into trigger,
        capabilities, tools, calling and outcomes. Outbound/inbound booking
        calendars belong to capabilities.appointment_booking; confirmation
        calendars belong to trigger. Only installed abilities are listed, with
        their inventory version and freshness. A shared agent may belong to
        several campaigns: provide locationId and campaignId together to choose
        one. Calendar administration lives in your connected CRM. Required
        scope: campaigns:read.


        Required API key scope: `campaigns:read`.
      operationId: get-agent-campaign
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The agent ID bound to the campaign.
        - name: locationId
          in: query
          required: false
          description: Project location ID; provide with campaignId for a shared agent.
          schema:
            type: string
        - name: campaignId
          in: query
          required: false
          description: Campaign ID; provide with locationId for a shared agent.
          schema:
            type: string
      responses:
        '200':
          description: Campaign configuration.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignsCampaignResponse'
              example:
                success: true
                campaign:
                  id: cmp_9f7a123
                  name: Roofing Follow Up
                  description: null
                  agentId: agent_8a488fcfa8fdbf8ce8ad5ccc45
                  active: false
                  locationId: loc_9f7a123
                  projectId: 64f2a8c8a2b3c4d5e6f7a8b9
                  campaignType: outbound
                  trigger:
                    type: outbound
                    activeTags:
                      - hot lead
                    inactiveTags:
                      - booked
                  capabilities: {}
                  tools: {}
                  calling:
                    s2lDoubleDial: false
                  testing:
                    collectContextFields: false
                  fromNumbers:
                    - '+14155550100'
                  masterCampaignEnabled: false
                  metadata: {}
                  createdAt: '2026-09-01T09:00:00.000Z'
                  updatedAt: '2026-09-17T09:00:00.000Z'
                  outcomes: {}
          headers:
            X-Product-Release:
              description: >-
                Fingerprint of the docs and tool contracts loaded by this
                server. Compare with data-product-release on the API reference
                overview page.
              schema:
                type: string
        '400':
          description: Ambiguous or invalid selector.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignsErrorResponse'
              example:
                success: false
                error: VALIDATION
                code: VALIDATION
                message: A shared agent needs locationId and campaignId together.
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignsErrorResponse'
              example:
                success: false
                error: UNAUTHORIZED
                code: UNAUTHORIZED
                message: Unauthorized
        '403':
          description: Campaign scope or access missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignsErrorResponse'
              example:
                success: false
                error: FORBIDDEN
                code: FORBIDDEN
                message: campaigns:read scope is required.
        '404':
          description: Campaign not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignsErrorResponse'
              example:
                success: false
                error: NOT_FOUND
                code: NOT_FOUND
                message: Campaign not found.
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          description: Campaign settings could not be read.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignsErrorResponse'
              example:
                success: false
                error: INTERNAL_ERROR
                code: INTERNAL_ERROR
                message: Campaign settings could not be read.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.teamfollowup.ai/api/agent-builder/agents/{id}/campaign \
              --header 'Authorization: Bearer YOUR_API_KEY'
components:
  schemas:
    CampaignsCampaignResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - campaign
      properties:
        success:
          type: boolean
        campaign:
          $ref: '#/components/schemas/CampaignsCampaign'
    CampaignsErrorResponse:
      type: object
      additionalProperties: false
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
        error:
          type: string
          example: VALIDATION
        code:
          type: string
          example: VALIDATION
        message:
          type: string
          example: '`name` is required when creating a campaign.'
    CampaignsCampaign:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        agentId:
          type:
            - string
            - 'null'
        active:
          type: boolean
        locationId:
          type: string
        projectId:
          type: string
        campaignType:
          description: >-
            Optional assertion about the selected campaign; its type cannot be
            changed.
          type: string
          enum:
            - outbound
            - confirmation
            - inbound
        trigger:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: outbound
                activeTags:
                  type: array
                  items:
                    type: string
                inactiveTags:
                  type: array
                  items:
                    type: string
              required:
                - type
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  const: confirmation
                calendarId:
                  description: >-
                    Calendar whose booked appointments enter this confirmation
                    campaign. Rescheduling uses this same calendar.
                  type: string
              required:
                - type
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  const: inbound
              required:
                - type
              additionalProperties: false
          description: >-
            Must match the selected campaign type. Outbound accepts
            activeTags/inactiveTags. Confirmation/reminder accepts calendarId,
            which also supplies rescheduling. Inbound accepts neither tags nor
            an appointment calendar. Include type when changing a trigger; it
            cannot change the campaign type.
        capabilities:
          type: object
          additionalProperties: false
          description: >-
            Installed abilities only, including disabled entries. An empty
            object means none are installed. Never infer an entry from a
            template name.
          properties:
            appointment_booking:
              type: object
              properties:
                enabled:
                  type: boolean
                name:
                  type: string
                  minLength: 1
                whenToUse:
                  type: string
                calendarId:
                  type: string
                calendarRules:
                  type: array
                  items:
                    type: object
                    properties:
                      condition:
                        type: object
                        properties:
                          field:
                            type: string
                            minLength: 1
                            description: >-
                              The value to test. Resolved at DIAL time, so it
                              must be known before the call: a contact field, a
                              location custom value, or a pre-call variable. A
                              post-call/AI-captured field is rejected — it is
                              always empty at dial time, so the rule would never
                              match and every booking would quietly go to the
                              default calendar.
                          op:
                            type: string
                            enum:
                              - is_true
                              - is_false
                              - is_set
                              - is_empty
                              - equals
                              - not_equals
                              - contains
                              - starts_with
                              - in
                              - gt
                              - gte
                              - lt
                              - lte
                            description: Same operator set as workflow conditions.
                          value:
                            description: >-
                              Comparison value; unused by
                              is_true/is_false/is_set/is_empty.
                        required:
                          - field
                          - op
                        additionalProperties: false
                      calendarId:
                        type: string
                        minLength: 1
                        description: The calendar this rule routes to when it matches.
                    required:
                      - condition
                      - calendarId
                    additionalProperties: false
                collectAddress:
                  type: boolean
              additionalProperties: false
            live_transfer:
              type: object
              properties:
                enabled:
                  type: boolean
                name:
                  type: string
                  minLength: 1
                whenToUse:
                  type: string
                transferNumber:
                  type: string
                transferMessage:
                  type: string
                transferToAssignedUser:
                  type: boolean
                advancedRouting:
                  type: boolean
                transferRoutes:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        minLength: 1
                      number:
                        type: string
                        minLength: 1
                      condition:
                        type: string
                        minLength: 1
                    required:
                      - id
                      - number
                      - condition
                    additionalProperties: {}
              additionalProperties: false
            add_tag:
              type: object
              properties:
                enabled:
                  type: boolean
                name:
                  type: string
                  minLength: 1
                whenToUse:
                  type: string
                tags:
                  type: array
                  items:
                    type: string
                    minLength: 1
              additionalProperties: false
        tools:
          type: object
          additionalProperties: false
          description: >-
            Installed abilities only, including disabled entries. An empty
            object means none are installed. Never infer an entry from a
            template name.
          properties:
            smart_service_area:
              type: object
              properties:
                enabled:
                  type: boolean
                name:
                  type: string
                  minLength: 1
                whenToUse:
                  type: string
                zips:
                  type: string
                outOfAreaResponse:
                  type: string
              additionalProperties: false
            check_tag:
              type: object
              properties:
                enabled:
                  type: boolean
                name:
                  type: string
                  minLength: 1
                whenToUse:
                  type: string
                tags:
                  maxItems: 1
                  type: array
                  items:
                    type: string
                    minLength: 1
                checkingMessage:
                  type: string
              additionalProperties: false
        calling:
          type: object
          properties:
            s2lDoubleDial:
              type: boolean
            s2lDelaySeconds:
              type: integer
              minimum: 0
              maximum: 3600
            s2lDelayMinutes:
              type: integer
              minimum: 0
              maximum: 60
            s2lDelayHaltOnReply:
              type: boolean
            callbackDoubleDial:
              type: boolean
            callNowSkipTags:
              type: array
              items:
                type: string
            callConcurrency:
              anyOf:
                - type: object
                  properties:
                    enabled:
                      type: boolean
                    maxConcurrent:
                      type: integer
                      minimum: 1
                      maximum: 3
                    postTransferDelayMinutes:
                      type: integer
                      minimum: 0
                      maximum: 120
                  additionalProperties: false
                  minProperties: 1
                - type: 'null'
            cadence:
              anyOf:
                - $ref: '#/components/schemas/CampaignCadence'
                - type: 'null'
              description: >-
                The campaign’s single linked schedule, or null when none is
                configured.
            speedToLead:
              description: >-
                Call when the lead enters or an appointment is booked.
                Independent of scheduled follow-up.
              type: boolean
            powerDialer:
              description: Run the scheduled cadence. Independent of the immediate call.
              type: boolean
            skipWhenAiBooked:
              description: >-
                Confirmation campaigns only: skip the immediate call for
                AI-booked appointments; keep scheduled reminders and other skip
                tags.
              type: boolean
            window:
              anyOf:
                - anyOf:
                    - type: object
                      properties:
                        days:
                          minItems: 1
                          type: array
                          items:
                            type: integer
                            minimum: 1
                            maximum: 7
                          description: ISO weekdays the block covers. 1=Mon .. 7=Sun.
                        start:
                          type: string
                          pattern: ^\d{1,2}:\d{2}$
                          description: HH:MM, 24h.
                        end:
                          type: string
                          pattern: ^\d{1,2}:\d{2}$
                          description: HH:MM, 24h.
                        tz:
                          description: >-
                            Ignored on write — the project timezone is used.
                            Returned on reads.
                          type: string
                      required:
                        - days
                        - start
                        - end
                      additionalProperties: {}
                    - minItems: 1
                      type: array
                      items:
                        type: object
                        properties:
                          days:
                            minItems: 1
                            type: array
                            items:
                              type: integer
                              minimum: 1
                              maximum: 7
                            description: ISO weekdays the block covers. 1=Mon .. 7=Sun.
                          start:
                            type: string
                            pattern: ^\d{1,2}:\d{2}$
                            description: HH:MM, 24h.
                          end:
                            type: string
                            pattern: ^\d{1,2}:\d{2}$
                            description: HH:MM, 24h.
                          tz:
                            description: >-
                              Ignored on write — the project timezone is used.
                              Returned on reads.
                            type: string
                        required:
                          - days
                          - start
                          - end
                        additionalProperties: {}
                    - type: object
                      properties:
                        tz:
                          description: Ignored on write — the project timezone is used.
                          type: string
                        windows:
                          minItems: 1
                          type: array
                          items:
                            type: object
                            properties:
                              days:
                                minItems: 1
                                type: array
                                items:
                                  type: integer
                                  minimum: 1
                                  maximum: 7
                                description: ISO weekdays the block covers. 1=Mon .. 7=Sun.
                              start:
                                type: string
                                pattern: ^\d{1,2}:\d{2}$
                                description: HH:MM, 24h.
                              end:
                                type: string
                                pattern: ^\d{1,2}:\d{2}$
                                description: HH:MM, 24h.
                            required:
                              - days
                              - start
                              - end
                            additionalProperties: {}
                          description: >-
                            Every block, in one payload. Replaces the campaign's
                            whole set, never adds to it.
                      required:
                        - windows
                      additionalProperties: {}
                - type: 'null'
            callIfDnd:
              type: boolean
            multipleTimezoneCheck:
              type: boolean
            useWindowTimezone:
              type: boolean
            dropOutsideWindow:
              type: boolean
          additionalProperties: false
          minProperties: 1
          description: >-
            Calling controls for outbound and confirmation campaigns.
            speedToLead controls immediate calls; powerDialer controls scheduled
            calls. Confirmation campaigns support both. Absent for inbound.
        testing:
          type: object
          properties:
            collectContextFields:
              type: boolean
          additionalProperties: false
          minProperties: 1
        fromNumbers:
          type: array
          items:
            type: string
        masterCampaignEnabled:
          type: boolean
        metadata:
          type: object
          readOnly: true
          additionalProperties: false
          description: >-
            Read-only synchronization information, separate from campaign
            settings. Never send metadata in an update.
          properties:
            inventoryVersion:
              type: integer
              minimum: 0
              readOnly: true
              description: >-
                Revision of the capability/tool inventory only, not of the
                entire campaign. Optional: send this as expectedVersion when
                editing that inventory to reject a stale edit with 409. Omit
                expectedVersion for an ordinary partial update.
            inventoryFreshness:
              type: string
              enum:
                - live
                - cached
              readOnly: true
              description: >-
                live: the capability/tool inventory was checked against the
                current voice configuration. cached: that check failed and the
                last stored configuration was used. This does not describe the
                freshness of other campaign settings.
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        outcomes:
          $ref: '#/components/schemas/CampaignOutcomeValues'
    ApiError:
      type: object
      description: Standard error envelope returned by the API.
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Short machine-readable error code.
          example: Unauthorized
        message:
          type: string
          description: Human-readable explanation of the error.
          example: Authentication required.
      required:
        - success
        - error
    CampaignCadence:
      type: object
      additionalProperties: false
      required:
        - name
        - steps
        - activeDays
        - editable
      properties:
        name:
          type: string
        steps:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
                enum:
                  - call
                  - sms
                  - email
                  - add-tag
                  - move-stage
                  - api-event
              label:
                type: string
                maxLength: 40
              day:
                type: integer
                minimum: 1
                maximum: 30
              hour:
                type: integer
                minimum: 1
                maximum: 12
              minute:
                type: integer
                minimum: 0
                maximum: 59
              period:
                type: string
                enum:
                  - AM
                  - PM
              offsetMinutes:
                description: >-
                  Relative wait in minutes after entry for the first step, or
                  after the previous step finishes. Use on every step instead of
                  day/hour/minute/period. When editing queued timing, this wait
                  starts at save time and the step number is preserved.
                type: integer
                minimum: 1
                maximum: 43200
              minutesBeforeAppt:
                type: integer
                minimum: 1
                maximum: 9007199254740991
              doubleDial:
                type: boolean
              body:
                type: string
              snippetId:
                type: string
                minLength: 1
              subject:
                type: string
              tags:
                type: array
                items:
                  type: string
                  minLength: 1
              pipelineId:
                type: string
                minLength: 1
              stageId:
                type: string
                minLength: 1
              pipelineName:
                type: string
              stageName:
                type: string
            required:
              - kind
            additionalProperties: false
        activeDays:
          type: array
          items:
            type: integer
            minimum: 0
            maximum: 6
        editable:
          type: boolean
        editingIssue:
          type: string
          description: >-
            Why this legacy schedule cannot be safely edited through the
            campaign contract.
    CampaignOutcomeValues:
      type: object
      additionalProperties: false
      properties:
        opt_out:
          type: object
          additionalProperties: false
          required:
            - prompt
            - default
            - label
          properties:
            prompt:
              type: string
            default:
              type: string
            label:
              type: string
        callback:
          type: object
          additionalProperties: false
          required:
            - prompt
            - default
            - label
          properties:
            prompt:
              type: string
            default:
              type: string
            label:
              type: string
        human_needed:
          type: object
          additionalProperties: false
          required:
            - prompt
            - default
            - label
          properties:
            prompt:
              type: string
            default:
              type: string
            label:
              type: string
        asked_for_info:
          type: object
          additionalProperties: false
          required:
            - prompt
            - default
            - label
          properties:
            prompt:
              type: string
            default:
              type: string
            label:
              type: string
  responses:
    RateLimited:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Send your API key as `Authorization: Bearer YOUR_API_KEY`.'

````