ApiKeyService
Manages API keys for programmatic access to the Pidgr API. Keys are scoped to an organization.
Methods
Section titled “Methods”| Method | Description |
|---|---|
CreateApiKey | Create a new API key |
ListApiKeys | List all API keys for the organization |
RevokeApiKey | Revoke an existing API key |
CreateApiKey
Section titled “CreateApiKey”Create a new API key. The full key value is only returned once — store it securely.
Authorization: Requires MANAGE_API_KEYS permission
Request: CreateApiKeyRequest
Section titled “Request: CreateApiKeyRequest”| Field | Type | Description |
|---|---|---|
name | string | Human-readable name for the key. Max 200 characters. |
Response: CreateApiKeyResponse
Section titled “Response: CreateApiKeyResponse”| Field | Type | Description |
|---|---|---|
api_key | ApiKey | The created API key metadata. |
raw_key | string | The full API key value. Only returned on creation. |
Example
Section titled “Example”TypeScript (Connect-Web)
const response = await apiKeyClient.createApiKey({ name: "CI Integration",});// Store response.rawKey securely — it won't be shown againGo (gRPC)
resp, err := apiKeyClient.CreateApiKey(ctx, &pidgrv1.CreateApiKeyRequest{ Name: "CI Integration",})// Store resp.RawKey securely — it won't be shown againListApiKeys
Section titled “ListApiKeys”List all API keys for the organization.
Authorization: Requires MANAGE_API_KEYS permission
Request: ListApiKeysRequest
Section titled “Request: ListApiKeysRequest”| Field | Type | Description |
|---|---|---|
pagination | Pagination | Pagination parameters. |
Response: ListApiKeysResponse
Section titled “Response: ListApiKeysResponse”| Field | Type | Description |
|---|---|---|
api_keys | ApiKey[] | List of API keys (without raw key values). |
pagination | PaginationMeta | Pagination metadata. |
RevokeApiKey
Section titled “RevokeApiKey”Revoke an API key. Revoked keys immediately stop working.
Authorization: Requires MANAGE_API_KEYS permission
Request: RevokeApiKeyRequest
Section titled “Request: RevokeApiKeyRequest”| Field | Type | Description |
|---|---|---|
id | string | ID of the API key to revoke. |
Response: RevokeApiKeyResponse
Section titled “Response: RevokeApiKeyResponse”Empty response on success.
ApiKey Message
Section titled “ApiKey Message”| Field | Type | Description |
|---|---|---|
id | string | Unique identifier. |
name | string | Human-readable name. |
prefix | string | First characters of the key (for identification). |
created_at | Timestamp | When the key was created. |
last_used_at | Timestamp | When the key was last used. |
revoked_at | Timestamp | When the key was revoked (if revoked). |