AgentContext

Get agent context

Read the authenticated agent and authorized account. With no active account, returns null and connection next steps.

get/agent/context

Request

  • Base URL: https://plainrouter.com/api/v1
  • URL: https://plainrouter.com/api/v1/agent/context
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://plainrouter.com/oauth2/authorize, token URL https://plainrouter.com/oauth2/token, scopes: mcp:use)

Query parameters

account_idinteger

Optional positive account ID. A bound key may name only its own account; a different ID returns 422. An unbound key requires exactly one active available advertising account with an active connection; omission uses that account and a supplied ID must match it. Multiple active accounts return 422 even when account_id is supplied. With no active available account, a valid account_id is ignored and platform_ad_account is null.

workspace_idinteger

Optional workspace grant selector. Required for credentials with multiple workspace grants; it must identify an authorized workspace.

Response

Agent identity and account context.

meta_connectedboolean required
next_stepsstring[]

Present only when meta_connected is false.

Changes

No recorded changes to this operation across all 2 revisions of this API.