You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: info/projects.mdx
+12-33Lines changed: 12 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,14 +18,14 @@ Every organization has at least one project. Resources that existed before proje
18
18
Your organization must always have **at least one active project**. The API returns `409 Conflict` if you try to delete the last remaining project:
19
19
20
20
```json
21
-
{ "code": "conflict", "message": "organization must have at least one project" }
21
+
{ "code": "last_active_project", "message": "organization must have at least one project" }
22
22
```
23
23
24
-
A project must also be empty before it can be deleted — archive or remove its active resources first.
24
+
A project must also be empty before it can be deleted. If active resources remain, the API returns `409 Conflict` with code `project_not_empty`; delete or otherwise remove those resources and retry. Organizations without Projects enabled receive `404 Not Found` with code `projects_disabled` from project-management endpoints.
25
25
26
26
## Scoping Requests to a Project
27
27
28
-
Pass the `X-Kernel-Project-Id` header — a project ID or name — on any API request to scope it to a specific project. Without the header (and without a project-scoped API key), requests act on your organization's **default project**: reads return the default project's resources, and writes create resources in it.
28
+
Pass the `X-Kernel-Project-Id` header with a project ID on any API request to scope it to a specific project. Project names are not accepted in this header. Without the header (and without a project-scoped API key), requests act on your organization's **default project**: reads return the default project's resources, and writes create resources in it.
@@ -128,6 +106,7 @@ API keys can be **org-wide** or **project-scoped**.
128
106
129
107
-**Existing API keys are org-wide.** They see every resource in your organization across all projects. Include an `X-Kernel-Project-Id` header to restrict a single request to one project.
130
108
-**Project-scoped API keys** can only access resources inside the project they were issued for. Create one from the **API Keys** page in the dashboard, the [CLI](/reference/cli/api-keys), an SDK, or the [API keys guide](/info/api-keys), and pass the target `project_id` when generating the key. Requests made with a scoped key are automatically limited to that project — no header required. If you do send an `X-Kernel-Project-Id` header and it conflicts with the key's project, the request is rejected with `403 Forbidden`.
109
+
-**Most project administration requires an org-wide credential.** A project-scoped key may rename its own project, but cannot create, archive, or delete projects, or change project limits.
131
110
132
111
### OAuth
133
112
@@ -137,16 +116,16 @@ OAuth tokens (used by the Kernel CLI and MCP server) are **always org-wide**. Yo
137
116
138
117
The Kernel [CLI](/reference/cli/projects) has first-class project support:
139
118
140
-
- A global `--project <id-or-name>` flag scopes any command to a single project. Names are resolved case-insensitively, so `--project staging` works.
119
+
- A global `--project <project-id>` flag scopes any command to a single project ID.
141
120
- The `KERNEL_PROJECT` environment variable does the same, so you can set it once in your shell or CI.
142
121
- A `kernel projects` command group lets you list, create, get, and delete projects, and manage per-project limit overrides.
You can't delete a project that still owns active resources, and you can't delete the last remaining active project in your org.
297
+
Project deletion is a soft delete. A project that still owns active resources returns `project_not_empty`; the final active project returns `last_active_project`.
Copy file name to clipboardExpand all lines: reference/cli/projects.mdx
+2-7Lines changed: 2 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,14 @@ Manage [Projects](/info/projects) from the CLI and scope other commands to a spe
6
6
7
7
## Scoping commands to a project
8
8
9
-
Use the global `--project` flag (or the `KERNEL_PROJECT` environment variable) to scope any `kernel` command to a project. The flag accepts either a **project ID** or a **project name** — names are resolved case-insensitively by listing your projects.
9
+
Use the global `--project` flag (or the `KERNEL_PROJECT` environment variable) to scope any `kernel` command to a project ID. Project names are accepted by project-management commands whose arguments say `<id-or-name>`, but not by this global request-scoping flag.
10
10
11
11
```bash
12
-
# Scope a single command by name
13
-
kernel browsers list --project staging
14
-
15
12
# Scope by ID
16
13
kernel browsers list --project proj_abc123
17
14
18
15
# Scope via environment variable
19
-
export KERNEL_PROJECT=staging
16
+
export KERNEL_PROJECT=proj_abc123
20
17
kernel apps list
21
18
```
22
19
@@ -26,8 +23,6 @@ Under the hood, the flag adds the `X-Kernel-Project-Id` header to every authenti
26
23
Project-scoped API keys are already bound to a project server-side, so you don't need `--project` when using them — but if you do pass it, it must match the key's project or the request is rejected.
27
24
</Info>
28
25
29
-
If the name is ambiguous (multiple projects share it) or no match is found, the CLI returns a clear error; pass the project ID instead.
0 commit comments