🧩Example API Requests

Here are real-world examples of how to interact with Operator AI’s API — so you can start building automations, integrations, and workflows faster.


🧩 Example: Create a New User

POST /users
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "name": "Jane Smith",
  "email": "jane@example.com",
  "phone": "+15551234567",
  "tags": ["DemoLead", "NewsletterSignup"]
}

✅ Instantly create new user profiles from forms, CRMs, or external apps.


🧩 Example: Send a New Message

POST /messages
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "conversation_id": "123456",
  "message": "Thanks for reaching out! How can we help you today?",
  "type": "agent"
}

✅ Send personalized or automated messages inside existing conversations.


🧩 Example: Tag a User

POST /tags
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "user_id": "78910",
  "tag": "HighIntent"
}

✅ Organize users better for segmentation, automation, and reporting.


🧩 Example: Get All Conversations

GET /conversations
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

✅ Retrieve all active, pending, or closed conversations for reporting or syncing.


📋 Tips for Building with the API

Tip
Why It Matters

Always use HTTPS

Protects your data and token security.

Handle pagination responses

/conversations and /users may paginate results.

Validate API responses

Always check for success codes and error handling.

Retry on temporary server errors

Build resilience into your integrations.

Rotate tokens quarterly

Maintain good security hygiene.

✅ Consistent, defensive programming = stronger integrations.


🛟 Need Help?

  • Explore full API usage tutorials inside this documentation.

  • Contact support@heyoperator.ai if you need integration help.

  • Your Success Manager can help you architect API-powered workflows.

✅ We’re here to help your Operator AI setup extend powerfully.


🎯 Next Step

👉 Continue to Error Codes and Handling →

Last updated