On this page

Sandbox shares are publicly accessible URLs that give read-only access to a running sandbox. Unlike preview tokens, share URLs are not scoped to an iframe and do not require the recipient to hold any credentials.

Share tokens use the prefix ms_ followed by a base64url-encoded payload. The public URL pattern is:

https://{sandbox-id}.sandboxes.miosa.ai?ms=ms_<token>

Endpoints

MethodPathDescription
POST/api/v1/sandboxes/{id}/sharesCreate a share URL
GET/api/v1/sandboxes/{id}/sharesList active shares
DELETE/api/v1/sandboxes/{id}/shares/{share_id}Revoke a share

Create a Share

POST /api/v1/sandboxes/{id}/shares

Creates a public share link. The share_url field is safe to distribute - it contains the token as a query parameter.

Auth

Authorization: Bearer msk_...

Request Body

FieldTypeRequiredDefaultDescription
expires_inintegerNo3600TTL in seconds
scopestringNo"read"Must be "read" (only supported value)
{
  "expires_in": 86400
}

Response - 201 Created

{
  "share_id": "shr_01hx9m7n3k...",
  "share_url": "https://sbx-abc123.sandboxes.miosa.ai?ms=ms_eyJ...",
  "expires_at": "2026-05-27T12:00:00Z",
  "scope": "read"
}
FieldTypeDescription
share_idstringOpaque share identifier used to revoke
share_urlstringPublicly accessible URL with token embedded
expires_atstringISO 8601 expiry, or null for no expiry
scopestringAlways "read"

List Shares

GET /api/v1/sandboxes/{id}/shares

Returns all active (non-revoked, non-expired) shares for the sandbox.

Response - 200 OK

{
  "data": [
    {
      "share_id": "shr_01hx9m7n3k...",
      "share_url": "https://sbx-abc123.sandboxes.miosa.ai?ms=ms_eyJ...",
      "expires_at": "2026-05-27T12:00:00Z",
      "scope": "read"
    }
  ]
}

Revoke a Share

DELETE /api/v1/sandboxes/{id}/shares/{share_id}

Immediately invalidates the share. Any visitor using the share URL will receive a 403 after revocation.

Response - 204 No Content

No response body.


Errors

StatusCodeCause
404sandbox_not_foundSandbox does not exist or wrong tenant
403forbiddenTenant mismatch
404not_foundShare ID does not exist (on DELETE)
422invalid_scopescope value is not "read"

Examples

Was this helpful?