Skip to main content
POST
/
v1
/
beta
/
private_indexes
/
{id}
/
files
/
cURL
curl --request POST \
  --url https://trytako.com/api/v1/beta/private_indexes/{id}/files/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "files": [
    {
      "file_url": "<string>",
      "file_id": "<string>",
      "file_context": "<string>",
      "source": "<string>"
    }
  ],
  "generate_ontology": true,
  "link_world_ontology": true
}'
{
  "message": "<string>",
  "files": [
    {
      "id": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>",
      "source": "<string>",
      "schema_id": "<string>",
      "file_context": "<string>",
      "prepend_schema_context": true,
      "segment_id": "<string>",
      "ontology_state": "<string>"
    }
  ]
}

Notes

  • To authenticate, you’ll need a Tako API key. It’s best practice to store it as an environment variable to avoid hardcoding sensitive credentials in your code.
  • Adds one or more files to an existing private index.
  • Files can be specified by URL or file ID, and can include optional context and metadata.
  • Supports batch upload of multiple files in a single request.
  • You can control ontology generation and linking with the world ontology through request parameters.
  • Returns metadata for all successfully added files.
  • Returns a 400 error for invalid requests or 404 if the private index is not found.

Authorizations

X-API-Key
string
header
required

Path Parameters

id
string
required

ID of the private index

Body

application/json
files
ConnectFile · object[]
required

List of files to upload

generate_ontology
boolean | null
default:true

Whether to generate or update the ontology for this file.

Whether to link the private index ontology with the world ontology through deduplication.

Response

Files added to private index

message
string
required

Message indicating the result of the private index upload operation

files
FileConnectorMetadata · object[]
required

Metadata of files that were uploaded

I