Attachments & URL Context
Upload files, attach URLs, list/download attachments, and remove attachment context for debates.
Attachments let you provide source documents to a debate. AskVerdict extracts text and uses it as context for agent reasoning.
Scope and ownership
All attachment routes are scoped to your own debates under /api/debates/*. You cannot access attachments for debates you do not own.
Supported file types and limits
| Capability | Default |
|---|---|
| Supported file types | .pdf, .txt, .md, .docx |
| Max file size | 10 MB per file |
| Max attachments per debate | 5 |
| Max extracted context | 50,000 characters per attachment |
Asynchronous extraction
File upload returns immediately after storage. Text extraction and chunk processing run asynchronously in the background.
POST /api/debates/:id/attachments
/api/debates/:id/attachmentsUpload a file attachment to a debate using multipart/form-data.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Required | Debate ID. |
Form Data
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | Attachment file. Allowed extensions: .pdf, .txt, .md, .docx. |
Example Request
curl -X POST https://api.askverdict.ai/api/debates/550e8400-e29b-41d4-a716-446655440000/attachments \
-H "Authorization: Bearer vrd_your_api_key" \
-F "file=@./decision-memo.pdf"Response
Error Responses
| Status | Code | Description |
|---|---|---|
400 | VALIDATION_ERROR | Invalid multipart body, unsupported extension, size limit, or attachment cap |
401 | UNAUTHORIZED | Missing or invalid authentication |
404 | NOT_FOUND | Debate not found or not owned by user |
500 | INTERNAL_ERROR | Upload/storage failure |
GET /api/debates/:id/attachments
/api/debates/:id/attachmentsList all attachments currently associated with a debate.
Example Request
curl https://api.askverdict.ai/api/debates/550e8400-e29b-41d4-a716-446655440000/attachments \
-H "Authorization: Bearer vrd_your_api_key"Response
GET /api/debates/:id/attachments/:attachmentId/download
/api/debates/:id/attachments/:attachmentId/downloadDownload an uploaded file attachment. URL attachments return the original URL payload.
Behavior
- Binary attachments return streamed content with
Content-Disposition: attachment. - URL attachments (created via fetch-url) return JSON:
{ "url": "https://..." }.
Example Request
curl -L https://api.askverdict.ai/api/debates/550e8400-e29b-41d4-a716-446655440000/attachments/att_9f2f0f6a/download \
-H "Authorization: Bearer vrd_your_api_key" \
-o decision-memo.pdfDELETE /api/debates/:id/attachments/:attachmentId
/api/debates/:id/attachments/:attachmentIdDelete an attachment from a debate.
Response
Error Responses
| Status | Code | Description |
|---|---|---|
401 | UNAUTHORIZED | Missing or invalid auth |
403 | FORBIDDEN | Attachment exists but is not owned by caller |
404 | NOT_FOUND | Attachment not found |
POST /api/debates/fetch-url
/api/debates/fetch-urlFetch a web page server-side, extract readable text, and store it as a URL attachment.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
debateId | string (UUID) | Required | Debate ID to attach URL context to. |
url | string (http/https URL) | Required | Public URL to fetch and extract into debate context. |
Example Request
curl -X POST https://api.askverdict.ai/api/debates/fetch-url \
-H "Authorization: Bearer vrd_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"debateId": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/market-report"
}'Response
Related Endpoints
Was this page helpful?