Resource Uploads

Uploads a file to an AI provider that supports uploads. POST and PUT are equivalent. The request must be multipart/form-data.

POST /api/ai/resources

PUT /api/ai/resources

REQUEST Parameter Value Type Description
file file Multipart file part. Required. If no part named file is present, the first part with a filename is used.
providerId or provider string Provider selection via query or form field. Omitted values use the default provider.
name string Optional resource name. If omitted, the submitted filename or part name is used.

The selected provider must support upload. Otherwise the request fails. Unknown providers return 404. Wrong methods return 405.

RESPONSE Field Value Type Description
providerId string Provider used for the upload.
resourceId string Uploaded resource identifier for later AI requests.

Example Request

# Request
POST /api/ai/resources?providerId=Primary-Provider HTTP/1.1
Host: helpdesk.example.com
Authorization: Bearer <access_token>
Content-Type: multipart/form-data; boundary=----boundary
 
------boundary
Content-Disposition: form-data; name="file"; filename="notes.txt"
Content-Type: text/plain
 
Example notes
------boundary--
 
# Response
HTTP/1.1 200 OK
Content-Type: application/json
 
{
  "providerId": "Primary Provider",
  "resourceId": "res_123"
}