Service Accounts API
Create and manage non-human identities and their policy assignments.
Create and manage non-human identities and their policy assignments.
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.
Endpoints
POST
/api/rbac/service-account/create
Create
GET
/api/rbac/service-accounts/list
List
GET
/api/rbac/service-account/{id}
Get
PUT
/api/rbac/service-account/update
Update email or policy assignments
DELETE
/api/rbac/service-account/{id}
Delete
Create a service account
name, email (valid email address), and policyUUIDs (array) are required. Obtain policy UUIDs from the RBAC Policies API.
curl --request POST \
--url "https://api.groundcover.com/api/rbac/service-account/create" \
--header "Authorization: Bearer $GC_API_KEY" \
--header "X-Backend-Id: $GC_BACKEND_ID" \
--header "Content-Type: application/json" \
--data '{
"name": "automation-reader",
"email": "automation@example.com",
"policyUUIDs": [
"<POLICY_UUID>"
]
}'The response is HTTP 200 with {"serviceAccountId":"<SERVICE_ACCOUNT_ID>"}. A duplicate name returns 409.
List and get
List returns an array; get returns one object. Each object includes serviceAccountId, name, email, policies, deleted, lastActive, createdBy, and creationDate.
Update policy assignments
The update endpoint accepts serviceAccountId, optional email, policyUUIDs, and overridePolicies. At least a nonempty email or a nonempty policy list must be supplied. Policy UUIDs are appended by default; set overridePolicies to true to replace the assignments.
The response is HTTP 200 with serviceAccountId. An empty policyUUIDs array does not clear assignments through this endpoint.
Delete
Revoke the account's API keys first using the API Keys API. Deletion is rejected with 400 while API keys prevent deletion, or 404 if the account does not exist.
Success returns HTTP 202 with no response body.
Last updated
