---
updatedAt: 2026-08-06T09:23:09.000Z
agentTools:
  projectIndex: https://developers.alcmeon.com/llms.txt
---

# Send AI generated suggestion

Endpoint to invoke to send an AI generated suggestion to a support agent. 
Once your AI API has been asynchronously called by Alcméon with a webhook_token specific for a given conversation and support agent,  this endpoint can be invoked (with the token previously received) to send the generated answer to this specific agent.


# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "AI",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.alcmeon.com",
      "description": "Alcmeon production API server"
    }
  ],
  "x-readme": {
    "explorer-enabled": false
  },
  "components": {
    "securitySchemes": {
      "basic_auth": {
        "description": "Basic authentication using your environment Instance ID as username and Application Secret as password.\n",
        "type": "http",
        "scheme": "basic"
      },
      "bearer_token": {
        "description": "OAuth 2.0 Bearer token authentication.  Obtain a token by calling the /v1/oauth2/token endpoint with your credentials. The token is valid for one hour.\n",
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "ResponseError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A short string explaining the reason of the error."
          },
          "details": {
            "type": "string",
            "description": "A short string which describes what is wrong. Provide this string to  support@alcmeon.com if you wish to obtain more details about the problem.\n"
          }
        }
      },
      "RateLimitResponseError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Rate limit reached"
          },
          "details": {
            "type": "string",
            "description": "A string showing the time when the rate limit will be reset. Example: {'rate_limited_until': '2024-01-22T13:05:41Z'}\n"
          }
        }
      },
      "SuggestionFinished": {
        "required": [
          "suggest_answer"
        ],
        "properties": {
          "suggest_answer": {
            "type": "object",
            "required": [
              "id",
              "answer",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "A unique identifier of the generated suggestion.\n"
              },
              "answer": {
                "type": "string",
                "nullable": true,
                "description": "The generated response content to send to the support agent.\n"
              },
              "status": {
                "type": "string",
                "enum": [
                  "finished"
                ],
                "description": "Status of the suggestion - Should be finished if suggestion was found\n"
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "The date of creation of suggestion.\n"
              },
              "finished_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "The date of resolution of suggestion.\n"
              },
              "knowledge_documents": {
                "type": "array",
                "nullable": true,
                "description": "The knowledge documents used to generate the suggestion. It can be empty if no documents was used.\n",
                "items": {
                  "type": "object",
                  "required": [
                    "title"
                  ],
                  "properties": {
                    "title": {
                      "type": "string",
                      "description": "The tile of the knowledge document."
                    },
                    "url": {
                      "type": "string",
                      "format": "date-time",
                      "description": "The url of the knowledge document. It can be empty if the document doesn't have a public url (PDF, snippet...)."
                    }
                  }
                }
              }
            }
          }
        },
        "example": {
          "suggest_answer": {
            "id": "1234",
            "answer": "This is my answer",
            "status": "finished",
            "created_at": "2024-01-22 13:05:21",
            "finished_at": "2024-01-22 13:05:41"
          }
        }
      },
      "SuggestionFailed": {
        "required": [
          "suggest_answer"
        ],
        "properties": {
          "suggest_answer": {
            "type": "object",
            "required": [
              "id",
              "error",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "A unique identifier of the generated suggestion.\n"
              },
              "error": {
                "type": "string",
                "nullable": true,
                "description": "The error to send to the support agent.\n"
              },
              "status": {
                "type": "string",
                "enum": [
                  "failed"
                ],
                "description": "Status of the suggestion - Should be failed if suggestion could not be found\n"
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "The date of creation of suggestion.\n"
              },
              "finished_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "The date of resolution of suggestion.            \n"
              }
            }
          }
        },
        "example": {
          "suggest_answer": {
            "id": "1234",
            "error": "Can't generate answer",
            "status": "failed",
            "created_at": "2024-01-22 13:05:21",
            "finished_at": "2024-01-22 13:05:41"
          }
        }
      }
    }
  },
  "security": [
    {
      "basic_auth": []
    },
    {
      "bearer_token": []
    }
  ],
  "paths": {
    "/ai/suggest-answer": {
      "post": {
        "summary": "Send AI generated suggestion",
        "description": "Endpoint to invoke to send an AI generated suggestion to a support agent. \nOnce your AI API has been asynchronously called by Alcméon with a webhook_token specific for a given conversation and support agent,  this endpoint can be invoked (with the token previously received) to send the generated answer to this specific agent.\n",
        "parameters": [
          {
            "in": "header",
            "name": "X-JWT",
            "schema": {
              "type": "string",
              "description": "The token received (e.g. the `webhook_token` field in the payload of the request sent to your AI API). This token is valid for 60 seconds and you cannot reuse a token received for user A to send an AI generated answer to another user B."
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SuggestionFinished"
                  },
                  {
                    "$ref": "#/components/schemas/SuggestionFailed"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "If the token used to call the endpoint is not valid (or expired) or if the received json does not match with the expected format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. For this route limit is 150 requests per minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitResponseError"
                }
              }
            }
          }
        }
      }
    }
  }
}
```