---
title: "Mint Share Link"
method: POST
path: "/api/agents/{agent_id}/share-links"
tags: ["agent-urls"]
---

# Mint Share Link

`POST /api/agents/{agent_id}/share-links`

## Request

- Base URL: `https://api.maritime.sh` (the document declares no server; this is the origin it was published from)
- URL: `https://api.maritime.sh/api/agents/{agent_id}/share-links`
- Auth: HTTP bearer

Mints a shared link. 422 on a bad ``ttlSeconds``, 404 or 409 on the end user, 409 at the live-link cap.

## Path parameters

- `agent_id` string, required

## Request body

- ShareLinkCreate: Body of ``POST /api/agents/{id}/share-links``. ``ttl_seconds`` absent means the default lifetime; explicitly null means the link never expires. Callers tell the two apart through ``model_fields_set``.
  - `ttlSeconds` integer, nullable
  - `endUserExternalId` string, nullable

## Response `201`

Successful Response

- MintedLinkResponse: The only response that carries a link secret, inside ``url``.
  - `id` string, required
  - `url` string, required
  - `expiresAt` string, date-time, nullable, required

## Other responses

- `422`: Validation Error

---

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