> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackshift.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Connected Agents API

> What an agent connected to a StackShift account can do with its own connection credential: read its identity and access, propose changes, wait for the owner's approval, read its plan, facts and history, and lower its approval level.

What an agent connected to a StackShift account can do with its own connection credential: read its identity and access, propose changes, wait for the owner's approval, read its plan, facts and history, and lower its approval level. Base URL: `https://api.stackshift.cloud/api/v1`

Authentication: `bearer`. SDK-backed operations are traced to official source files in the coverage report. Routes without an SDK wrapper are explicitly marked contract-only.

| Method | SDK route | SDK method | Request type | Response type |
| - | - | - | - | - |
| `GET` | `/agents/connections/identity` | `AgentConnectionsClient.identity` | `None` | `AgentConnectionIdentity` |
| `GET` | `/agents/connections/resources` | `AgentConnectionsClient.resources` | `None` | `AgentConnectionResourcePage` |
| `GET` | `/agents/connections/capabilities` | `AgentConnectionsClient.capabilities` | `None` | `AgentConnectionCapability[]` |
| `GET` | `/agents/connections/operations` | `AgentConnectionOperationsClient.list` | `None` | `AgentConnectionOperationPage` |
| `POST` | `/agents/connections/operations` | `AgentConnectionOperationsClient.propose` | `AgentConnectionOperationInput` | `AgentConnectionOperation` |
| `GET` | `/agents/connections/operations/{operationId}` | `AgentConnectionOperationsClient.get` | `None` | `AgentConnectionOperation` |
| `GET` | `/agents/connections/operations/{operationId}/wait` | `AgentConnectionOperationsClient.wait` | `None` | `AgentConnectionOperationWait` |
| `GET` | `/agents/connections/operations/{operationId}/approval` | `AgentConnectionOperationsClient.approval` | `None` | `AgentConnectionApprovalStatus` |
| `GET` | `/agents/connections/plan` | `AgentConnectionsClient.plan` | `None` | `AgentConnectionPlans` |
| `GET` | `/agents/connections/task-facts` | `AgentConnectionsClient.taskFacts` | `None` | `AgentConnectionTaskFacts` |
| `GET` | `/agents/connections/history` | `AgentConnectionsClient.history` | `None` | `AgentConnectionHistoryPage` |
| `PUT` | `/agents/connections/level` | `AgentConnectionsClient.lowerLevel` | `AgentConnectionLevelLowerInput` | `AgentLevelView` |

## Error envelope

Non-2xx responses use the StackShift response envelope. Check `success: false`, then read the structured `error` value and HTTP status. SDK clients surface the status, code, message, and details through their native error type.

## Examples

These static examples show the verified route and authentication boundary. Use the official SDK method shown in each heading so serialization and response unwrapping remain consistent with the contract.

### `GET /agents/connections/identity`

```bash theme={null}
curl -X GET "https://api.stackshift.cloud/api/v1/agents/connections/identity"   -H "Authorization: Bearer $STACKSHIFT_API_KEY"
```

The SDK serializes any supported query options for this operation.

Response:

```json theme={null}
{
  "data": {
    "owner_id": "example-id",
    "connection_id": "example-id",
    "client": {
      "id": "example-id",
      "catalog_id": "example-id",
      "name": "example",
      "identity_verified": true
    },
    "resources": [
      {
        "kind": "example",
        "id": "example-id",
        "include_children": true
      }
    ],
    "operations": [
      "example"
    ],
    "creation": {
      "kind": "example",
      "include_created_children": true,
      "bound_application_id": "example-id"
    },
    "creation_allowances": [
      {
        "reserved": true,
        "resource_id": "example-id",
        "kind": "example",
        "maximum": 1
      }
    ],
    "expires_at": "2026-08-03T00:00:00Z"
  }
}
```

### `POST /agents/connections/operations`

```bash theme={null}
curl -X POST "https://api.stackshift.cloud/api/v1/agents/connections/operations"   -H "Authorization: Bearer $STACKSHIFT_API_KEY"   -H "Content-Type: application/json"   --data '{"action":"example","configuration":{"example":"value"}}'
```

The request body is derived from `AgentConnectionOperationInput` in the official SDK contract.

Response:

```json theme={null}
{
  "data": {
    "id": "example-id",
    "connection_id": "example-id",
    "action": "example",
    "reason": "example",
    "resource_id": "example-id",
    "created_at": "2026-08-03T00:00:00Z",
    "state": "example",
    "execution_mode": "example",
    "configuration": "example",
    "resource_version": "example",
    "affected_targets": [
      {
        "kind": "example",
        "id": "example-id",
        "name": "example",
        "application_id": "example-id",
        "role": "example",
        "resource_version": "example"
      }
    ],
    "approval": {
      "id": "example-id",
      "action_hash": "example",
      "state": "example",
      "expires_at": "2026-08-03T00:00:00Z"
    },
    "result": "example",
    "controller_operations": [
      {
        "kind": "example",
        "id": "example-id",
        "status": "example",
        "resource": {
          "kind": "example",
          "id": "example-id"
        }
      }
    ],
    "error": {
      "code": "example",
      "message": "example"
    },
    "estimate": {
      "example": "value"
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.