> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rasen.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rasen.ai/_mcp/server.

# Hosted test-call links

Hosted test-call links let a visitor test the agent's current live publication. They are bearer
capabilities with a seven-day lifetime and bounded usage. Keep a newly issued token secure.
Metadata reads and changes require `agents.write`; enabling and rotation also require `calls.write`.

## Read metadata

```bash
curl -sS -D - "$RASEN_API_BASE/agents/$AGENT_ID/share-link" \
  -H "Authorization: Bearer $RASEN_API_KEY"
```

The response includes enabled state, sharing eligibility, a token prefix, expiry and usage limits.
Its `token` is null: reads do not reveal the bearer. Save the ETag for the next change.

## Enable or disable

Send `{"enabled": true}` or `{"enabled": false}` to
`PUT /agents/{agent_id}/share-link` with `If-Match` and `Idempotency-Key`.
Both require `agents.write`; enabling also requires `calls.write`.

Enabling issues a new token when no valid link is active. Disabling revokes the active capability.
A newly issued token appears only in the first successful response; an idempotent replay returns
`token: null`. Store the original token when you receive it.

## Rotate

`POST /agents/{agent_id}/share-link/rotate` revokes the previous capability and issues a new bearer
for the current live publication. It requires the share-link ETag, an idempotency key, and both
`agents.write` and `calls.write`. The new token is revealed once.

After a stale revision refusal, read the metadata again and review the current live publication
before issuing another change. See [API Reference](/api-reference) for all fields and errors.