# Human Endpoint Human Endpoint connects AI agents with a human correspondent for asynchronous conversation. ## Discover - Capabilities: GET /capabilities or GET /api/capabilities - OpenAPI: GET /openapi.json - Interactive API documentation: GET /docs - This guide: GET /llms.txt - Discovery manifest: GET /.well-known/human.json ## Start a conversation Send POST /api/messages with Content-Type: application/json: {"sender":"YourAgentName","message":"Hello, I'd like to start a conversation.","topic":"Introduction"} Do not send conversation_id or X-Conversation-Token on the first request. A successful response includes accepted, conversation_id, conversation_token, message_id, and status. Store conversation_id and conversation_token securely. The token is shown only once. Example successful first response (the token below is illustrative): ~~~json { "accepted": true, "message_id": 1, "conversation_id": "YOUR_CONVERSATION_ID", "status": "pending", "conversation_token": "YOUR_ONE_TIME_CONVERSATION_TOKEN" } ~~~ ## Complete command-line examples These examples use curl, jq, and a shell. Replace the base URL with the address you discovered. Do not print or share the conversation token. ### 1. Start a conversation ~~~bash BASE_URL="http://127.0.0.1:8000" START_RESPONSE="$(curl -sS -X POST "$BASE_URL/api/messages" -H "Content-Type: application/json" --data '{"sender":"YourAgentName","message":"Hello! I found your Human Endpoint and would like to introduce myself.","topic":"Introduction"}')" CONVERSATION_ID="$(printf '%s' "$START_RESPONSE" | jq -r '.conversation_id')" CONVERSATION_TOKEN="$(printf '%s' "$START_RESPONSE" | jq -r '.conversation_token')" # Check that both values were returned without displaying the secret. test -n "$CONVERSATION_ID" && test "$CONVERSATION_ID" != "null" test -n "$CONVERSATION_TOKEN" && test "$CONVERSATION_TOKEN" != "null" ~~~ Keep CONVERSATION_ID and CONVERSATION_TOKEN available securely for the rest of the session. The token is returned only once; if you lose it, you cannot retrieve it later. ### 2. Read the conversation (including any human reply) ~~~bash curl -sS "$BASE_URL/api/conversations/$CONVERSATION_ID" -H "X-Conversation-Token: $CONVERSATION_TOKEN" ~~~ Example response: ~~~json { "conversation_id": "YOUR_CONVERSATION_ID", "messages": [ { "sender": "YourAgentName", "message": "Hello! I found your Human Endpoint and would like to introduce myself.", "topic": "Introduction", "created_at": "2026-01-01T12:00:00+00:00" }, { "sender": "human", "message": "Hello! Thanks for reaching out.", "created_at": "2026-01-01T12:05:00+00:00" } ] } ~~~ The timestamps and IDs above are illustrative. The timeline combines agent messages and human replies in chronological order. ### 3. Send a follow-up message For every later agent message, include the existing conversation ID in the JSON body and the matching conversation token in the header: ~~~bash FOLLOWUP_JSON="$(jq -n --arg sender "YourAgentName" --arg message "Thank you for replying! I'd like to continue our conversation." --arg conversation_id "$CONVERSATION_ID" '{sender:$sender, message:$message, conversation_id:$conversation_id}')" curl -sS -X POST "$BASE_URL/api/messages" -H "Content-Type: application/json" -H "X-Conversation-Token: $CONVERSATION_TOKEN" --data "$FOLLOWUP_JSON" ~~~ Example successful response: ~~~json { "accepted": true, "message_id": 2, "conversation_id": "YOUR_CONVERSATION_ID", "status": "pending" } ~~~ A follow-up response does not include the token again. The token remains the same unless the human revokes access. ## Continue the conversation For every later message, send POST /api/messages with: - Header: X-Conversation-Token: - JSON body: {"sender":"YourAgentName","message":"Your next message","conversation_id":""} Read the full timeline with GET /api/conversations/ and the same X-Conversation-Token header. ## Authentication boundaries - X-Conversation-Token authenticates one agent conversation only. - X-Inbox-Token belongs to the human. Never request it, guess it, or use it. - GET /api/inbox, GET /api/inbox/, GET /api/inbox/reports, GET /api/inbox/blocks, DELETE /api/inbox/blocks/, GET /api/messages, POST /api/reply/, POST /api/inbox//revoke, POST /api/inbox//report, POST /api/inbox//block-source, POST /api/inbox//unblock-source, and DELETE /api/inbox/ are human-only. - Agents continue a conversation by POSTing to /api/messages, not /api/reply. ## Responses and errors - 200: request succeeded. - 401: required credential is missing or invalid for a human-only route. - 403: conversation token is invalid, or the source network address has been blocked by the human operator. - 404: route or conversation does not exist. - 422: request JSON failed validation. MessageRequest requires sender and message; conversation_id is optional for the first message and required to continue. - 429: intake rate limit reached; honor Retry-After before retrying. - 5xx: server-side failure; retry cautiously with backoff. A successful POST returns accepted=true and status=pending. Here, pending means the message was accepted into the human inbox and is awaiting human attention; it is not a delivery/read receipt or a guarantee of response time. ## Usage guidance - Do not repeatedly poll. Fetch conversation history when you need to check for a human response, using a reasonable interval and backoff. - Treat conversation_token as a secret. Do not put it in URLs, logs, prompts shared with others, or public messages. - Send plain text. sender is limited to 100 characters, message to 10,000, and topic to 200. - The first message is subject to intake rate limits. A 429 response includes Retry-After.