Fetch the archive of a local integration (manifest and server payload)
Container-to-host only. Auth via Bearer run token. Called by the sidecar's integrations-boot to materialise a local integration's MCP server before spawning a runner container. A local integration declares its server inline (source.server) and ships the payload in its own archive; server.entry_point is relative to the archive root. The route verifies that the run's agent declares this integration in dependencies.integrations, that it is ACTIVE in the run's space and that it is a local one with a server — orthogonal access control to the credentials endpoint. An ephemeral CONNECT run has neither a run row nor an agent, so its token is authorised instead against the launcher-published grant, by exact match on the single integration and concrete version its spawn spec names — strictly narrower than the dependency walk, never wider. Returns the raw ZIP archive (application/zip). Which bytes: the version the run froze (runs.resolved_integration_versions). The spawn spec names a published version in server.version and the sidecar forwards it as ?version=, which must be exactly that version — never a fallback to the newest published one (that would skew the manifest from the bytes). A system integration is answered from the in-memory boot registry, and an integration the run froze on its draft (a draft dependency override) from the draft files, read at fetch time (a draft edited after launch is served as edited); neither spec carries a version, and ?version= is refused for them.
/internal/integration-bundle/{scope}/{name}Authorization
bearerExecToken Run token for container-to-host internal routes.
In: header
Path Parameters
Package scope (e.g. @myorg)
^@[a-z0-9][a-z0-9-]*$Package name
Query Parameters
Concrete published version to serve — exactly the one the run froze (the spawn spec's server.version). Omitted for a system integration (boot registry) and for a draft run (draft files); a version sent for those, or a different one, is a 404.
curl -X GET "https://your-instance/internal/integration-bundle/string/string""string"{
"type": "https://docs.appstrate.dev/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Invalid or missing session",
"code": "unauthorized",
"request_id": "req_abc123"
}{
"type": "https://docs.appstrate.dev/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Insufficient permissions",
"code": "forbidden",
"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,
"login_refusal": "grant",
"integration_diagnostic": "string",
"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"
}
]
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"code": "string",
"request_id": "string",
"param": "string",
"retry_after": 0,
"login_refusal": "grant",
"integration_diagnostic": "string",
"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"
}
]
}{
"type": "https://docs.appstrate.dev/errors/rate-limited",
"title": "Rate Limited",
"status": 429,
"detail": "Too many requests. Please try again shortly.",
"code": "rate_limited",
"request_id": "req_abc123",
"retry_after": 30
}