---
updatedAt: 2026-06-15T09:50:57.000Z
agentTools:
  projectIndex: https://developers.tidio.com/llms.txt
---

# Ask Lyro to answer ticket

This API endpoint asks Lyro to answer a ticket based on the data provided. Responding can take up to 40 seconds.
Currently, it only works for the first message in the ticket, which is why the request is limited to a single message.


# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Tidio - Openapi",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.tidio.com/"
    }
  ],
  "tags": [
    {
      "name": "Lyro"
    }
  ],
  "security": [
    {
      "ClientId": [],
      "ClientSecret": []
    }
  ],
  "paths": {
    "/lyro/tickets": {
      "post": {
        "tags": [
          "Lyro"
        ],
        "summary": "Ask Lyro to answer ticket",
        "description": "This API endpoint asks Lyro to answer a ticket based on the data provided. Responding can take up to 40 seconds.\nCurrently, it only works for the first message in the ticket, which is why the request is limited to a single message.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json; version=1": {
              "schema": {
                "type": "object",
                "required": [
                  "ticket_id",
                  "subject",
                  "contact_email",
                  "contact_name",
                  "recipient_email",
                  "messages"
                ],
                "properties": {
                  "ticket_id": {
                    "type": "string",
                    "format": "ulid",
                    "description": "ID of the ticket",
                    "example": "01H6XZJ88T5PMRRQC3C54WY1EJ"
                  },
                  "subject": {
                    "type": "string",
                    "description": "Subject of the ticket",
                    "example": "Question about delivery"
                  },
                  "contact_email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the contact person",
                    "example": "user@tidio.com"
                  },
                  "contact_name": {
                    "type": "string",
                    "description": "Name of the contact person",
                    "example": "John Doe"
                  },
                  "recipient_email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the recipient",
                    "example": "support@tidio.com"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "created_at",
                        "message_id",
                        "author_type",
                        "message_type",
                        "message_content"
                      ],
                      "properties": {
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Creation date of the message",
                          "example": "2023-01-01T00:00:00+00:00"
                        },
                        "message_id": {
                          "type": "string",
                          "format": "ulid",
                          "description": "ID of the message",
                          "example": "01JVRXTTZ4ACV3JZTQS8ZVKASK"
                        },
                        "author_type": {
                          "type": "string",
                          "description": "Currently only contact messages are supported",
                          "enum": [
                            "contact"
                          ],
                          "example": "contact"
                        },
                        "message_type": {
                          "type": "string",
                          "description": "Currently only public messages are supported",
                          "enum": [
                            "public"
                          ],
                          "example": "public"
                        },
                        "attachments": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "description": "File name of the attachment",
                            "example": "image.png"
                          }
                        },
                        "message_content": {
                          "type": "string",
                          "description": "Message content",
                          "example": "Is it possible to ship the product to the USA?"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "An answer to the ticket generated by Lyro or null if Lyro is not able to generate an answer.",
            "content": {
              "application/json; version=1": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message_content": {
                      "type": "string",
                      "description": "Message content",
                      "nullable": true,
                      "example": "Yes, we can ship the product to the USA."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "No available quota or Lyro is disabled.",
            "content": {
              "application/json; version=1": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errors": [
                    {
                      "code": "no_quota",
                      "message": "No available quota for Lyro"
                    },
                    {
                      "code": "lyro_disabled",
                      "message": "Lyro is disabled"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntityResponse"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "bad_request",
            "title": "Error code"
          },
          "message": {
            "type": "string",
            "title": "More specific description of the error",
            "example": "The request was invalid or cannot be served. "
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ClientId": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tidio-Openapi-Client-Id"
      },
      "ClientSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tidio-Openapi-Client-Secret"
      }
    },
    "responses": {
      "UnprocessableEntityResponse": {
        "description": "Unprocessable Entity",
        "content": {
          "application/json; version=1": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "errors": [
                {
                  "code": "not_valid",
                  "message": "The email must be a valid email address"
                }
              ]
            }
          }
        }
      }
    }
  }
}
```