Responses
-
200 application/json
OK
-
402 application/json
When 30 days message limit of your subscription plan is reached.
-
422 application/json
Request validation failure.
-
Sometimes response generation fails due to service overload or network issues. You can fetch the list of messages for the conversation to get the generated error message, or you can use your own error message.
POST
/messages
curl \
-X POST https://getcody.ai/api/v1/messages \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"string","conversation_id":"string"}'
Request example
{
"content": "string",
"conversation_id": "string"
}
Response examples (200)
{
"data": {
"id": "string",
"content": "string",
"conversation_id": "string",
"machine": true,
"failed_responding": true,
"flagged": true,
"created_at": 42
}
}
Response examples (402)
{
"message": "You have reached the message limit for last 30 days, please wait till tomorrow or upgrade your plan."
}
Response examples (422)
{
"message": "string",
"errors": {
"content": [
"string"
],
"conversation_id": [
"string"
]
}
}