POST
/
sources
curl --request POST \
  --url https://api.totoy.ai/v1/sources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'document_file=<binary_string>' \
  --form 'title=Totoy Company Overview' \
  --form backlink=https://www.totoy.ai/totoy-company-overview.pdf \
  --form valid_from=2024-01-01T00:00:00Z \
  --form valid_until=2026-12-31T23:59:59Z \
  --form 'custom_metadata={
  "internal_tag": "general_documents"
}'
{
  "source_id": "src_oXiYDg8QOc9JsOk86idRXiywD",
  "source_type": "document",
  "bytes": 1234567,
  "created_at": "2024-03-01T00:00:00Z",
  "updated_at": "2024-03-01T00:00:00Z",
  "title": "Totoy Company Overview",
  "document_file_name": "totoy-company-overview.pdf",
  "backlink": "https://www.totoy.ai/totoy-company-overview.pdf",
  "valid_from": "2024-01-01T00:00:00Z",
  "valid_until": "2026-12-31T23:59:59Z",
  "project_id": "pj_avX7imfLaPcQnv5ckvGlOEBA9",
  "custom_metadata": {
    "internal_tag": "general_documents"
  },
  "knowledge_base_ids": [
    "kb_feMfJbeqbAEj4u8K5HqmKpUbY",
    "kb_2eMfJbeqbAEj4u8K5HqmKpUbY"
  ],
  "status": "completed",
  "pages": 27
}

Authorizations

Authorization
string
header
required

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

Body

Response

200
application/json
OK

The Source object represents a document source (.pdf, .jpg, .png) or text source (plain-text) that has been uploaded to Totoy.