Skip to main content
POST
/
v1
/
files
cURL
curl --location --request POST https://api.writer.com/v1/files \
 --header "Authorization: Bearer <token>"
 --header "Accept: */*" \
 --header "Content-Disposition: attachment; filename=descriptions.pdf" \
 --header "Content-Length: size_in_bytes" \
 --header "Content-Type: application/pdf" \
 --data-binary "@descriptions.pdf"
{
  "id": "7c36a365-392f-43ba-840d-8f3103b42572",
  "name": "example.pdf",
  "created_at": "2024-07-10T14:30:00Z",
  "graph_id": [],
  "status": "in_progress"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your Writer API key.

Headers

Content-Disposition
string
required

The disposition type of the file, typically used to indicate the form-data name. Use attachment with the filename parameter to specify the name of the file, for example: attachment; filename=example.pdf.

Content-Type
string
required

The MIME type of the file being uploaded. Supports txt, doc, docx, ppt, pptx, jpg, png, eml, html, pdf, srt, csv, xls, xlsx, mp3, and mp4 file extensions.

Content-Length
integer
required

The size of the file in bytes.

Body

The body is of type file.

Response

200 - application/json
id
string
required

A unique identifier of the file.

created_at
string<date-time>
required

The timestamp when the file was uploaded.

name
string
required

The name of the file.

graph_ids
string<uuid>[]
required

A list of Knowledge Graph IDs that the file is associated with.

status
string
required

The processing status of the file.

I