AgentsUpload agent training document

Upload agent training document

Either uploads a multipart file directly through the API or returns a presigned R2 upload URL for JSON requests. Allowed file types are PDF, DOCX, and TXT. Maximum size is 10MB.

curl -X POST "https://api.sendkit.ai/v1/agents/example_string/upload-document" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d '{
  "filename": "John Doe",
  "contentType": "application/pdf",
  "fileSize": 42
}'
{
  "success": true,
  "data": {
    "presignedUrl": "example_string",
    "uploadUrl": "example_string",
    "url": "example_string",
    "key": "example_string",
    "filename": "John Doe",
    "fileType": "pdf"
  }
}
POST
/v1/agents/{agentId}/upload-document
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) or Workspace API key (sk_...)

Platform API key (sk_user_...) or Workspace API key (sk_...)
Content-Typestring
Required

The media type of the request body

Options: application/json, multipart/form-data
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)

Path Parameters

Body

contentTypestring
Required
Example:
application/pdf

Responses

successboolean
dataobject