Pin a set of shared connections to an agent for all members of the space (admin)
Impose a floor: every run of the agent binds the pinned set, whoever runs it, and no launch override, member pin, org default or fallback narrows or replaces it. allow_additional_connections decides what may add to it. Closed (the default), nothing does: a launch override naming a connection outside the set is override_outranked. Open, the run's selection — its launch override, else the member's pin — is bound after the floor (deduplicated, at most 20 in all, else connection_set_too_large), from the connections the actor can reach. Growing an open floor does not judge the member pins already stored: where the floor plus one of them exceeds 20 connections, that member's runs fail with connection_set_too_large. A member pin never survives under a governance that admits no addition — a closed admin pin or an enforced default — where it would otherwise come back later as an addition or as a selection nobody chose again. So, in the same transaction: writing an admin pin closed, or over a closed one, deletes every member pin of its agent and integration in the space (writing an open pin where there was none, or rewriting an open one, keeps them); removing a closed pin, or an open one while the space enforces a default for the integration, deletes them too; removing an open pin otherwise deletes only those strictly narrowing its floor (only connections of it, fewer than it holds, [] included), which added nothing and would bind fewer connections as written; writing or removing a default that is, or was, enforced deletes every member pin of the integration in the space (a closed admin pin left none, and the enforced default closes an open one). The audit records each one (memberPinsCleared: userId, agentPackageId, connectionIds). Pin connections whose scopes_granted cover what the agent needs; when none does, create and share a new connection with those scopes rather than upgrading one other agents use. Only shared connections can be pinned.
/api/integrations/{packageId}/pins/{agentPackageId}Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.
In: cookie
Path Parameters
Integration package id (e.g. @official/gmail).
^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$Agent package id (e.g. @acme/my-agent).
^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$Header Parameters
Organization ID. Required for cookie auth. Not needed for API key auth (org resolved from key).
uuidSpace ID. Required for space-scoped routes (agents, runs, schedules, and space-scoped module routes). Not needed for API key auth (space resolved from key).
Request Body
application/json
curl -X PUT "https://your-instance/api/integrations/string/pins/string" \ -H "Content-Type: application/json" \ -d '{ "connection_ids": [] }'{
"agent_package_id": "string",
"integration_package_id": "string",
"connection_ids": [],
"allow_additional_connections": true,
"agent_active": true,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}{
"type": "https://docs.appstrate.dev/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"detail": "name: Invalid input: expected string, received undefined (+2 more)",
"code": "validation_failed",
"request_id": "req_abc123",
"errors": [
{
"field": "name",
"code": "required",
"message": "Invalid input: expected string, received undefined"
},
{
"field": "email",
"code": "invalid_format",
"message": "Invalid email address"
},
{
"field": "age",
"code": "invalid_type",
"message": "Invalid input: expected number, received string"
}
]
}{
"type": "https://docs.appstrate.dev/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Insufficient permissions",
"code": "forbidden",
"request_id": "req_abc123"
}{
"type": "https://docs.appstrate.dev/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Resource not found",
"code": "not_found",
"request_id": "req_abc123"
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"code": "string",
"request_id": "string",
"param": "string",
"retry_after": 0,
"errors": [
{
"field": "string",
"code": "string",
"message": "string",
"title": "string",
"line": 1,
"column": 1,
"candidate_connections": [
{
"id": "string",
"label": "string",
"account_id": "string",
"owned_by_actor": true,
"needs_reconnection": true,
"scopes_granted": [
"string"
],
"missing_scopes": [
"string"
]
}
],
"connection_id": "string",
"missing_scopes": [
"string"
],
"remedy": "new_connection",
"owned_by_actor": true,
"required_scopes": [
"string"
],
"auth_key": "string",
"required_auth_key": "string",
"available_auth_keys": [
"string"
],
"source": "admin_pin",
"connect_url": "http://example.com",
"expiresAt": "2019-08-24T14:15:22Z",
"packageId": "string"
}
]
}