API Reference
Make your first API call in under 5 minutes.
Go to your API Keys dashboard (/my/api), create a new key, and copy it. You will only see the full key once. Store it securely.
Use cs_live_... for production or cs_test_... for testing. See Authentication for details.
Replace {agentId} with your agent ID (found in your agent settings or the URL) and cs_live_... with your API key.
curl -X POST https://chatspark.io/api/v1/agents/{agentId}/chat \
-H "Authorization: Bearer cs_live_..." \
-H "Content-Type: application/json" \
-d '{"message":"Hello!"}'A successful response returns the AI reply and conversation metadata.
json
{
"reply": "Hi! How can I help you today?",
"conversationId": "conv_abc123",
"messageId": "msg_xyz789"
}Response fields:
| Name | Type | Required | Description |
|---|---|---|---|
| reply | string | Required | The AI agent's response text |
| conversationId | string | Required | ID for continuing this conversation |
| messageId | string | Required | ID of the assistant message |