Send Message

POST /messages

Send your message and receive the AI generated response.

application/json

Body

Content can be upto 2000 characters.

  • content string Required
  • conversation_id string Required

Responses

  • 200 application/json

    OK

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • id string
      • content string Required
      • conversation_id string Required
      • machine boolean

        This is true for all LLM generated messages.

      • failed_responding boolean

        This will be true if the response generation for a message had failed.

      • flagged boolean

        This is true when message is in violation of OpenAI usage policy.

      • created_at integer(int64)

        Unix timestamp in seconds

  • 402 application/json

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

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

    Request validation failure.

    Hide response attributes Show response attributes object
    • message string
    • errors object
      Hide errors attributes Show errors attributes object
      • content array[string]
      • conversation_id array[string]
  • 500

    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 \
 --request POST 'https://getcody.ai/api/v1/messages' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"content":"string","conversation_id":"string"}'
Request examples
{
  "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"
    ]
  }
}