Get an API key
The Members API accepts two kinds of key.
Use an organization key for automation that should not depend on one person, such as a sync from
your identity provider. It keeps working when the admin who created it leaves.
Personal key
1
Open the cubic API page
2
Generate a personal key
In the Members API card, click Generate API key. Keys start with
cbk_, and cubic only shows the full value once.3
Store it securely
Save the key in your secret manager or local environment.
This is the same personal key that the cubic MCP server, the cubic
CLI, and the Analytics API use, and regenerating it replaces
the key for all of them. The key acts with your own cubic access. You only see organizations you
can already view in cubic, and changes need an organization admin. See
Roles and permissions.
Organization key
Only organization admins can create and revoke organization keys.1
Open API, CLI & MCP
Go to Settings > API, CLI & MCP and pick the organization next to Organization API keys.
2
Create a key
Click Create API key and name the key after the script or integration that uses it. Choose Read to list organizations and members, or Admin to also turn seats on or off and change roles. Keys start with
cok_, and cubic only shows the full value once.3
Store it securely
Save the key in your secret manager.
An organization key belongs to the organization, not to the admin who created it. It reads
members of that one organization. A key with Admin access also updates them with an admin’s
permissions, and a Read key gets
403 admin_required on PATCH. No key can change billing.
Any admin can revoke a key in Settings > API, CLI & MCP, and requests with a revoked key fail from
then on. Uninstalling cubic from the organization deletes its keys.Endpoints
The base URL is
https://www.cubic.dev. {org} is the GitHub organization login, such as acme. Each organization in the list includes githubAccountId, GitHub’s numeric account ID, and flags such as canManageSeats that show what your access allows. An organization key lists only its own organization.
Each endpoint’s reference page includes request fields, response schemas, and code examples. Enter
an API key in the playground to try a request with that key’s access.
The OpenAPI document powers the API reference. You can
also generate a client from it.
Authentication
Send a personal or organization key in theAuthorization header as a bearer token.
cak_ do not work with the Members API.
Example requests
Members
A seat is a paid license for cubic reviews. Turning a seat off does not remove the person’s access to cubic. To remove someone, remove them from the GitHub organization. cubic removes their access when GitHub notifies it. See Roles and permissions for what each role can do.
The member list holds the people cubic tracks for the organization, including members with access to a repository cubic reviews and pull request authors. On paid plans, cubic refreshes it from GitHub every day.
Filter the member list
The list also takes
cursor and limit, described in Pagination. An unknown parameter returns 400 invalid_request, so a mistyped filter never lists everyone.
Update a member
Send the fields you want to change, each with the value from your latest read.
If the member changed since your read, the request fails with
409 member_state_changed and changes nothing. Read the member again, then retry. A request that asks for the member’s current state succeeds with "changed": false, so retrying a completed request is safe.
You can change a seat and role in the same request. Both changes are committed together, or the
request fails without changing either field. For example, to turn off a member’s seat and change
their role to viewer, send this body with PATCH:
before and after state, changed, and availableSeats, the number of paid seats still free after the change. purchasedQuantityChanged is always false: the API assigns existing capacity and never changes the number of seats you buy.
Updates need an organization admin or an organization key with Admin access, and an active
Team, Pro, or Max subscription billed through cubic. Manage seats for Vercel Marketplace
subscriptions in cubic. The API never buys seats. When every paid seat is in use, turning on a
human member’s seat fails with
seat_capacity_exceeded. Add seats in
Settings → Billing first.Pagination
List endpoints return one page and anextCursor. To get the next page, send nextCursor back as cursor. nextCursor is null on the last page. Set the page size with limit, from 1 to 100. The default is 20.
Copy nextCursor unchanged. The members endpoint does not check whether a cursor came from an
earlier page, so an edited or unrecognized cursor can return an empty page instead of an error.
The organizations endpoint returns 400 invalid_cursor for invalid cursor numbers.
To fetch every member, continue until nextCursor is null:
Rate limits
The Members API allows 1,000 requests per 15 minutes for each person’s personal key. An organization’s keys share a separate limit of 1,000 requests per 15 minutes. Regenerating a personal key or creating more organization keys does not reset or raise a limit. Analytics API requests with these keys count toward the same limits. Every response after authentication includes these headers.
When you run out, cubic answers
429 rate_limited with a Retry-After header in seconds. If cubic cannot check the limit, it answers 503 rate_limiter_unavailable with Retry-After: 30 and no X-RateLimit-* headers. In both cases, wait for Retry-After before you retry.
Errors
Every error uses the same envelope.code, because messages can change. retriable says whether the same request can succeed if you send it again. Some errors include a correlationId. Quote it when you contact support. Validation errors include details, a list of path and message pairs for the fields that failed.
The reference pages describe response schemas. The codes below explain errors your scripts can handle.