---
title: "Mint a public share token for a file"
method: POST
path: "/api/workspaces/{slug}/files/{fileId}/share"
tags: ["Files"]
---

# Mint a public share token for a file

`POST /api/workspaces/{slug}/files/{fileId}/share`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/workspaces/{slug}/files/{fileId}/share`
- Auth: HTTP bearer

Returns a public URL anyone can open (no auth) to view + download the file. Token is 32 random bytes (~256 bits of entropy). Editor role required.

## Path parameters

- `slug` string, required
- `fileId` string, required

## Response `200`

Share URL

- object
  - `id` string, required
  - `url` string, required
  - `createdAt` string, date-time, required

## Other responses

- `404`: File not found

## Changes

- **2026-11-05** `767beae124a8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/trydock/apis/dock-rest-api/changes/api/workspaces/:slug/files/:fileId/share/post.md)

---

[API](https://skmtc.dev/trydock/apis/dock-rest-api.md) - [All operations](https://skmtc.dev/trydock/apis/dock-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trydock/apis/dock-rest-api/revisions/dd96ae96a412?raw)
