Agent

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
DELETE
GET
GET

List all agent applications users

List this agent's end-users (the stable identities behind inbound principals) and each user's linked external connections. Connection metadata only — credential material is never returned.

Required API key scopes

agents:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/agent_applications/:id/users
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/agent_applications/:id/users/

Example response

Status 200
RESPONSE
{
"count": 0,
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"principal_kind": "string",
"principal_id": "string",
"metadata": null,
"created_at": "2019-08-24T14:15:22Z",
"connections": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "string",
"scopes": [
"string"
],
"state": "string",
"subject": "string",
"access_expires_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"revoked_at": "2019-08-24T14:15:22Z"
}
]
}
]
}

Delete agent applications users connection

Revoke one of an end-user's linked connections. The credential is marked revoked (kept for audit), so the agent can no longer act as that user on the provider.

Required API key scopes

agents:write

Path parameters

  • agent_user_id
    string
  • id
    string
  • provider
    string

Example request

DELETE /api/projects/:project_id/agent_applications/:id/users/:agent_user_id/connections/:provider
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/agent_applications/:id/users/:agent_user_id/connections/:provider/

Example response

Status 204 No response body

Retrieve agent applications

Served-model catalog — each model's id, provider, context window, and USD-per-million-token pricing — plus the curated auto-level → model map. Project-agnostic; sourced from the AI gateway catalog. Powers the config UI model browser and the agent builder's model-choosing skill.

Required API key scopes

agents:read

Response


Example request

GET /api/projects/:project_id/agent_applications/models
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/agent_applications/models/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"name": "string",
"slug": "string",
"description": "string",
"live_revision": "067b8498-180d-45ba-92a8-76a49fa0e492",
"archived": true,
"archived_at": "2019-08-24T14:15:22Z",
"created_by_id": 0,
"created_by": {
"id": 0,
"first_name": "string",
"email": "user@example.com"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"slack_events_url": "http://example.com",
"slack_interactivity_url": "http://example.com",
"ingress_base_url": "http://example.com"
}

Retrieve agent applications spec

The canonical JSON Schema for an agent spec — every field, type, enum, default, and the discriminated unions for models / triggers[] / tools[], each with an inline description. Emitted from the same source the runner validates against (fields with a default are optional on write), so read it BEFORE composing a spec for create / revisions-spec-update instead of guessing the shape. Pass section to fetch just one part.

Required API key scopes

agents:read

Query parameters

  • section
    string

Response


Example request

GET /api/projects/:project_id/agent_applications/spec_schema
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/agent_applications/spec_schema/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"team_id": 0,
"name": "string",
"slug": "string",
"description": "string",
"live_revision": "067b8498-180d-45ba-92a8-76a49fa0e492",
"archived": true,
"archived_at": "2019-08-24T14:15:22Z",
"created_by_id": 0,
"created_by": {
"id": 0,
"first_name": "string",
"email": "user@example.com"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"slack_events_url": "http://example.com",
"slack_interactivity_url": "http://example.com",
"ingress_base_url": "http://example.com"
}

Community questions