{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"PDF Report API","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"pdf-report-api","__idx":0},"children":["PDF Report API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The PDF Report API allows API clients to asynchronously generate a downloadable PDF report for a connected SQR user."," ","The flow is fully async: a job is enqueued immediately and processed in the background."," ","Once the job completes, a time-limited pre-signed download URL is issued on demand."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All three endpoints are authenticated using a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bearer token"]}," obtained from the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/oauth-token"},"children":["OAuth Token API"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-it-works","__idx":1},"children":["How It Works"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Generating a PDF report is a three-step asynchronous process:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"1. POST /v1/document/api        → Enqueue a report job (returns 202 + jobId)\n2. GET  /v1/document/api/{id}   → Poll until status is COMPLETE or FAILED\n3. GET  /v1/document/api/{id}/url → Retrieve the signed download URL\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1--create-a-report-job","__idx":2},"children":["Step 1 — Create a Report Job"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/document/api"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Submit a request to generate a PDF report for a specific user."," ","The API responds immediately with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["202 Accepted"]}," and returns a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jobId"]},"."," ","No report has been generated yet at this point; the job is placed in a processing queue."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Rate limit:"]}," Max 10 requests per 10 minutes per org."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"request","__idx":3},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Headers"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Authorization: Bearer <access_token>\nContent-Type: application/json\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Body"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"userId\": \"US1A2B3C4D5E6F78\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SQR user ID (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AppUser.id"]},") for whom the report is being generated. Must be 1–16 characters."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response--202-accepted","__idx":4},"children":["Response — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["202 Accepted"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"jobId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"status\": \"PENDING\",\n  \"userId\": \"US1A2B3C4D5E6F78\",\n  \"createdAt\": \"2025-05-05T10:00:00.000Z\",\n  \"updatedAt\": \"2025-05-05T10:00:00.000Z\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jobId"]}," — you will need it to check job status and retrieve the download URL."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2--poll-job-status","__idx":5},"children":["Step 2 — Poll Job Status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/document/api/{id}"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns the current status and metadata of the report generation job."," ","Poll this endpoint until ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," reaches a terminal state: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETE"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FAILED"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"request-1","__idx":6},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Headers"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Authorization: Bearer <access_token>\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Path parameter"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jobId"]}," returned in Step 1"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response--200-ok","__idx":7},"children":["Response — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"jobId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"status\": \"COMPLETE\",\n  \"userId\": \"US1A2B3C4D5E6F78\",\n  \"templateVersion\": \"v2\",\n  \"sizeBytes\": 204800,\n  \"sha256\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\n  \"durationMs\": 1420,\n  \"createdAt\": \"2025-05-05T10:00:00.000Z\",\n  \"updatedAt\": \"2025-05-05T10:00:02.000Z\",\n  \"completedAt\": \"2025-05-05T10:00:02.000Z\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"job-status-values","__idx":8},"children":["Job Status Values"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status"},"children":["Status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PENDING"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Job is queued and waiting to be processed"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IN_PROGRESS"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Job is currently being processed"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Report generated successfully — download URL available"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FAILED"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Report generation failed — see ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"polling-recommendation","__idx":9},"children":["Polling Recommendation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Poll at a reasonable interval to avoid unnecessary load. A recommended strategy is:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Poll every ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["3–5 seconds"]}," for the first 30 seconds."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If still not complete, back off to every ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["10–15 seconds"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treat any job that has not completed within ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["5 minutes"]}," as failed and surface an appropriate error to your user."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-3--retrieve-the-signed-download-url","__idx":10},"children":["Step 3 — Retrieve the Signed Download URL"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/document/api/{id}/url"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once the job status is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETE"]},", request a time-limited pre-signed S3 URL to download the PDF report."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The URL is valid for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["5 minutes"]}," from the time it is issued."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["RBAC and org scope are re-validated on every call — URLs are never cached server-side."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If the report is not yet complete, the API returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 Unprocessable Entity"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"request-2","__idx":11},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Headers"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Authorization: Bearer <access_token>\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Path parameter"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jobId"]}," returned in Step 1"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response--200-ok-1","__idx":12},"children":["Response — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"url\": \"https://s3.amazonaws.com/sqr-reports/...?X-Amz-Signature=...\",\n  \"expiresInSeconds\": 300,\n  \"filename\": \"SQR_J_Smith_ABCD.pdf\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Pre-signed S3 download URL, valid for 5 minutes"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiresInSeconds"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL TTL in seconds (always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["300"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filename"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Suggested filename to use when saving the PDF"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}," value to initiate a direct download from S3. The URL will expire after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiresInSeconds"]}," seconds and cannot be re-used."," ","If you need to allow another download after expiry, simply call this endpoint again to receive a fresh URL."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-reference","__idx":13},"children":["Error Reference"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status Code"},"children":["Status Code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing or invalid Bearer token. Obtain a new token via the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/oauth-token"},"children":["OAuth Token API"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Forbidden. The authenticated org does not have permission to access this user's report."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The specified ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}," (Step 1) or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["jobId"]}," (Steps 2–3) was not found."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["409"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A pending job already exists for this user. Wait for it to complete before creating a new one."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The report job is not yet complete (Step 3 only). Continue polling Step 2."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Rate limit exceeded. Maximum 10 requests per 10 minutes per org (Step 1 only)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["5XX"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Internal server error. Contact ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"mailto:support@sqr.id"},"children":["support@sqr.id"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"full-example-flow","__idx":14},"children":["Full Example Flow"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"# Step 1 — Create the job\nPOST /v1/document/api\nHost: api.sqr-group.com\nAuthorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\nContent-Type: application/json\n\n{\n  \"userId\": \"US1A2B3C4D5E6F78\"\n}\n\n# → 202 Accepted\n# {\n#   \"jobId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n#   \"status\": \"PENDING\",\n#   ...\n# }\n\n---\n\n# Step 2 — Poll until COMPLETE\nGET /v1/document/api/3fa85f64-5717-4562-b3fc-2c963f66afa6\nHost: api.sqr-group.com\nAuthorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\n\n# → 200 OK\n# {\n#   \"jobId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n#   \"status\": \"COMPLETE\",\n#   ...\n# }\n\n---\n\n# Step 3 — Get the download URL\nGET /v1/document/api/3fa85f64-5717-4562-b3fc-2c963f66afa6/url\nHost: api.sqr-group.com\nAuthorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\n\n# → 200 OK\n# {\n#   \"url\": \"https://s3.amazonaws.com/...\",\n#   \"expiresInSeconds\": 300,\n#   \"filename\": \"SQR_J_Smith_ABCD.pdf\"\n# }\n","lang":"http"},"children":[]}]},"headings":[{"value":"PDF Report API","id":"pdf-report-api","depth":1},{"value":"How It Works","id":"how-it-works","depth":2},{"value":"Step 1 — Create a Report Job","id":"step-1--create-a-report-job","depth":3},{"value":"Request","id":"request","depth":4},{"value":"Response — 202 Accepted","id":"response--202-accepted","depth":4},{"value":"Step 2 — Poll Job Status","id":"step-2--poll-job-status","depth":3},{"value":"Request","id":"request-1","depth":4},{"value":"Response — 200 OK","id":"response--200-ok","depth":4},{"value":"Job Status Values","id":"job-status-values","depth":4},{"value":"Polling Recommendation","id":"polling-recommendation","depth":4},{"value":"Step 3 — Retrieve the Signed Download URL","id":"step-3--retrieve-the-signed-download-url","depth":3},{"value":"Request","id":"request-2","depth":4},{"value":"Response — 200 OK","id":"response--200-ok-1","depth":4},{"value":"Error Reference","id":"error-reference","depth":2},{"value":"Full Example Flow","id":"full-example-flow","depth":2}],"frontmatter":{"seo":{"title":"PDF Report API"}},"lastModified":"2026-05-05T11:14:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/pdf-report","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}