Skip to content

Create a new document

Request

Security
JWT
Bodymultipart/form-datarequired
document_namestringrequired

The name of the document

Example:"invoice"
filestring, (binary)required

The file to be uploaded. This should be sent as a binary in the multipart/form-data request.

POST
/document
curl -i -X POST \
  https://api.glomopay.com/api/v1/document \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F document_name=invoice \
  -F file=string

Responses

Document created successfully

Bodyapplication/json
idstringread-only

The unique identifier for the Document.

Example:"doc_nYUqLpuYQ0M8"
document_namestring

The name of document

Example:"invoice"
file_namestringread-only

The name of the file you uploaded.

Example:"invoice_BC8tFdE.pdf"
preview_urlstringread-only

The URL to preview the document.

Example:"https://glomopay-service-staging-documents.s3.ap-south-1.amazonaws.com/12345_invoice"
statusstringread-only

The status of file you uploaded. Values can be uploaded, approved and rejected.

Example:"uploaded"
created_atstring, (timestamp)read-only

Timestamp representing when the document was created

Example:"2021-06-01T12:00:00Z"
updated_atstring, (timestamp)read-only

Timestamp representing when the document was last updated

Example:"2021-06-01T12:00:00Z"
Response
{ "id": "doc_nYUqLpuYQ0M8", "document_name": "invoice", "file_name": "invoice_BC8tFdE.pdf", "preview_url": "https://glomopay-service-staging-documents.s3.ap-south-1.amazonaws.com/12345_invoice", "status": "uploaded", "created_at": "2021-06-01T12:00:00Z", "updated_at": "2021-06-01T12:00:00Z" }