Activate a package in this space
Activate a package here — the ONE activation door, for every package type, for a personal space as for a team one. Idempotent: a package that is already active answers 200 with the same body, and one that was switched off comes back with the per-space model, proxy and input settings it kept. Where the package is PLACED here — homed in this space, holding a row here (POST /api/packages/{scope}/{name}/shares creates one), or a system package, placed everywhere — the row is switched on. Where it is not, this call places it, but only for a caller holding the package type's share permission in the package's HOME space and only when the package has a published version (409 package_has_no_version) — 403 without the permission, 404 when the package id is not reachable at all. Without that permission the call only switches on a row that exists, so a placement withdrawn while the call is in flight is refused with 404 rather than recreated. An API key never carries share, so it activates only what is already placed. In the caller's OWN personal space the type's activation grant is not required: ownership is the authorization, which is how a guest switches on a package placed there for them. The placement carries no version: the package runs its latest published version, and its draft runs for whoever can write it.
/api/spaces/{spaceId}/packagesCookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.
In: cookie
Path Parameters
Header Parameters
Organization ID. Required for cookie auth. Not needed for API key auth (org resolved from key).
uuidRequest Body
application/json
curl -X POST "https://your-instance/api/spaces/string/packages" \ -H "Content-Type: application/json" \ -d '{ "packageId": "string" }'{
"object": "space_package",
"packageId": "string",
"generation_config": {
"temperature": 0,
"reasoning_level": "off"
},
"modelId": "string",
"proxyId": "string",
"enabled": true,
"chat_enforced": true,
"installed_at": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"package_type": "agent",
"package_source": "local",
"draft_manifest": {}
}{
"object": "space_package",
"packageId": "string",
"generation_config": {
"temperature": 0,
"reasoning_level": "off"
},
"modelId": "string",
"proxyId": "string",
"enabled": true,
"chat_enforced": true,
"installed_at": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"package_type": "agent",
"package_source": "local",
"draft_manifest": {}
}{
"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/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": "https://docs.appstrate.dev/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "Resource not found",
"code": "not_found",
"request_id": "req_abc123"
}{
"type": "about:blank",
"title": "Invalid MCP Server Bundle",
"status": 422,
"detail": "MCP-server package '@myorg/tools' has no activatable published version.",
"code": "bundle_invalid",
"request_id": "req_abc123"
}