Skip to main content
Start with the example closest to your workload and keep only the permissions you need. Each snippet defines a policy value to pass to the API key creation call. TypeScript and Python examples grant the same permissions. The IDs below represent resources you’ve already created. Replace them with IDs returned by your own API requests; exact resource IDs are validated when you issue a key. Most examples fit a project-scoped key with project_id: 'proj_staging_9f3k'. Examples that include organization resources require an organization-scoped key. For every available action and its prerequisites, see API key permissions.
Use an organization-scoped key to read organization limits and view or update one project. Omit project_id when issuing this key.
Add projects:delete on projects/proj_staging_9f3k to archive or restore the project. Create additional projects with projects:create on organizations/org_8f3k9m2q/*.
Create and control browsers in the staging project using one saved extension.
Pass ext_9k4m2q7s in the browser request’s extensions list. Include extensions:use on every saved extension attached to a browser you access.
Create browsers in staging and send their telemetry to one saved destination.
When creating the browser, enable at least one telemetry source (for example, set telemetry.browser.console.enabled to true) and set telemetry.export.otlp.destination to {"id": "tdst_8k2q4m6r"}. Export without capture returns 400. See the complete browser request.
Acquire and release browsers from one pool that uses a saved profile.
Use pool pool_6m2k9q4s, configured with profile prof_7h2kq9x4m1. If its browsers also carry vaults or saved extensions, grant use of those resources too. An acquire-time profile that saves changes also needs profiles:write.
Read a connection and start logins using its saved profile and credential, including saving updated credential values.
Use connection mconn_5k3m8q2r, configured with profile prof_7h2kq9x4m1 and credential cred_4q8m2k6s. Provider-backed connections additionally require credential_providers:use on the organization-owned provider, so they need an organization-scoped key. If the connection must create a credential, grant container-wide credentials:create, credentials:use, and credentials:write instead of exact-ID credential grants.
Deploy and run an app in staging, and read its deployment and invocation results.
Use this key to deploy and invoke the app. If you omit runtime_policy, the app runtime policy grants only project-wide invocations:write, not the rest of the deploying key’s permissions. The next example adds browser access.
Use an explicit runtime policy to give the app browser access without deployment-management permissions. This app creates browsers without saved profiles or other attached resources.
Send the runtime policy as JSON in the runtime_policy multipart field of POST /deployments. The deploying key needs every runtime permission plus deployments:create and deployments:delete on the project. Issue a separate key with the invoker policy to start actions without deployment-management access.A supplied runtime policy with only browsers:create and browsers:use is rejected with 400: it must explicitly include project-wide invocations:write. Permissions aren’t silently added.A key with only invocations:create can’t invoke this app: it doesn’t cover the runtime’s browser and callback permissions. Add invocations:read to read results and deployments:read as well to read the event stream.
Read staging API-key metadata, read organization audit logs, and look up browser configuration recommendations. Issue this as an organization-scoped key by omitting project_id. For configuration registry requests, send X-Kernel-Project-Id: proj_staging_9f3k to select the project named in the policy.
API-key reads return metadata and policies. Creating delegated keys requires api_keys:create on their container plus the permissions you intend to delegate; rotating keys requires api_keys:rotate and coverage of their policy.