Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.orsay.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Orsay REST API allows you to manage sequences programmatically from your own server. This is useful for:
  • Automating sequence creation from a VPS or cron job
  • Integrating Orsay into your existing pipeline (e.g., Instagram → DM sequence)
  • Building custom automations without going through the dashboard

Authentication

All API requests require a Bearer token using your API key.
curl -X GET https://client.api.prod.orsay.ai/api/v1/sequences \
  -H "Authorization: Bearer sk_live_your_api_key_here"

Getting your API key

  1. Go to Settings → API Keys in the Orsay dashboard
  2. Click Generate API Key
  3. Copy the key immediately — it won’t be shown again
Your API key gives full access to your organization’s sequences. Keep it secret and never expose it in client-side code.

Rate Limiting

The API is rate-limited to 200 requests per hour per organization. If you exceed this limit, you’ll receive a 429 Too Many Requests response with a Retry-After header indicating how many seconds to wait.

Base URL

https://client.api.prod.orsay.ai/api/v1

Endpoints

List Agents

GET /agents
Returns all AI agents for your organization. Response:
[
  {
    "id": "e5f6g7h8-...",
    "name": "Sales Agent",
    "is_published": true
  }
]

List Profiles

GET /profiles
Returns all connected Instagram and WhatsApp profiles. Response:
{
  "instagram": [
    {
      "id": "12345678",
      "username": "mybusiness",
      "status": "CONNECTED"
    }
  ],
  "whatsapp": [
    {
      "id": "abcd-1234-...",
      "name": "My WhatsApp",
      "status": "CONNECTED"
    }
  ]
}

List Sequences

GET /sequences
Returns all sequences for your organization. Response:
[
  {
    "id": "a1b2c3d4-...",
    "name": "Welcome DM",
    "trigger": "INSTAGRAM_MESSAGE",
    "channel": "INSTAGRAM",
    "active": true
  }
]

Get Sequence

GET /sequences/{sequence_id}
Returns full details of a specific sequence. Response:
{
  "id": "a1b2c3d4-...",
  "name": "Welcome DM",
  "trigger": "INSTAGRAM_MESSAGE",
  "channel": "INSTAGRAM",
  "active": true,
  "type": "INBOUND",
  "agent_id": "e5f6g7h8-...",
  "profile_id": "12345",
  "inbound_response_delay": 5,
  "inbound_response_delay_unit": "MINUTES",
  "flow": [
    {
      "delay": 0,
      "delay_unit": "MINUTES",
      "content": "Hello! How can I help you?",
      "template_id": null,
      "action": null
    }
  ]
}

Create Sequence

POST /sequences
Request body:
{
  "name": "My New Sequence",
  "trigger": "INSTAGRAM_MESSAGE",
  "inbound_response_delay": 5,
  "inbound_response_delay_unit": "MINUTES",
  "agent_id": "e5f6g7h8-...",
  "profile_id": "12345",
  "active": false,
  "flow": [
    {
      "delay": 0,
      "delay_unit": "MINUTES",
      "followup_delays": [
        { "delay": 30, "delay_unit": "MINUTES" }
      ]
    }
  ]
}
Required fields:
FieldTypeDescription
namestringName of the sequence
triggerstringTrigger type (see below)
Optional fields:
FieldTypeDefaultDescription
inbound_response_delayint5Delay before first response
inbound_response_delay_unitstring”MINUTES”SECONDS, MINUTES, or HOURS
agent_idstringnullAI agent ID to use
profile_idstringnullInstagram or WhatsApp profile ID
activeboolfalseWhether the sequence is active
flowarray[]Flow steps definition
filtering_agentstringnullFiltering agent ID
should_continue_existing_conversationsboolfalseContinue existing conversations
keywordsarraynullTrigger keywords
target_accountsarraynullTarget accounts for scraping
enable_agent_on_conversationbooltrueEnable AI agent on conversations
require_manual_approvalboolfalseRequire manual message approval
Response (201):
{
  "id": "new-sequence-uuid"
}

Update Sequence

PUT /sequences/{sequence_id}
Only include the fields you want to update. Request body:
{
  "name": "Updated Name",
  "active": true,
  "inbound_response_delay": 10
}
Response:
{
  "id": "a1b2c3d4-...",
  "status": "updated"
}

Delete Sequence

DELETE /sequences/{sequence_id}
Response:
{
  "status": "deleted"
}

Trigger Types

TriggerChannelType
INSTAGRAM_MESSAGEInstagramInbound
INSTAGRAM_COMMENTInstagramOutbound
INSTAGRAM_STORY_REPLYInstagramInbound
INSTAGRAM_LEAD_FINDER_NEW_FOLLOWERInstagramOutbound
INSTAGRAM_LEAD_FINDER_OTHER_ACCOUNT_FOLLOWERSInstagramOutbound
INSTAGRAM_LEAD_FINDER_NEW_LIKEInstagramOutbound
INSTAGRAM_LEAD_FINDER_OTHER_ACCOUNT_COMMENTInstagramOutbound
WHATSAPP_MESSAGEWhatsAppInbound
CONTACT_CREATEDWhatsAppOutbound
CONTACT_SUBSCRIBED_TO_SEQUENCEWhatsAppOutbound

Error Codes

CodeDescription
401Invalid or missing API key
404Sequence not found
429Rate limit exceeded (200 req/hour)
400Invalid request (bad trigger, missing field, etc.)

Example: Full Pipeline

import requests
import time

API_KEY = "sk_live_your_key_here"
BASE_URL = "https://client.api.prod.orsay.ai/api/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# 1. List sequences
sequences = requests.get(f"{BASE_URL}/sequences", headers=HEADERS).json()
print(f"Found {len(sequences)} sequences")

# 2. Create a new sequence
new_seq = requests.post(f"{BASE_URL}/sequences", headers=HEADERS, json={
    "name": "Auto DM Pipeline",
    "trigger": "INSTAGRAM_MESSAGE",
    "inbound_response_delay": 2,
    "inbound_response_delay_unit": "MINUTES",
    "agent_id": "your-agent-id",
    "profile_id": "your-instagram-profile-id",
    "active": True,
    "flow": [
        {
            "delay": 0,
            "delay_unit": "MINUTES",
            "followup_delays": [
                {"delay": 30, "delay_unit": "MINUTES"},
                {"delay": 120, "delay_unit": "MINUTES"}
            ]
        }
    ]
}).json()
print(f"Created sequence: {new_seq['id']}")

# 3. Update it later
time.sleep(1)  # Small delay between requests
requests.put(f"{BASE_URL}/sequences/{new_seq['id']}", headers=HEADERS, json={
    "name": "Auto DM Pipeline v2",
    "inbound_response_delay": 5,
})