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

# Schedule follow-up

> Schedule a follow-up on an existing contact. Use force to overwrite.

Contact must already exist. Register-only path: `POST /leads` with `channel: "none"`, then this endpoint.

Same template resolution as create-lead: request `emailTemplateId` / `whatsappTemplateId` → campaign Follow-up → Omni default verified profile + attached template.

Get ids from [List Omni templates](/api-reference/endpoint/core/list-omni-templates). Optional: `templateVariables`, `whatsappParams`, `emailScheduledAt`, `whatsappScheduledAt` (default `scheduledAt`).

| Situation                             | Response                                            |
| ------------------------------------- | --------------------------------------------------- |
| No pending follow-up                  | `201` scheduled                                     |
| Pending exists                        | `409 followup_already_pending` — pass `force: true` |
| Call in progress + immediate schedule | `422 contact_busy` — use a future `scheduledAt`     |


## OpenAPI

````yaml POST /api/v1/contacts/{id}/followups
openapi: 3.0.3
info:
  title: Ondial Public API
  version: 1.0.0
  description: >-
    Tenant API-key surface for lead ingest, contacts (including dial
    conversation + analysis), events, inbound agents, company profiles, and
    knowledge-base documents.


    **Campaign definition is UI-only** — create and start an API-ingest campaign
    in the dashboard, then push leads here.


    **Auth:** `Authorization: Bearer ond_live_…` or `ond_test_…` (or
    `X-API-Key`). Keys are requested in **API Access** with a friendly **key
    name**, then approved by Super Admin (not self-serve). Tenants can rename
    keys later without rotating the secret.


    **Scopes:** Company and knowledge-base routes require opt-in scopes
    (`companies:read`, `companies:write`, `knowledge:read`, `knowledge:write`)
    granted at key approval. Missing scope → `403 forbidden`.


    **Sandbox** keys never place PSTN dials or live WhatsApp/email and do not
    burn credits (KB upload skips debit).


    **Security:** Company responses never include SMTP/WhatsApp credentials. KB
    v1 is metadata-only — no file download.


    **Kill switch:** Super Admin can disable all `/api/v1/*` (`503` /
    `api_globally_disabled`) without stopping UI CSV campaigns.


    **Compliance:** Call channel requires `consent.outboundCall: true` and phone
    not on tenant/platform DNC.
servers:
  - url: https://dashboard.ondial.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security:
  - BearerAuth: []
tags:
  - name: Core
    description: Auth check and lead ingest
  - name: Contacts
    description: Status, dials/conversation/analysis, cancel, delete, follow-ups, list
  - name: Events
    description: ERP event bus slice — eventType → campaign
  - name: Outbound
    description: >-
      Read-only campaign lookup for API / Custom CRM. Create and start campaigns
      in the dashboard.
  - name: Inbound agents
    description: Configure inbound agents; list/buy pool numbers; read credits
  - name: Companies
    description: >-
      Company profile CRUD (requires companies:read / companies:write scopes).
      Never returns SMTP or WhatsApp credentials.
  - name: Knowledge bases
    description: >-
      Knowledge document upload/list/delete (requires knowledge:read /
      knowledge:write scopes). Metadata only — no file download via API.
paths:
  /api/v1/contacts/{id}/followups:
    post:
      tags:
        - Contacts
      summary: Schedule follow-up
      description: >-
        Contact must already exist (use `POST /leads` with `channel: none` first
        if needed). `force: true` overwrites a pending follow-up.
      operationId: scheduleFollowup
      parameters:
        - $ref: '#/components/parameters/ContactId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FollowupRequest'
            example:
              channel: call
              scheduledAt: '2026-08-12T10:00:00Z'
              force: false
              consent:
                outboundCall: true
                source: crm
      responses:
        '201':
          description: Scheduled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FollowupResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: 'followup_already_pending — use force: true'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
        '422':
          description: contact_busy or validation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
components:
  parameters:
    ContactId:
      name: id
      in: path
      required: true
      schema:
        type: string
  schemas:
    FollowupRequest:
      type: object
      properties:
        channel:
          type: string
        channels:
          type: array
          items:
            type: string
        scheduledAt:
          type: string
          format: date-time
        emailScheduledAt:
          type: string
          format: date-time
        whatsappScheduledAt:
          type: string
          format: date-time
        emailTemplateId:
          type: string
        emailProfileId:
          type: string
        whatsappTemplateId:
          type: string
        whatsappProfileId:
          type: string
        force:
          type: boolean
        consent:
          $ref: '#/components/schemas/Consent'
        campaignId:
          type: string
        phone:
          type: string
    FollowupResponse:
      type: object
      properties:
        contactId:
          type: string
        channels:
          type: array
          items:
            type: string
        scheduledAt:
          type: string
          format: date-time
        status:
          type: string
        forced:
          type: boolean
        emailScheduledAt:
          type: string
          format: date-time
          nullable: true
        whatsappScheduledAt:
          type: string
          format: date-time
          nullable: true
        emailTemplateId:
          type: string
          nullable: true
        emailProfileId:
          type: string
          nullable: true
        whatsappTemplateId:
          type: string
          nullable: true
        whatsappProfileId:
          type: string
          nullable: true
    ErrorBody:
      type: object
      properties:
        error:
          type: string
        reasonCode:
          type: string
        missing:
          type: array
          items:
            type: string
    Consent:
      type: object
      required:
        - outboundCall
      properties:
        outboundCall:
          type: boolean
          default: true
          description: Must be true to place a dial. Not used for email or WhatsApp.
        source:
          type: string
          example: crm
  responses:
    Unauthorized:
      description: Missing, invalid, or inactive API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            error: Invalid or inactive API key
            reasonCode: unauthorized
    NotFound:
      description: Not found or not owned
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            error: Not found
            reasonCode: not_found
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ond_live | ond_test
      description: >-
        Paste only your API key (`ond_live_…` or `ond_test_…`). Do not type the
        word Bearer — the playground adds it.

````