Fetchply Docs
POST
/api/v1/agents/{id}/chat

Send a visitor message to an agent and receive its reply as JSON. Each delivered message uses one message credit from the account plan. Conversations appear in the dashboard Inbox under the API channel. Requires the write:chat permission.

Authorization

BearerAuth write:chat
AuthorizationBearer <token>

In: header

Scope: write:chat

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/agents/string/chat" \  -H "Content-Type: application/json" \  -d '{    "message": "What are your opening hours?",    "sessionId": "crm-user-84213"  }'
{
  "agentId": "a1b2c3d4e5",
  "sessionId": "api_7f3f0c9a-6a5e-4a2b-9d1c-3d2f1e0a9b8c",
  "reply": "We are open Monday to Friday, 9am to 6pm CET.",
  "sources": [
    {
      "title": "Contact us",
      "url": "https://acme.com/contact"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "issues": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}