Skip to main content

Create Configuration

POST /backend/followup/configs
Body:
{
  "assistant_id": "uuid",
  "trigger_status_ids": ["uuid-status-1"],
  "steps": [
    {
      "interval": "PT30M",
      "prompt": "Friendly follow-up message"
    },
    {
      "interval": "PT2H",
      "prompt": "Offer a product demo"
    }
  ],
  "official_steps": [
    {
      "channel_id": "uuid",
      "channel_name": "WhatsApp Business",
      "app_id": "gupshup_app_12345",
      "steps": [
        {
          "interval": "P1D",
          "template_name": "reengagement_v1",
          "template_language": "en",
          "template_params": ["{{LEAD_FIRSTNAME}}"]
        }
      ]
    }
  ]
}
FieldTypeRequiredDescription
assistant_idUUIDYesLinked assistant
trigger_status_idsUUID[]YesStatuses that trigger follow-up
stepsarrayConditionalAI steps (required if no official_steps)
steps[].intervalstringYesISO 8601 interval (min 30 min)
steps[].promptstringConditionalPrompt for AI message generation
steps[].template_namestringConditionalRequired if interval >= 24h
steps[].template_languagestringNoTemplate language (default: pt_BR)
steps[].template_paramsstring[]NoTemplate parameters
official_stepsarrayNoSteps per official channel (Meta/Gupshup)
official_steps[].channel_idstringYesChannel ID
official_steps[].app_idstringYesGupshup app ID
official_steps[].stepsarrayYesChannel steps (min 1)
Response (201): Complete FollowupConfig object.

Validations

  • At least one step (in steps or official_steps)
  • Maximum 3 steps per configuration
  • Minimum interval: 30 minutes
  • If interval >= 24h: template_name required
  • No duplicate channel_id in official_steps
  • One config per assistant

Get Configuration

GET /backend/followup/configs/{id}

Get by Assistant

GET /backend/followup/configs/assistant/{assistantId}
Returns the follow-up configuration linked to the assistant.

List by Tenant

GET /backend/followup/configs/tenant/{tenantId}

Update Configuration

PUT /backend/followup/configs/{id}
Body (all fields optional):
{
  "trigger_status_ids": ["uuid-status-1", "uuid-status-2"],
  "steps": [...],
  "official_steps": [...],
  "is_active": false
}

Delete Configuration

DELETE /backend/followup/configs/{id}
Response: 204 No Content
Already scheduled follow-up jobs will continue running until processed. Deletion does not cancel in-progress jobs.