Assistant Files
Assistant Files API
This API is a premium feature and must be enabled for your organization. Contact support to request access.
Authentication
This API uses User API Keys. These can be created in the user settings and have the prefix sk_meingpt_.
curl -X GET "https://app.meingpt.com/api/assistant-files/v1/assistants/{assistantId}/files" \
-H "Authorization: Bearer $MEINGPT_API_KEY"Permissions
- List files / Get metadata: Requires
VIEW,EDIT, orOWNERpermission for the assistant - Upload / Replace / Delete files: Requires
EDITorOWNERpermission for the assistant
Endpoints
/assistant-files/v1/assistants/{assistantId}/filesReturns a list of all files uploaded to the specified assistant with metadata for change detection.
Authorization
ApiKeyAuth API key for authentication. Use 'Bearer ' format.
In: header
Path Parameters
The assistant ID
Header Parameters
API key for authentication. Use 'Bearer ' format.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files" \ -H "Authorization: Bearer sk_meingpt_..."{
"files": [
{
"id": "string",
"originalName": "string",
"mimeType": "string",
"size": 0,
"createdAt": "string",
"updatedAt": "string"
}
],
"count": 0,
"assistantId": "string"
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}/assistant-files/v1/assistants/{assistantId}/filesUploads a file and adds it to the assistant's knowledge base. Limit: max 150MB per file.
Authorization
ApiKeyAuth API key for authentication. Use 'Bearer ' format.
In: header
Path Parameters
The assistant ID
Header Parameters
API key for authentication. Use 'Bearer ' format.
Request Body
multipart/form-data
File upload (max 150MB)
binaryResponse Body
application/json
application/json
application/json
application/json
curl -X POST "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files" \ -H "Authorization: Bearer sk_meingpt_..." \ -F file="string"{
"success": true,
"assistantId": "string",
"file": {
"id": "string",
"originalName": "string",
"size": 0,
"mimeType": "string",
"uploadedAt": "string"
}
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}/assistant-files/v1/assistants/{assistantId}/files/{documentId}Returns metadata for a specific file, useful for change detection.
Authorization
ApiKeyAuth API key for authentication. Use 'Bearer ' format.
In: header
Path Parameters
The assistant ID
The document ID
Header Parameters
API key for authentication. Use 'Bearer ' format.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files/string" \ -H "Authorization: Bearer sk_meingpt_..."{
"id": "string",
"originalName": "string",
"mimeType": "string",
"size": 0,
"createdAt": "string",
"updatedAt": "string",
"processingStatus": "string",
"derivations": [
"string"
],
"assistantId": "string"
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}/assistant-files/v1/assistants/{assistantId}/files/{documentId}Replaces an existing file by uploading a new one and deleting the previous document. Note: the replacement upload will receive a new id.
Authorization
ApiKeyAuth API key for authentication. Use 'Bearer ' format.
In: header
Path Parameters
The assistant ID
The document ID to replace
Header Parameters
API key for authentication. Use 'Bearer ' format.
Request Body
multipart/form-data
binaryResponse Body
application/json
application/json
application/json
application/json
curl -X PUT "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files/string" \ -H "Authorization: Bearer sk_meingpt_..." \ -F file="string"{
"success": true,
"assistantId": "string",
"replacedId": "string",
"originalId": "string",
"file": {
"id": "string",
"originalName": "string",
"size": 0,
"mimeType": "string",
"uploadedAt": "string"
}
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}/assistant-files/v1/assistants/{assistantId}/files/{documentId}Permanently deletes a file from the assistant's knowledge base.
Authorization
ApiKeyAuth API key for authentication. Use 'Bearer ' format.
In: header
Path Parameters
The assistant ID
The document ID to delete
Header Parameters
API key for authentication. Use 'Bearer ' format.
Response Body
application/json
application/json
application/json
application/json
curl -X DELETE "https://app.meingpt.com/api/assistant-files/v1/assistants/string/files/string" \ -H "Authorization: Bearer sk_meingpt_..."{
"success": true,
"assistantId": "string",
"originalId": "string"
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}{
"status": "error",
"message": "string"
}Replacing a file uploads a new document and then deletes the old one. The replacement upload will receive a new id.
Finding the AssistantId
- Go to edit mode for your assistant
- In the URL, you'll find the AssistantId after
/assistants/
