Create document PDF upload URL
create-document-pdf-upload-urlCreate a signed URL that a single PDF can be POST-uploaded to, for later use with create-document-from-pdf-upload.
Use this tool when:
The user wants to create a document from an existing PDF file and you need somewhere to upload it to first
The upload is an HTTP request you send yourself. If you cannot send HTTP requests with the file's contents, do not call this tool; ask the user to upload the PDF in the fynk app instead.
Call it once per PDF: each URL accepts exactly one file of up to 30 MB, and stops working at expires_at, a few minutes after it was issued.
Upload with a multipart/form-data POST to url that sends every entry of fields as a form field with its value unchanged, followed by the PDF as a final field named file; S3 ignores any field sent after the file. Only a 204 response means the upload succeeded, so check the status before calling create-document-from-pdf-upload, and request a new URL to retry a failed upload. With curl, send the fields with --form-string, since -F reads a value starting with @ or < as a file reference:
curl -w "%{http_code}\n" -X POST "<url>" \
--form-string "key=<fields.key>" \
--form-string "<each other entry of fields>=<its value>" \
-F "file=@/path/to/contract.pdf;type=application/pdf"curl reads ; and , in that file path as separators, so wrap a path containing either in escaped double quotes (-F "file=@\"/path/to/a;b.pdf\";type=application/pdf").
Then pass file_upload_uuid to create-document-from-pdf-upload.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "create-document-pdf-upload-url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Perform a multipart/form-data POST request to this URL to upload the PDF | |
| fields | No | Form fields to send unchanged in the POST body, before a final "file" field holding the PDF contents. Its `key` is a storage path, not the upload uuid | |
| expires_at | No | When the URL stops being usable | |
| file_upload_uuid | No | Pass as `file_upload_uuid` to create-document-from-pdf-upload once the upload to `url` has succeeded |