POST
/
v1
/
files
Create file
curl --request POST \
  --url https://api.hyperline.co/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "invoice_2024.pdf",
  "customer_id": "cus_QalW2vTAdkR6IY"
}'
{
  "id": "fil_2QdJDDUej969ev",
  "name": "invoice_2024.pdf",
  "type": "pdf",
  "mimetype": "application/pdf",
  "customer_id": "cus_QalW2vTAdkR6IY",
  "created_at": "2024-11-12T07:38:39.222Z"
}

Authorizations

Authorization
string
header
required

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

Body

name
string
required

Name of the file to be uploaded.

Example:

"invoice_2024.pdf"

customer_id
string
required

ID of the customer to link the file to.

Example:

"cus_QalW2vTAdkR6IY"

Response

201 - application/json
id
string
required

File ID.

Example:

"fil_2QdJDDUej969ev"

name
string
required

File name.

Example:

"invoice_2024.pdf"

type
enum<string>
required

File type based on the MIME type.

Supported file types:

  • pdf: PDF documents
  • doc: Microsoft Word documents (legacy)
  • docx: Microsoft Word documents
  • xls: Microsoft Excel spreadsheets (legacy)
  • xlsx: Microsoft Excel spreadsheets
  • ppt: Microsoft PowerPoint presentations (legacy)
  • pptx: Microsoft PowerPoint presentations
  • txt: Plain text files
  • csv: Comma-separated values files
  • jpeg: JPEG images
  • png: PNG images
  • gif: GIF images
  • svg: SVG vector images
  • json: JSON data files
  • xml: XML data files
Available options:
pdf,
doc,
docx,
xls,
xlsx,
ppt,
pptx,
txt,
csv,
jpeg,
png,
gif,
svg,
json,
xml
Example:

"pdf"

mimetype
string
required

MIME type of the file.

Example:

"application/pdf"

customer_id
string | null
required

ID of the customer linked to the file.

Example:

"cus_QalW2vTAdkR6IY"

created_at
string<date-time>
required

Date when the file was created.

Example:

"2024-11-12T07:38:39.222Z"