POST /v1/apps/{app}/hosts/link
A link that opens address label (the application's own label when left out) for ttl_s seconds (7 days by default, at most 90). The first visit with it sets a cookie that keeps the visitor in for 30 days. rotate: true first replaces the application's link secret: every link and every visitor's cookie of all its addresses stops working within 6 seconds; streams already open can run up to an hour. Off by default: the platform.app_hosts flag must be on for your organization, or your organization must hold a serving address; without either this answers 404 feature_not_enabled (and b3os apply keeps each port's preview URL). 503 flags_unavailable when that cannot be read.

Authentication

Bearer Token (b3os_sk_ API key or b3os_pat_ token)

Path Parameters

app string required path
The application's name (name in its b3os.yaml).
Min length 1Max length 63Pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$
Example: "research-agent"

Request Body required

application/json
label string
An address's label, the part before .b3os.io.
Min length 1Max length 63Pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$
ttl_s integer
Default 604800Min 60Max 7776000
rotate boolean
Replace the application's link secret first; every link and visitor cookie stops working within 6 seconds (streams already open can run up to an hour).
Default false

Responses

200 The link.
application/json
object string REQUIRED
Values app_link
label string REQUIRED
An address's label, the part before .b3os.io.
url string (uri) REQUIRED
https://<label>.b3os.io/?b3os_link=<token>. Share it as a secret.
expires_at string (date-time) REQUIRED
rotated boolean REQUIRED
400 The request failed validation (invalid_request, invalid_url).
401 Missing, malformed, expired or revoked credentials (unauthorized).
403 Authenticated but not allowed (forbidden, egress_denied).
404 No such address in your project and application (app_host_not_found), or addresses are not on for your organization (feature_not_enabled: the platform.app_hosts flag).
413 The request body exceeds this operation's limit.
415 The Content-Type is not accepted by this operation.
429 A rate, concurrency or quota limit applies (rate_limited, concurrency_limited, quota_exceeded).
500 Something failed inside B3OS (internal). Retry with backoff.
503 B3OS could not read whether addresses are on for your organization (flags_unavailable: the flag platform.app_hosts, or whether your organization holds a serving address). Nothing was read or changed; retry after Retry-After seconds. A caller must not read this as "no addresses".
curl -X POST 'https://beta-api.b3os.org/v1/apps/research-agent/hosts/link' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'Content-Type: application/json' \  -d '{  "ttl_s": 604800}'
const response = await fetch('https://beta-api.b3os.org/v1/apps/research-agent/hosts/link', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json"  },  body: JSON.stringify({    "ttl_s": 604800  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://beta-api.b3os.org/v1/apps/research-agent/hosts/link', headers=headers, json={  "ttl_s": 604800})print(response.json())
200 Response
{  "object": "app_link",  "label": "gpt-researcher",  "url": "https://gpt-researcher.b3os.io/?b3os_link=1793559600.tkpzITp82v4g4n1XTYdDSxBWFIrwpU4EX1Dq3WVP4z8",  "expires_at": "2026-11-01T19:00:00.000Z",  "rotated": false}
Ask a question... ⌘I