Developers5 min read

Document Requests API

The document request endpoints let a script, an automation tool or an AI agent send a request, see who has sent what, remind people and react to new uploads, with the same rules as the website.

Before you start

  • Your plan needs both API access and document requests. The Pricing page shows both per plan.
  • In Account → API Keys, give the key what it needs: View document requests, Send and manage document requests, View contacts or Add contacts. Send and manage includes view, and Add contacts includes View contacts.
  • Keys made before you could choose keep Conversions only. Use Edit access to add more without making a new key.
  • A key works in the workspace it was made in, as the person who made it: the same requests, folders, templates and contacts, the same plan limits and the same daily email allowance as the website.

Endpoints

Every request takes the key in the X-Api-Key header, as described in the API Reference.

  • GET /api/v1/document-requests lists requests. Filter with status (draft, open, completed, cancelled or expired), folderId, contactId or q, and page with page and limit.
  • GET /api/v1/document-requests/{id} returns one request with its recipients and the status of each item for each recipient.
  • POST /api/v1/document-requests creates a request. Pass templateId to start from a template, or items of your own, plus folderId and recipients. Set send to true to send it at once; otherwise it stays a draft.
  • POST /api/v1/document-requests/{id}/remind reminds one recipient (recipientId) or, without one, everyone who still owes something.
  • POST /api/v1/document-requests/{id}/cancel cancels the request. Its links stop working; files already sent stay in their folders.
  • GET /api/v1/document-request-templates lists your templates.
  • GET /api/v1/folders lists the folders a request's files can go to (the folderId to send when creating one).
  • GET /api/v1/contacts lists contacts (q, page, limit). POST /api/v1/contacts adds one from firstName, lastName or name, email and the other contact fields.
  • GET /api/v1/document-request-events is the events feed, below.

Creating and sending a request

  1. 1

    Pick the folder the files should go to with GET /api/v1/folders.

  2. 2

    Optionally pick a template with GET /api/v1/document-request-templates.

  3. 3

    POST /api/v1/document-requests with a body such as {"templateId": "…", "folderId": "…", "recipients": [{"name": "Sam Lee", "email": "sam@example.com"}], "send": true}.

  4. 4

    Each recipient gets the request email with their own link. Use a contact instead of a name and email with {"contactId": "…"}.

The events feed

Without after, GET /api/v1/document-request-events returns the latest events, newest first, which is what a polling trigger needs. With after set to an event id, it returns the events since that one, oldest first: keep passing nextCursor while hasMore is true.

Each event has an id, a type, createdAt, the request (id, title, status), the recipient (id, name, email, contactId, status) and, for item events, the item (id, label).

  • Types: request.sent, request.completed, request.cancelled, recipient.viewed, recipient.reminded, recipient.completed, recipient.opted_out, item.submitted and item.other_uploaded.
  • Filter with types, a comma-separated list, and set limit (up to 100, default 50).
  • Events of requests the key can't see, or of deleted requests, aren't included.

Limits and errors

  • These endpoints share one limit per account: 60 requests a minute and 600 an hour. A 429 response carries Retry-After.
  • Reminders follow the website's rules: at most one manual reminder a day per person, within your plan's daily email allowance.
  • 403: the key lacks the access the endpoint needs, or your plan doesn't include document requests or API access.
  • 404: no request, template, folder or contact with that id in the key's workspace.
  • 409: the request is already closed, or nobody on it can be reminded right now.
  • 422: a missing or invalid field; the message names it.

Common questions

Do my existing API keys change?

No. They keep converting files exactly as before and can't reach document requests until you give them that access in Account → API Keys.

Is there a push notification when someone uploads?

Not for document requests yet. Poll the events feed: without after it returns the newest events first, so a client can remember the last id it handled.

Can the API approve or reject uploaded documents?

Not yet. Review happens on the request's page in FlexFiles; the API creates, tracks, reminds and cancels.