Document Operations

Add an attachment to a document

Changed on

<small>Requires an API token with the Document Manager role.</small>

Adds a previously uploaded file as an attachment to the document referred to by the URL.

This endpoint requires a three-step upload process:

  1. Generate upload URL: Call the Create document attachment upload URL endpoint to get a presigned upload URL
  2. Upload file: Make a POST request to the returned URL with the specified form fields, followed by the file contents in a file field
  3. Add the uploaded file to the document: Call this endpoint with file_upload_uuid set to the uuid received in step 1

Attachments can only be added while the document's content can still be changed. A 409 response is returned if, for example, the document is archived, approved, in signing or bound by a preemptive signature, or if the file type of the uploaded file is not supported.

For a complete guide with examples, see How to add an attachment to a document.

Not to be confused with a document's file storage, which holds internal working files that are not part of the signed document.

post/documents/{document}/attachments

Request

  • Base URL
    https://app.fynk.com/v1/api
  • URL
    https://app.fynk.com/v1/api/documents/{document}/attachments
  • Auth
    HTTP bearer

Path parameters

documentstring required

The document UUID

Request body

file_upload_uuidstring uuid required

The UUID received in the Create document attachment upload URL response

file_namestring required

The name of the attachment

Example request

{
  "file_upload_uuid": "d16017e0-f60d-45b6-98cf-b1f41d0747fa",
  "file_name": "Appendix_A.pdf"
}

Response

AttachmentMinimalResource

Example response

{
  "data": {
    "uuid": "c3f8ca57-b1a4-4560-b3fe-5f3fffb333dd",
    "sha256": "697651f6ceea8a931289ff64cb62f78ceea5d36f7e84590fe9d5920b2dce52cf",
    "file_name": "Appendix_A.pdf",
    "file_size": 544600,
    "mime_type": "application/pdf"
  }
}

Changes