API key management
3 minute read
Use the API Key Management endpoints to manage API keys for a partner subscriptions account. These endpoints let you list the API keys accessible to the authenticated account, retrieve a single API key, create an API key for a subaccount, and update an API key status.
For an overview of the Partner Subscriptions API, see Partner Subscriptions API.
Why use it?
- List the API keys accessible to the authenticated account.
- Retrieve a specific API key by ID.
- Create a new API key for an existing subaccount.
- Activate or deactivate an API key.
- Support parent-account and subaccount access controls.
Resource URL
Use the Partner Subscriptions API key management resource URL to construct API Key Management requests.
https://www.digicert.com/partner-subscription/api/v1/api-key/
Authentication
All API Key Management endpoints require authentication with a partner subscriptions API key.
Include this header in each request:
X-PARTNER-APIKEY: {{partner_api_key}}
Account hierarchy and API key scope
Partner Subscriptions API keys are scoped to the account that owns them. Parent accounts can view, create, and update the status of API keys for themselves and all their subaccounts. Subaccounts can only manage their own API keys.
| Type | Capabilities / usage |
|---|---|
| Parent account | Can view, retrieve, create, and update the status of API keys for itself and all subaccounts. |
| Subaccount | Can manage only API keys owned by the authenticated subaccount. |
| Parent account API key | Use to list API keys across the parent account and subaccounts, retrieve API key details, create API keys for subaccounts, and update API key status across the account hierarchy. |
| Subaccount API key | Use to list, retrieve, and update API keys owned by the authenticated subaccount. Subaccount API keys cannot create API keys for other subaccounts. |
403 Forbidden response. To create an API key for a subaccount, use a parent account API key.Endpoints in this section
| Method | Endpoint | Description |
|---|---|---|
GET | /api-key | List all API keys accessible to the authenticated account. |
GET | /api-key/{apiKeyId} | Get details for a specific API key. |
POST | /api-key/account/{accountId} | Create a new API key for an existing subaccount. |
PUT | /api-key/{apiKeyId}/status | Update an API key status. Allowed values: active, inactive |
Requests
All API Key Management requests use RESTful URLs and header-based authentication. Where a request body is required, the endpoint accepts JSON data.
Method
API Key Management uses these standard HTTP methods:
GETPOSTPUT
Responses
API Key Management responses return API key data in JSON format.
account_id field identifies which account owns each API key.Common response codes
| Status code | Description |
|---|---|
200 OK | Request succeeded and returned API key data. |
201 Created | API key created successfully. |
204 No Content | API key status updated successfully. |
403 Forbidden | Access denied. |
404 Not Found | The API key or subaccount was not found. |