Plane docs
API referenceEndpointsSessions

sessions.decide

POST
/v1/sessions/decide

RPC sessions.decide · Scope data

AuthorizationBearer <token>

A Plane API key, pl_<env>_…. The key is the environment: everything it reads and writes is scoped to the environment it was minted in, and the two tenancy headers are ignored for one.

In: header

Header Parameters

x-plane-environment?string

The environment slug this request is about. Honoured only for a session cookie; ignored for an API key, whose environment is its identity.

x-plane-organization?string

The organization slug or id this request is about, resolved before the environment. Honoured only for a session cookie.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/sessions/decide" \  -H "Content-Type: application/json" \  -d '{    "id": "string",    "toolCallId": "string",    "decision": "allow"  }'
{  "id": "string",  "agentId": "string",  "agentVersion": 1,  "status": "running",  "stopReason": "completed",  "createdAt": "string",  "updatedAt": "string",  "usage": {    "inputTokens": 0,    "outputTokens": 0,    "serverToolRequests": {      "property1": 0,      "property2": 0    },    "cacheReadTokens": 0,    "cacheWriteTokens": 0  },  "overrides": {    "model": {      "provider": "string",      "model": "string",      "reasoning": "none",      "fallback": {        "models": [          {            "provider": "string",            "model": "string",            "reasoning": "none"          }        ],        "on": [          "unavailable"        ],        "timeoutMs": 1      }    },    "system": {      "mode": "append",      "text": "string"    },    "compaction": {      "mode": "auto",      "thresholdPercent": 0,      "contextTokens": 1,      "reserveOutputTokens": 0,      "prompt": "string",      "model": {        "provider": "string",        "model": "string",        "reasoning": "none"      },      "keepRecentMessages": 0,      "preserve": [        "tool_results"      ],      "dropToolResultsAfterTokens": 1    },    "sandbox": {      "idleAfterMs": 1000,      "onIdle": "release",      "snapshotEveryMs": 1000,      "keepSnapshots": 0,      "resume": "snapshot",      "maxSnapshotAgeMs": 1000    }  },  "effectiveModel": {    "provider": "string",    "model": "string",    "reasoning": "none"  },  "metadata": {},  "identity": {    "scope": "string",    "id": "string",    "display": "string",    "attributes": {}  },  "pendingDecisions": 0,  "parentSessionId": "string",  "parentToolCallId": "string",  "rootSessionId": "string",  "depth": 0,  "subagentName": "string",  "spawnedByAgentVersion": 1,  "descendantUsage": {    "inputTokens": 0,    "outputTokens": 0,    "serverToolRequests": {      "property1": 0,      "property2": 0    },    "cacheReadTokens": 0,    "cacheWriteTokens": 0  },  "eventsPrunedAt": "string"}