curl --request GET \
--url https://app.phonely.ai/api/agent-documents \
--header 'X-Authorization: <api-key>'{
"documents": [
{
"id": "<string>",
"agentId": "<string>",
"name": "<string>",
"active": true,
"fileUrl": "<string>",
"lastUpdatedBy": "<string>",
"lastUpdatedAt": "2023-11-07T05:31:56Z"
}
]
}List, upload, and delete agent knowledge-base documents through the frontend API.
curl --request GET \
--url https://app.phonely.ai/api/agent-documents \
--header 'X-Authorization: <api-key>'{
"documents": [
{
"id": "<string>",
"agentId": "<string>",
"name": "<string>",
"active": true,
"fileUrl": "<string>",
"lastUpdatedBy": "<string>",
"lastUpdatedAt": "2023-11-07T05:31:56Z"
}
]
}GET/api/agent-documentsX-Authorization: Your API key (required)uid (string, required): Your user IDagentId (string, required): The ID of the agent{
"documents": [
{
"id": "string",
"name": "string",
"active": boolean,
"fileUrl": "string",
"lastUpdatedBy": "string",
"lastUpdatedAt": "string"
}
]
}
POST/api/agent-documentsX-Authorization: Your API key (required)Content-Type: multipart/form-datauid (string, required): Your user IDagentId (string, required): The ID of the agentfiles (File[], required): Array of files to upload (max 10 files, 10MB each){
"documentIds": ["string"],
"message": "Files uploaded successfully"
}
DELETE/api/agent-documentsX-Authorization: Your API key (required)uid (string, required): Your user IDagentId (string, required): The ID of the agentdocumentId (string, required): The ID of the document to delete{
"message": "Document deleted successfully"
}
400 Bad Request: Invalid request parameters, too many files, file too large, or unsupported file type401 Unauthorized: Invalid or missing API key, or insufficient permissions404 Not Found: Document not found (for DELETE operations)500 Internal Server Error: Server errorcurl -X GET "https://app.phonely.ai/api/agent-documents?uid=user123&agentId=agent456" \
-H "X-Authorization: your-api-key"
curl -X POST https://app.phonely.ai/api/agent-documents \
-H "X-Authorization: your-api-key" \
-F "uid=user123" \
-F "agentId=agent456" \
-F "files=@document1.pdf" \
-F "files=@document2.docx"
curl -X DELETE "https://app.phonely.ai/api/agent-documents?uid=user123&agentId=agent456&documentId=doc789" \
-H "X-Authorization: your-api-key"