Upload document

Endpoint

post
https://app.paksign.pk/api/documents/upload

Overview

Uploading a document and preparing for sending is very simple.

You make a POST request with multipart/form-data to the endpoint above with your file and workspaceId and get Asset[] in response. The returned data will be important for the send document flow.

Limits

  • Allowed types PDF
  • Max size 10MB

Request

FieldDescriptionTypeRequired
fileYour documentFileYes
workspaceIdYour workspace idstringYes

Response

FieldDescriptionType
filesArray of Asset, one for every page of your documentAsset[]
slugUnique slug for your documentstring
sourceSource asset keystring

Example

This example is written in TypeScript and assumes you're using axios.

upload-document.ts

// create payload
const payload = new FormData()
payload.append('file', file) // your PDF document
payload.append('workspaceId', String(1234)) // your workspace id
// send the request
const { data } = await axios.request<Response>({
url: '/api/documents/upload',
method: 'post',
data: payload,
headers: {
Authorization: 'Key YOUR_API_KEY',
},
})