Skip to main content
POST
/
v2
/
files
Core - Upload retrieval file
curl --request POST \
  --url 'https://api.orq.ai/v2/files' \
  --header 'Authorization: Bearer $ORQ_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "filename": "support-faq.md",
    "content": "IyBTdXBwb3J0IEZBUQoKQ29tbW9uIHJlc29sdXRpb25zIGFuZCBlc2NhbGF0aW9uIHBhdGhzLg==",
    "content_type": "text/markdown",
    "purpose": "FILE_PURPOSE_RETRIEVAL",
    "project_id": "proj_01HZXW2K7Y8Q9M0N1P2R3S4T5V"
  }'
{
  "file": {
    "file_id": "<string>",
    "file_name": "<string>",
    "bytes": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "project_id": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
filename
string
required

Name to store for the uploaded file, including extension when available.

content
string<bytes>
required

Base64-encoded file contents.

purpose
enum<string>

Intended usage category for the uploaded file. Defaults to retrieval when omitted.

Available options:
FILE_PURPOSE_UNSPECIFIED,
FILE_PURPOSE_RETRIEVAL,
FILE_PURPOSE_KNOWLEDGE_DATASOURCE,
FILE_PURPOSE_BATCH
content_type
string

MIME type of the uploaded content, for example application/pdf.

project_id
string

Project the file is created in. Optional: project-scoped API keys default to the key's bound project; workspace-scoped callers default to the workspace's default project.

Response

200 - application/json

OK

file
object
required

Newly created file.