Create Knowledge Document
Header Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Body of POST /knowledge/documents: an uploaded file to add.
Response Body
application/json
application/json
curl -X POST "https://example.com/v1/knowledge/documents" \ -H "Content-Type: application/json" \ -d '{ "upload_id": "f2ef591b-135b-46fa-a604-3d4fda5bfbfb" }'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "content_type": "string", "size_bytes": 0, "status": "pending", "error": "string", "piece_count": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "tags": [ { "type": "string", "value": "string" } ]}Create File Upload
Make a one-time link to upload one file with a plain HTTP PUT. For callers whose shell has no Hail key (an agent using the MCP). Send the raw bytes to `upload_url` with `PUT` and no Authorization header, once, before `expires_at` (15 minutes): ``` curl --silent --show-error --globoff --upload-file 'passport.jpg' '<upload_url>' ``` The PUT answers with `size_bytes` and `sha256` of what was stored. An organization may hold at most 50 unused, unexpired links. A `knowledge_document` needs the knowledge base turned on for the workspace (403), and `max_bytes` is the workspace's file limit. For `sms_evidence` the PUT also answers with `url`, the public link for an `*_evidence_url` field of a US texting registration. It works like `POST /v1/verifications/sms/evidence`.
Create Knowledge Upload
Reserve a storage key for one knowledge file a browser sends straight to storage. Then sign each storage request with `POST /v1/knowledge/uploads/{id}/sign`, send the file, and call `POST /v1/knowledge/uploads/{id}/complete`. Sign requests until `expires_at` (15 minutes). Without a browser, use an upload link (`POST /v1/uploads`) instead.