Skip to content
bynhDocs

Download a document

GET/workspaces/{workspace}/documents/{document}/download

Downloads a workspace document (a certificate PDF or a subprocessor DPA) as an attachment. Each download is written to the audit log.

Authentication

Send an API token as a bearer token. This endpoint needs a read token, made by any member of the workspace. Create one in My account → API tokens; see scopes and roles.

Authorization: Bearer 42|bynh_pat_•••••••Header

Path parameters

  • workspacestringRequired

    Your workspace slug, e.g. dokan.

  • documentintegerRequired

    Document id, as in a document’s download_path.

Response

200 OK

The file (Content-Type: application/pdf, Content-Disposition: attachment; filename=…, X-Content-Type-Options: nosniff). Not JSON.

Rate limits

This endpoint counts toward your general limit of 120 requests a minute. When you go over, wait for the number of seconds in Retry-After.

Errors

401The token is missing, wrong, revoked or expired.
404The token belongs to another workspace, or its owner is no longer a member. Or: No document with that id in the workspace, or its file is missing from storage (message may be empty).

Every error is JSON with a message. See Errors.

Next →Get coverage
curl -OJ "https://api.bynh.io/api/v1/workspaces/dokan/documents/1/download" \
  -H "Authorization: Bearer $BYNH_TOKEN" \
  -H "Accept: application/json"

Response200 OK

File

The file itself, with its name in Content-Disposition.

Examples use Dokan, a sample workspace. Responses are shortened where lists are long.