Skip to content

ApiKeyService

Manages API keys for programmatic access to the Pidgr API. Keys are scoped to an organization.

MethodDescription
CreateApiKeyCreate a new API key
ListApiKeysList all API keys for the organization
RevokeApiKeyRevoke an existing API key

Create a new API key. The full key value is only returned once — store it securely.

Authorization: Requires MANAGE_API_KEYS permission

FieldTypeDescription
namestringHuman-readable name for the key. Max 200 characters.
FieldTypeDescription
api_keyApiKeyThe created API key metadata.
raw_keystringThe full API key value. Only returned on creation.

TypeScript (Connect-Web)

const response = await apiKeyClient.createApiKey({
name: "CI Integration",
});
// Store response.rawKey securely — it won't be shown again

Go (gRPC)

resp, err := apiKeyClient.CreateApiKey(ctx, &pidgrv1.CreateApiKeyRequest{
Name: "CI Integration",
})
// Store resp.RawKey securely — it won't be shown again

List all API keys for the organization.

Authorization: Requires MANAGE_API_KEYS permission

FieldTypeDescription
paginationPaginationPagination parameters.
FieldTypeDescription
api_keysApiKey[]List of API keys (without raw key values).
paginationPaginationMetaPagination metadata.

Revoke an API key. Revoked keys immediately stop working.

Authorization: Requires MANAGE_API_KEYS permission

FieldTypeDescription
idstringID of the API key to revoke.

Empty response on success.

FieldTypeDescription
idstringUnique identifier.
namestringHuman-readable name.
prefixstringFirst characters of the key (for identification).
created_atTimestampWhen the key was created.
last_used_atTimestampWhen the key was last used.
revoked_atTimestampWhen the key was revoked (if revoked).