Groundeddocs
ReferencePublic agents and widget

Ask a public agent as an anonymous visitor (needs the session cookie)

POST/v1/public/agents/{agentId}/chat

The same events as POST /v1/agents/{team}/{agent}/chat. Public answers are moderated in buffer mode by default, so text arrives after the output check. The conversation is the session's current one; newConversation starts another. Guardrails run first: 400 message_too_long (public_message_max_chars), 429 rate_limited (per address or session, or too many concurrent chats) and quota_exceeded (daily caps) with Retry-After, 503 limits_unavailable when rate limits can't be checked (fail closed), 503 public_disabled, 403 agent_disabled, 503 agent_unavailable when the team's monthly budget is used up (the visitor is not told why).

Path Parameters

agentId*string
Formatuuid

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

curl -X POST "https://example.com/v1/public/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/chat" \  -H "Content-Type: application/json" \  -d '{    "message": "string"  }'
{  "data": {    "conversationId": "ee6e55e8-45fe-4a3e-9bc8-4669f9fdf77a",    "userMessageId": "213e61c8-c98a-43da-84bd-347b3cdc3eec",    "messageId": "8540d774-4863-4d2b-b788-4ecb19412e85",    "persisted": true,    "agentVersion": 0,    "text": "string",    "thinking": "string",    "citations": [      {        "n": 0,        "documentId": "4704590c-004e-410d-adf7-acb7ca0a7052",        "sourceId": "797f5a94-3689-4ac8-82fd-d749511ea2b2",        "title": "string",        "snippet": "string",        "headingPath": [          "string"        ],        "pageStart": 0,        "pageEnd": 0,        "url": "string",        "verification": "verified",        "confidence": 0,        "markers": [          {            "verification": "verified",            "confidence": 0          }        ]      }    ],    "sources": [      {        "n": 0,        "title": "string",        "url": "string",        "snippet": "string",        "conflicting": true      }    ],    "usage": {      "input": 0,      "output": 0,      "reasoning": 0,      "cacheRead": 0,      "cacheWrite": 0,      "total": 0    },    "stopReason": "stop",    "errorCode": "string",    "errorMessage": "string",    "refused": true,    "noContext": true,    "latencyMs": 0,    "moderation": {      "stage": "input",      "action": "blocked",      "category": "violence",      "notice": "string"    },    "uncited": [      {        "start": 0,        "end": 0      }    ],    "claims": [      {        "index": 0,        "start": 0,        "end": 0,        "text": "string",        "verdict": "supported",        "sources": [          0        ],        "confidence": 0,        "checks": [          {            "n": 0,            "occurrence": 0,            "verification": "verified",            "confidence": 0          }        ]      }    ]  }}