İçeriğe geç

Endpoint'ler

API channel (AI chat)

Run your AI agent from your own app or website. Turn the channel on under Channels → API first. These routes take an API key only.

Yollar temel URL'ye göredir. Her kart, çağrının gerektirdiği izni ve her parametreyi türü ve sınırlarıyla listeler.

POST
/messages

Send a customer message to the AI agent. The agent replies a little later, like in a real DM: to the callback URL set under Channels → API, or poll GET /conversations/:id/messages.

Yalnızca API anahtarı
Eski yanıt biçimi

JSON gövdesi

  • messagezorunlustring

    The customer's message.

  • conversationIdisteğe bağlıinteger

    Continue an API-channel conversation. Omit to start a new one.

  • messageIdisteğe bağlıstring

    Your ID for this message, used to ignore duplicates.

  • externalUserIdisteğe bağlıstring

    Your ID for the customer.

  • externalUsernameisteğe bağlıstring

    The customer's username in your app.

  • externalFirstNameisteğe bağlıstring

    The customer's first name.

  • externalChatIdisteğe bağlıstring

    Your chat or thread ID.

  • Answers 202 { conversationId, status: "buffering", delivery: "callback" | "polling" }.
  • 403 when the API channel is not enabled under Channels → API.
POST
/chat

Synchronous one-shot chat: send a message and wait for the AI reply. Answers { conversationId, response, messages }.

Yalnızca API anahtarı
Eski yanıt biçimi

JSON gövdesi

  • messagezorunlustring

    The customer's message.

  • conversationIdisteğe bağlıinteger

    Continue a conversation.

  • externalUserIdisteğe bağlıstring

    Your ID for the customer.

  • externalUsernameisteğe bağlıstring

    The customer's username in your app.

  • externalFirstNameisteğe bağlıstring

    The customer's first name.

  • externalChatIdisteğe bağlıstring

    Your chat or thread ID.

GET
/agents

Returns the workspace's agent as [{ id, systemPrompt }], or [] before setup.

Yalnızca API anahtarı
Eski yanıt biçimi