provider agent_platformagent_applications POST
/api/projects/{project_id}/agent_applications/{id}/preview-token/ @utdk/posthog
/api/projects/{project_id}/agent_applications/{id}/preview-token/ agent_applications_preview_token_mint
Mint a short-lived JWT for talking to a non-live revision
directly via the public ingress URL. The caller attaches it as
the `x-agent-preview-token` header (or `?preview_token=` query
param for `EventSource`). See `_mint_preview_jwt` for the
payload + claim binding.
The response also includes `endpoints`, `auth`, and
`preview_proxy` blocks so the caller can wire a preview
invocation without grepping the agent-ingress source for which
path each trigger exposes or which header name carries the
token. This is the "self-describing" half of preview-mode —
every piece of info you need to hit ingress is in one response.
POST is the canonical verb — minting credentials for downstream
`run`/`send`/`cancel` is a write-class capability. A GET sibling
exists at the same URL for `EventSource` callers (which can't set
headers); it is also write-scoped, since it returns the same token.
- id path required
- A UUID string identifying this agent application.
- string
- project_id path required
- Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
- string
- revision_id query required
- Target draft revision. Must belong to this application and not be live.
- string
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.agentApplicationsPreviewTokenMint()