POST
/
knowledge
/
{knowledge_base_id}
/
register_file
import requests

url = "https://api.opper.ai/v2/knowledge/{knowledge_base_id}/register_file"

payload = {
    "filename": "example.pdf",
    "file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "content_type": "application/pdf"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "key": "<string>",
  "original_filename": "<string>",
  "document_id": 123
}

Authorizations

Authorization
string
header
required

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

Path Parameters

knowledge_base_id
string
required

The id of the knowledge base to register the file for

Body

application/json

Response

201
application/json

Successful Response

The response is of type object.