> ISPO SDK documentation. [HTML](https://ispo.ai/docs/interfaces/core.AgentSessionsApi.html) · [Documentation index](https://ispo.ai/docs/llms.txt)

# Interface AgentSessionsApi

Compact reflected metadata plus explicitly granted driven-session control. Permission decisions remain host-owned and intentionally have no SDK method.

```typescript
interface AgentSessionsApi {
    cancel(
        input: AgentSessionCancelInput,
    ): Promise<AgentSessionCancelResult>;
    create(input: AgentSessionCreateInput): Promise<AgentSessionCreateResult>;
    events(input: AgentSessionEventsInput): Promise<AgentSessionEventsResult>;
    get(input: AgentSessionGetInput): Promise<AgentSessionState>;
    listControlled(): Promise<AgentSessionControlledListResult>;
    query(input?: AgentSessionQuery): Promise<AgentSession[]>;
    resume(input: AgentSessionResumeInput): Promise<AgentSessionState>;
    send(input: AgentSessionSendInput): Promise<AgentSessionState>;
    subscribe(
        input: AgentSessionQuery | undefined,
        onChange: AgentSessionsChangeHandler,
        onError?: AgentSessionsErrorHandler,
    ): EntitySubscription;
}
```

Types: [cancel](#cancel-1), [AgentSessionCancelInput](core.AgentSessionCancelInput.md), [AgentSessionCancelResult](core.AgentSessionCancelResult.md), [create](#create-1), [AgentSessionCreateInput](core.AgentSessionCreateInput.md), [AgentSessionCreateResult](core.AgentSessionCreateResult.md), [events](#events-1), [AgentSessionEventsInput](core.AgentSessionEventsInput.md), [AgentSessionEventsResult](core.AgentSessionEventsResult.md), [get](#get-1), [AgentSessionGetInput](core.AgentSessionGetInput.md), [AgentSessionState](core.AgentSessionState.md), [listControlled](#listcontrolled-1), [AgentSessionControlledListResult](core.AgentSessionControlledListResult.md), [query](#query-1), [AgentSessionQuery](core.AgentSessionQuery.md), [AgentSession](../types/core.AgentSession.md), [resume](#resume-1), [AgentSessionResumeInput](core.AgentSessionResumeInput.md), [send](#send-1), [AgentSessionSendInput](core.AgentSessionSendInput.md), [subscribe](#subscribe-1), [AgentSessionsChangeHandler](../types/core.AgentSessionsChangeHandler.md), [AgentSessionsErrorHandler](../types/core.AgentSessionsErrorHandler.md), [EntitySubscription](core.EntitySubscription.md)

##### Index

### <a id="methods"></a>Methods

[cancel](#cancel) [create](#create) [events](#events) [get](#get) [listControlled](#listcontrolled) [query](#query) [resume](#resume) [send](#send) [subscribe](#subscribe)

## <a id="methods-1"></a>Methods

### <a id="cancel"></a>cancel

*   <a id="cancel-1"></a>
    
    ```typescript
    cancel(input: AgentSessionCancelInput): Promise<AgentSessionCancelResult>
    ```
    
    Types: [AgentSessionCancelInput](core.AgentSessionCancelInput.md), [AgentSessionCancelResult](core.AgentSessionCancelResult.md)
    
    #### Parameters
    
    *   input: [AgentSessionCancelInput](core.AgentSessionCancelInput.md)
    
    #### Returns Promise<[AgentSessionCancelResult](core.AgentSessionCancelResult.md)\>
    

**Authority for `agent.sessions.cancel`**

Reviewed request token: `agent.sessionControl`. Standing capability: `agent.sessionControl`.

Handle structured `ProjectRpcError` failures. A timeout does not guarantee cancellation; do not automatically retry effects without a documented idempotency contract. [Method authority and recovery](/docs/documents/Method_authority.md).

### <a id="create"></a>create

*   <a id="create-1"></a>
    
    ```typescript
    create(input: AgentSessionCreateInput): Promise<AgentSessionCreateResult>
    ```
    
    Types: [AgentSessionCreateInput](core.AgentSessionCreateInput.md), [AgentSessionCreateResult](core.AgentSessionCreateResult.md)
    
    #### Parameters
    
    *   input: [AgentSessionCreateInput](core.AgentSessionCreateInput.md)
    
    #### Returns Promise<[AgentSessionCreateResult](core.AgentSessionCreateResult.md)\>
    

**Authority for `agent.sessions.create`**

Reviewed request token: `agent.sessionControl`. Authority depends on the arguments, resource, and caller; check the live capability surface.

Handle structured `ProjectRpcError` failures. A timeout does not guarantee cancellation; do not automatically retry effects without a documented idempotency contract. [Method authority and recovery](/docs/documents/Method_authority.md).

### <a id="events"></a>events

*   <a id="events-1"></a>
    
    ```typescript
    events(input: AgentSessionEventsInput): Promise<AgentSessionEventsResult>
    ```
    
    Types: [AgentSessionEventsInput](core.AgentSessionEventsInput.md), [AgentSessionEventsResult](core.AgentSessionEventsResult.md)
    
    #### Parameters
    
    *   input: [AgentSessionEventsInput](core.AgentSessionEventsInput.md)
    
    #### Returns Promise<[AgentSessionEventsResult](core.AgentSessionEventsResult.md)\>
    

**Authority for `agent.sessions.events`**

Reviewed request token: `agent.sessionRead`. Standing capability: `agent.sessionRead`.

Handle structured `ProjectRpcError` failures. A timeout does not guarantee cancellation; do not automatically retry effects without a documented idempotency contract. [Method authority and recovery](/docs/documents/Method_authority.md).

### <a id="get"></a>get

*   <a id="get-1"></a>
    
    ```typescript
    get(input: AgentSessionGetInput): Promise<AgentSessionState>
    ```
    
    Types: [AgentSessionGetInput](core.AgentSessionGetInput.md), [AgentSessionState](core.AgentSessionState.md)
    
    #### Parameters
    
    *   input: [AgentSessionGetInput](core.AgentSessionGetInput.md)
    
    #### Returns Promise<[AgentSessionState](core.AgentSessionState.md)\>
    

**Authority for `agent.sessions.get`**

Reviewed request token: `agent.sessionRead`. Standing capability: `agent.sessionRead`.

Handle structured `ProjectRpcError` failures. A timeout does not guarantee cancellation; do not automatically retry effects without a documented idempotency contract. [Method authority and recovery](/docs/documents/Method_authority.md).

### <a id="listcontrolled"></a>listControlled

*   <a id="listcontrolled-1"></a>
    
    ```typescript
    listControlled(): Promise<AgentSessionControlledListResult>
    ```
    
    Types: [AgentSessionControlledListResult](core.AgentSessionControlledListResult.md)
    
    List only protected bindings whose controller is the authenticated caller. Main caps the result and rechecks each target relationship.
    
    #### Returns Promise<[AgentSessionControlledListResult](core.AgentSessionControlledListResult.md)\>
    

**Authority for `agent.sessions.listControlled`**

Reviewed request token: `agent.sessionRead`. Standing capability: `agent.sessionRead`.

Handle structured `ProjectRpcError` failures. A timeout does not guarantee cancellation; do not automatically retry effects without a documented idempotency contract. [Method authority and recovery](/docs/documents/Method_authority.md).

### <a id="query"></a>query

*   <a id="query-1"></a>
    
    ```typescript
    query(input?: AgentSessionQuery): Promise<AgentSession[]>
    ```
    
    Types: [AgentSessionQuery](core.AgentSessionQuery.md), [AgentSession](../types/core.AgentSession.md)
    
    #### Parameters
    
    *   `Optional`input: [AgentSessionQuery](core.AgentSessionQuery.md)
    
    #### Returns Promise<[AgentSession](../types/core.AgentSession.md)\[\]\>
    

### <a id="resume"></a>resume

*   <a id="resume-1"></a>
    
    ```typescript
    resume(input: AgentSessionResumeInput): Promise<AgentSessionState>
    ```
    
    Types: [AgentSessionResumeInput](core.AgentSessionResumeInput.md), [AgentSessionState](core.AgentSessionState.md)
    
    #### Parameters
    
    *   input: [AgentSessionResumeInput](core.AgentSessionResumeInput.md)
    
    #### Returns Promise<[AgentSessionState](core.AgentSessionState.md)\>
    

**Authority for `agent.sessions.resume`**

Reviewed request token: `agent.sessionControl`. Standing capability: `agent.sessionControl`.

Handle structured `ProjectRpcError` failures. A timeout does not guarantee cancellation; do not automatically retry effects without a documented idempotency contract. [Method authority and recovery](/docs/documents/Method_authority.md).

### <a id="send"></a>send

*   <a id="send-1"></a>
    
    ```typescript
    send(input: AgentSessionSendInput): Promise<AgentSessionState>
    ```
    
    Types: [AgentSessionSendInput](core.AgentSessionSendInput.md), [AgentSessionState](core.AgentSessionState.md)
    
    #### Parameters
    
    *   input: [AgentSessionSendInput](core.AgentSessionSendInput.md)
    
    #### Returns Promise<[AgentSessionState](core.AgentSessionState.md)\>
    

**Authority for `agent.sessions.send`**

Reviewed request token: `agent.sessionControl`. Standing capability: `agent.sessionControl`.

Handle structured `ProjectRpcError` failures. A timeout does not guarantee cancellation; do not automatically retry effects without a documented idempotency contract. [Method authority and recovery](/docs/documents/Method_authority.md).

### <a id="subscribe"></a>subscribe

*   <a id="subscribe-1"></a>
    
    ```typescript
    subscribe(
        input: AgentSessionQuery | undefined,
        onChange: AgentSessionsChangeHandler,
        onError?: AgentSessionsErrorHandler,
    ): EntitySubscription
    ```
    
    Types: [AgentSessionQuery](core.AgentSessionQuery.md), [AgentSessionsChangeHandler](../types/core.AgentSessionsChangeHandler.md), [AgentSessionsErrorHandler](../types/core.AgentSessionsErrorHandler.md), [EntitySubscription](core.EntitySubscription.md)
    
    #### Parameters
    
    *   input: [AgentSessionQuery](core.AgentSessionQuery.md) | undefined
    *   onChange: [AgentSessionsChangeHandler](../types/core.AgentSessionsChangeHandler.md)
    *   `Optional`onError: [AgentSessionsErrorHandler](../types/core.AgentSessionsErrorHandler.md)
    
    #### Returns [EntitySubscription](core.EntitySubscription.md)
