Skip to main content
POST
/
api
/
knowledge-sets
/
{id}
/
attachments
Upload knowledge set attachment
curl --request POST \
  --url https://platform.kodexa.ai/api/knowledge-sets/{id}/attachments \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form file='@example-file' \
  --form 'attachmentId=<string>'
{
  "id": "<string>",
  "attachmentId": "<string>",
  "contentHash": "<string>",
  "fileName": "<string>",
  "size": 123,
  "contentType": "<string>",
  "uploadedAt": "2023-11-07T05:31:56Z",
  "uploadedBy": "<string>"
}

Authorizations

x-api-key
string
header
required

API key for authentication. Create one from the Kodexa platform UI under Settings > Access Tokens.

Path Parameters

id
string<uuid>
required

Unique identifier (UUID) of the knowledge set.

Body

multipart/form-data
file
file
required

The attachment file to upload.

attachmentId
string

Optional custom slug identifier for the attachment. If not provided, one will be generated from the file name.

Response

Attachment uploaded

A file attachment belonging to a knowledge set. Attachments are stored by content hash and can be referenced in markdown via the attachment:// protocol.

id
string

Unique identifier of the attachment record.

attachmentId
string

Custom slug identifier for the attachment, used in markdown references via attachment://attachmentId.

contentHash
string

SHA-256 hash of the attachment file content.

fileName
string

Original file name of the uploaded attachment.

size
integer<int64>

Size of the attachment in bytes.

contentType
string

MIME type of the attachment.

uploadedAt
string<date-time>

Timestamp when the attachment was uploaded.

uploadedBy
string

Username or identifier of the user who uploaded the attachment.