Send Message

POST /messages

Send your message and receive the AI generated response.

application/json

Body

Content can be upto 2000 characters.

Responses

  • 200 application/json

    OK

    Hide response attribute Show response attribute object
  • 402 application/json

    When 30 days message limit of your subscription plan is reached.

    Hide response attribute Show response attribute object
  • 422 application/json

    Request validation failure.

    Hide response attributes Show response attributes object
  • 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"
    ]
  }
}