Sharing & Public Debate Access
Create share links, update visibility settings, revoke links, and retrieve public debates by token.
These endpoints let owners publish debates with share tokens and let external consumers fetch public debate data for embeds and replay.
Authenticated sharing endpoints
All /api/share/* routes require auth and ownership of the target debate.
| Method | Path | Description |
|---|---|---|
POST | /api/share/:debateId | Generate or rotate a share token |
PATCH | /api/share/:debateId | Update share settings |
DELETE | /api/share/:debateId | Revoke sharing and invalidate token |
POST /api/share/:debateId
/api/share/:debateIdCreate a public share token and URL for a debate.
Response
Share URL vs API URL
shareUrl is a frontend page URL for humans. For programmatic access, use GET /api/public/debates/:token.
PATCH /api/share/:debateId
/api/share/:debateIdUpdate sharing controls for comments, forking, and visibility options.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
settings.allowComments | boolean | Optional | Allow comments on the shared debate. |
settings.allowFork | boolean | Optional | Allow others to fork the debate. |
settings.showCost | boolean | Optional | Expose result cost metadata in public payloads. |
settings.requireSignIn | boolean | Optional | Require authenticated session to view shared debate UI. |
Example Request
curl -X PATCH https://api.askverdict.ai/api/share/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer vrd_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"settings": {
"allowComments": true,
"allowFork": false,
"showCost": false,
"requireSignIn": false
}
}'Response
DELETE /api/share/:debateId
/api/share/:debateIdDisable sharing and remove the active share token for a debate.
Response
Public embed endpoint
GET /api/public/debates/:token is unauthenticated and CORS-enabled for embed use cases.
/api/public/debates/:tokenFetch sanitized public debate payload plus ordered replay events by share token.
Example Request
curl https://api.askverdict.ai/api/public/debates/6ebfc20f-39f8-4ee3-b1a0-4be0fbe3bb84Response
CORS and preflight
GET /api/public/debates/:tokenreturns:Access-Control-Allow-Origin: *Access-Control-Allow-Methods: GET, OPTIONSAccess-Control-Allow-Headers: Content-Type
OPTIONS /api/public/debates/:tokenreturns204.
Rate limiting
Public token endpoint is IP rate-limited (sliding window). Defaults:
30requests- per
60seconds Retry-Afterheader on429
Error Responses
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR | Invalid PATCH body schema |
401 | UNAUTHORIZED | Missing/invalid auth for /api/share/* |
404 | NOT_FOUND | Debate or token not found |
429 | RATE_LIMITED | Public token endpoint rate limited |
Related Endpoints
Was this page helpful?