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

# Schedule a follow-up

> Follow-ups are sent until the contact replies, at the interval and up to the maximum of the type (or of its override for the sender). The text is written by the AI from `reason`, unless `message` is given. When a follow-up of the same type is already scheduled on the conversation, that one is returned.



## OpenAPI

````yaml /api-reference/v2.0/openapi.json post /follow-ups
openapi: 3.1.0
info:
  title: Shortext API
  description: >-
    **Versioning**: every version is a frozen contract. A released version only
    receives additive changes

    (new endpoints, new optional fields, new response fields); anything breaking
    ships in a new version.

    Responses carry `X-Shortext-Api-Version`. When a version is scheduled for
    removal, responses also carry

    `Deprecation` and `Sunset` headers; after the sunset date the version
    answers HTTP 410.

    The list of versions and their status is available at `GET /api/versions`.


    **Responses**: always HTTP 200. Check `success` and `code` (`1000` =
    success), see `ApiEnvelope`.

    On failure, `trace_id` identifies the request for support.


    **Rate limit**: 300 requests per minute per company, shared by all its keys
    and by every API version.

    Responses carry `X-RateLimit-Limit` and `X-RateLimit-Remaining`; beyond the
    limit the API answers

    HTTP 429 with `Retry-After` (seconds) and the usual envelope. Prefer
    webhooks to polling.
  version: '2.0'
servers:
  - url: https://shortext.ny-corp.io/api/v2.0
security: []
tags:
  - name: Agents
    description: Agents
  - name: Knowledge
    description: Knowledge
  - name: Dynamic links
    description: Dynamic links
  - name: Billing
    description: Billing
  - name: Campaigns
    description: Campaigns
  - name: Channels
    description: Channels
  - name: Conversations
    description: Conversations
  - name: Follow-ups
    description: Follow-ups
  - name: Account
    description: Account
  - name: Tickets
    description: Tickets
  - name: Templates
    description: Templates
  - name: Hosted sessions
    description: Hosted sessions
  - name: Webhooks
    description: Webhooks
paths:
  /follow-ups:
    post:
      tags:
        - Follow-ups
      summary: Schedule a follow-up
      description: >-
        Follow-ups are sent until the contact replies, at the interval and up to
        the maximum of the type (or of its override for the sender). The text is
        written by the AI from `reason`, unless `message` is given. When a
        follow-up of the same type is already scheduled on the conversation,
        that one is returned.
      operationId: createFollowUp
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FollowUpInput'
      responses:
        '200':
          description: >-
            Always HTTP 200: the outcome is in `success` and `code` (absolute
            value of the response code).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiEnvelope'
                  - properties:
                      body:
                        $ref: '#/components/schemas/FollowUp'
                    type: object
      security:
        - bearerAuth: []
components:
  schemas:
    FollowUpInput:
      required:
        - conversation_id
        - type_id
        - reason
      properties:
        conversation_id:
          description: The conversation to follow up (GET /conversations)
          type: string
        type_id:
          description: GET /follow-up-types
          type: string
          example: FUI-XXXXX
        reason:
          description: >-
            What is expected from the contact; the AI writes each follow-up from
            it
          type: string
          maxLength: 2000
        message:
          description: Fixed text to send instead of the AI-written one
          type:
            - string
            - 'null'
          maxLength: 4096
        scheduled_at:
          description: First follow-up; by default after the delay of the type
          type:
            - string
            - 'null'
          format: date-time
        campaign_id:
          description: The campaign the follow-up belongs to
          type:
            - string
            - 'null'
      type: object
    ApiEnvelope:
      properties:
        success:
          type: boolean
          example: true
        code:
          type: integer
          example: 1000
        message:
          type: string
          example: Request success.
        body:
          description: Endpoint payload, null when there is none
        token:
          description: Present only on authentication routes
          type:
            - string
            - 'null'
        trace_id:
          description: Present only when success is false
          type:
            - string
            - 'null'
      type: object
    FollowUp:
      description: >-
        A follow-up on a conversation: messages sent to the contact until they
        reply, or until the maximum of the type is reached.
      properties:
        id:
          description: Public representation of follow-ups and their types (API v2.0)
          type: string
          example: FUP-XXXXX
        status:
          description: >-
            `scheduled`: follow-ups still to send. `resolved`: the customer
            replied or someone closed it as done. `exhausted`: every follow-up
            was sent without a reply. `cancelled`. `failed`: the channel refused
            the sends.
          type: string
          enum:
            - scheduled
            - resolved
            - exhausted
            - cancelled
            - failed
        type:
          properties:
            id:
              type: string
              example: FUI-XXXXX
            name:
              type: string
          type: object
        conversation_id:
          type: string
        channel:
          type: string
          example: whatsapp
        contact:
          properties:
            id:
              type: string
            name:
              type: string
            identifier:
              description: Phone number or email address
              type: string
          type: object
        campaign_id:
          type:
            - string
            - 'null'
        reason:
          description: >-
            What is expected from the contact; the AI writes the follow-ups from
            it
          type: string
        message:
          description: Fixed text sent instead of the AI-written one
          type:
            - string
            - 'null'
        set_by:
          type: string
          enum:
            - ai
            - agent
            - api
        scheduled_at:
          description: Next follow-up, while scheduled
          type:
            - string
            - 'null'
          format: date-time
        sent:
          description: Follow-ups sent so far
          type: integer
        max_follow_ups:
          type: integer
        last_sent_at:
          type:
            - string
            - 'null'
          format: date-time
        failed:
          description: Sends the channel refused (not counted in `sent`)
          type: integer
        last_error:
          type:
            - string
            - 'null'
        closed_at:
          type:
            - string
            - 'null'
          format: date-time
        closed_by:
          type:
            - string
            - 'null'
          enum:
            - customer_replied
            - agent
            - ai
            - api
            - max_followups_reached
            - expired
            - cancelled
            - send_failed
        note:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Company API key, sent as `Authorization: Bearer <key>`. Create it in the
        dashboard (Developer > API Keys) with the permissions the integration
        needs.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.