Skip to main content
POST
Grants one email address access to one port of a session’s live preview, and emails them the link. This is the narrowest grant in Runtm. The invitee can open that preview and nothing else — no workspace, no terminal, no prompting — and they are not added to your organization. They need a Runtm account to open it, but not before you invite them: the grant binds to their user id the first time they sign in and open the link. Paused sandboxes wake up automatically when a shared link is opened, so a share keeps working after the ~20 minute idle pause. Re-inviting an address that already has this port is a no-op and does not send a second email. Required scope: sessions:write
From the CLI: runtm-api session share create <session_id> --email [email protected] --port 3000

Path Parameters

string
required
The session ID (e.g. ses_abc123).

Headers

string
required
Bearer token. Example: Bearer runtm_xxx
string
Scope to an organization. Must match the API key’s own organization.

Body

string
required
Address to invite. Max 320 characters.
integer
required
The single port to share. Ports 22 and 2222 are rejected — they carry sandbox tooling rather than your app.
string
Optional. Only the path and query are honored — the emailed link’s host is always the server-derived preview host for this session and port, so this cannot redirect the invite elsewhere. Pass it when you need a specific path (e.g. .../index.html); omit it and the server derives the bare preview URL.

Response

object
The grant: id, port, invited_email, user_id, created_by, created_at, last_accessed_at, has_accessed.
boolean
false when the address already had this port.
boolean
Whether the invite email went out. false when the grant already existed or email delivery is not configured — send preview_url yourself in that case.
string
The link the invitee should open.