Agent Files
This endpoint uploads an agent file associated with the provided API key.
Authorizations
Body
filestring · binaryRequired
The file to upload
autoAddToAssistantbooleanOptionalExample:
Indicates whether to automatically add the file to the assistant.
true
Responses
200
Successfully uploaded agent file.
application/json
400
Failed to upload agent file.
application/json
403
Invalid API key or secret key. Ensure that you are using a valid authentication key.
application/json
500
Unexpected error occurred while processing the request. Please try again later.
application/json
post
POST /external/agent-files/upload HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 43
{
"file": "binary",
"autoAddToAssistant": true
}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"fileName": "example.txt",
"url": "https://example.com/file.txt",
"createdAt": "2023-10-01T12:00:00Z",
"vectorStoreFileId": "file-123e4567-e89b",
"isUploadedToVectorStore": true,
"uploadedToVectorStoreAt": "2023-10-01T12:00:00Z"
}
This endpoint retrieves the agent files associated with the provided API key.
Authorizations
Responses
200
Successfully retrieved agent files with details.
application/json
403
Invalid API key or secret key. Ensure that you are using a valid authentication key.
application/json
404
Agent files not found.
application/json
500
Unexpected error occurred while processing the request. Please try again later.
application/json
get
GET /external/agent-files/by-api-key HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"fileName": "example.txt",
"url": "https://example.com/file.txt",
"createdAt": "2023-10-01T12:00:00Z",
"vectorStoreFileId": "file-123e4567-e89b",
"isUploadedToVectorStore": true,
"uploadedToVectorStoreAt": "2023-10-01T12:00:00Z"
}
This endpoint deletes the agent file by id
Authorizations
Path parameters
idstringRequiredExample:
The ID of the agent file to delete.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Responses
200
Successfully deleted agent file.
403
Invalid API key or secret key. Ensure that you are using a valid authentication key.
application/json
404
Agent file not found.
application/json
500
Unexpected error occurred while processing the request. Please try again later.
application/json
delete
DELETE /external/agent-files/{id}/delete HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
No content
This endpoint deletes the agent file from assistant by id
Authorizations
Path parameters
idstringRequiredExample:
The ID of the agent file to delete from assistant.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Responses
200
Successfully deleted agent file from assistant.
403
Invalid API key or secret key. Ensure that you are using a valid authentication key.
application/json
404
Agent file not found.
application/json
500
Unexpected error occurred while processing the request. Please try again later.
application/json
delete
DELETE /external/agent-files/{id}/delete-from-assistant HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
No content
This endpoint adds the agent file to assistant by id
Authorizations
Path parameters
idstringRequiredExample:
The ID of the agent file to add to assistant.
5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b
Responses
200
Successfully added agent file to assistant.
403
Invalid API key or secret key. Ensure that you are using a valid authentication key.
application/json
404
Agent file not found.
application/json
500
Unexpected error occurred while processing the request. Please try again later.
application/json
put
PUT /external/agent-files/{id}/add-to-assistant HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
No content