Make a link that opens a private port for a while
A share link is the port's URL with a grant signed by the cell (`?pod_share=…`), for this port only, until `expires_at`: 1 minute to 7 days, 24 hours by default.
A share link is the port's URL with a grant signed by the cell (?pod_share=…), for this port only, until expires_at: 1 minute to 7 days, 24 hours by default. Anyone holding it opens the port until then. Nothing is stored, so a link is revoked by making a new token (createPortToken) or resetting the port, which ends every link made before. Opening it gives a session cookie for the port's host, at most 12 hours and never past the link, and a redirect to the URL without the grant. Refused to all but the creator of a no_save sandbox (saves_refused).
A key with the sandboxes:write scope.
Request
curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ports/1/share-links" \
-H "Authorization: Bearer $POD_API_KEY" \
-H "Content-Type: application/json" \
-d '{"expires_in_s":86400}'Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
sandbox_id | path | string | Yes | |
port | path | integer | Yes | A TCP or UDP port number, 1 to 65535. |
Idempotency-Key | header | string | No | Makes a repeat of this call safe for 24 hours. |
Body
| Field | Type | Required | What it is |
|---|---|---|---|
expires_in_s | integer | No | 1 minute to 7 days, 24 hours by default. Default 86400. From 60 to 604800. |
Answer
201. The link.
{
"url": "https://app.example.com",
"expires_at": "2026-11-23T12:00:00.000Z"
}| Field | Type | Always | What it is |
|---|---|---|---|
url | string | Yes | The port's URL with ?pod_share=…. A secret until it expires; never logged by Pod. |
expires_at | string | Yes | RFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z. |
Errors
The refusals this call is known for: invalid, saves_refused, not_found, in_other_cell. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.
In the SDKs
| Client | Call |
|---|---|
| TypeScript | pod.ports.shareLink(sandboxId, port, { … }) |
| Python | pod.ports.share_link(sandbox_id, port, …) |