Skip to main content
POST
/
files
/
upload
Upload
curl --request POST \
  --url https://sandbox.syngrafii.com/api/v1/files/upload \
  --header 'api_key: <api-key>'
{
  "files": [
    {
      "fileId": "<string>",
      "externalId": "<string>",
      "fileName": "<string>",
      "isInvalid": true,
      "isConverted": true,
      "isNotSupported": true,
      "isPasswordProtected": true,
      "error": "<string>",
      "message": "<string>",
      "type": "<string>"
    }
  ]
}
Upload one or more files to be signed. Save the returned fileId or externalId for use in future API requests.
Post the raw file (do not convert to base64) with a Content-Type of application/pdf for PDF or application/octet-stream for DOCX.
You must add a Content-Disposition header with the filename to allow any of the supported file conversions to PDF.

Request

Request
POST /files/upload
Content-Type: multipart/form-data

Content-Disposition: form-data; filename="document.pdf"
Content-Type: application/pdf

<FILE_CONTENTS>

Query parameters

type
string
default:"temporary"
ValueDescription
temporaryThe file will be stored temporarily and deleted if not added to a package within 24 hours.
externalId
string
Provide an external ID that can be used to reference the file.This externalId will be stored with the document during packages/add request. It will then be included in future:
  • packages/status requests
  • document webhook events
If a user replaces a document after the package was created the externalId will no longer be associated with the document.

Response

files
object[]
List of uploaded files with their statuses.

Errors

PDF Error: PDF header not found.If a PDF Error: PDF header not found. error is returned, make sure you are sending the file as binary data.

Notes

Encoding filename using UTF-8Replace filename (ISO-8859-1) in Content-Disposition header with filename*=UTF-8”
  • Place two separate single quotes after the UTF-8, not one double quote.
  • You must URL Encode the filename to escape the UTF-8 characters and any whitespaces.
  • Do not wrap the encoded filename with double quotes.
  • Do not add a semicolon after the encoded filename.
Examplerésumé.pdf filename*=UTF-8''r%C3%A9sum%C3%A9.pdfFor more information, refer to RFC 5987