---
title: "Request a presigned URL to upload a policy PDF"
method: POST
path: "/v1/policies/{id}/pdf/upload-url"
tags: ["Policies"]
---

# Request a presigned URL to upload a policy PDF

`POST /v1/policies/{id}/pdf/upload-url`

Generates a presigned S3 URL for uploading a policy PDF directly to storage. Use this when attaching a PDF to a compliance policy — the file bytes are uploaded straight to S3 without passing through the API. Requires the policy ID; if you only know the policy name, look it up first via the list-compliance-policies tool. After uploading the file to the returned URL, finalize the attachment by calling confirm-policy-pdf-uploaded with the same s3Key.

## Path parameters

- `id` string, required

## Headers

- `X-Organization-Id` string

## Request body

- RequestPolicyPdfUploadUrlDto
  - `versionId` string — Optional version ID to attach the PDF to. Omit to attach the PDF at the policy level (legacy path).
  - `fileName` string, required — Filename of the PDF (e.g., "policy-v1.pdf"). Non-alphanumeric characters will be replaced with underscores when storing in S3.
  - `fileType` string, required — MIME type of the file. Must be "application/pdf" — the presigned URL enforces this at upload time.

## Response `201`

- PolicyPdfUploadUrlResponseDto
  - `uploadUrl` string, required — Presigned S3 URL. PUT the raw file bytes to this URL with header `Content-Type: application/pdf`. No auth headers required — the signature is in the URL.
  - `s3Key` string, required — The S3 key the file will land at. Pass this back to the confirm endpoint after a successful upload.
  - `expiresIn` number, required — Seconds until the presigned URL expires.

---

[API](https://skmtc.net/trycompai/apis/comp-ai-api.md) · [All operations](https://skmtc.net/trycompai/apis/comp-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trycompai/comp-ai-api/revisions/726b9523fb22/schema)
