---
title: "generatePublicLink"
method: POST
path: "/v1/files/{id}/public/links"
tags: ["Public Links"]
---

# generatePublicLink

`POST /v1/files/{id}/public/links`

Generate a public link to share a private file externally.

The generated link:
- Is permanent until explicitly revoked
- Includes the filename for user-friendly URLs
- Does not require authentication to access
- Redirects to a signed download URL when accessed

**Use case:** Share invoices, contracts, or documents with external parties who don't have epilot accounts.

## Path parameters

- `id` union, required
  - string — Empty string (used when file ID not yet assigned)
  - string, uuid — Valid UUID v4

## Response `201`

Public link generated successfully

- string — The public URL that can be shared externally

## Other responses

- `401` — Authentication required or invalid credentials
- `403` — Insufficient permissions to access the resource
- `404` — The requested resource was not found
- `500` — An unexpected error occurred on the server

---

[API](https://skmtc.net/epilot/apis/file-api.md) · [All operations](https://skmtc.net/epilot/apis/file-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/epilot/file-api/revisions/e4fee5bc1196/schema)
