For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Keys API

Create, list, and revoke API keys belonging to service accounts.

Create, list, and revoke API keys belonging to service accounts.

Authentication

Admin permissions are required for all operations on this page. Set GC_API_KEY to an API key with the required permissions and GC_BACKEND_ID to the backend ID. Every example sends both headers. For self-hosted deployments, replace https://api.groundcover.com with your API URL.

These keys authenticate API requests. For telemetry ingestion credentials, use the separate Ingestion Keys API.

Create

POST /api/rbac/apikey/create

Field
Required
Description

name

Yes

Key name.

serviceAccountId

Yes

description

No

Purpose of the key.

expirationDate

No

RFC3339 expiration timestamp; omit or use null for no expiration.

curl --request POST \
  --url "https://api.groundcover.com/api/rbac/apikey/create" \
  --header "Authorization: Bearer $GC_API_KEY" \
  --header "X-Backend-Id: $GC_BACKEND_ID" \
  --header "Content-Type: application/json" \
  --data '{
  "name": "automation-key",
  "serviceAccountId": "<SERVICE_ACCOUNT_ID>",
  "description": "Read-only automation"
}'

HTTP 200 returns {"apiKey":"<GENERATED_SECRET>","id":"<API_KEY_ID>"}. Store apiKey securely: the list endpoint does not return its secret. The key inherits the service account's policies. An unknown service account returns 400; a duplicate key name returns 409.

List

GET /api/rbac/apikeys/list

Optional boolean query parameters withRevoked and withExpired include inactive keys. Both default to false.

HTTP 200 returns an array of key metadata, including id, name, serviceAccountId, serviceAccountName, policies, description, creationDate, createdBy, lastActive, revokedAt, and expiredAt.

Revoke

DELETE /api/rbac/apikey/{id}

Use the resource id, not the secret token. Revocation removes the key's ability to authenticate.

Success returns HTTP 202 with no response body; an unknown ID returns 404.

Last updated