Credentials management service
The credentials management service provides resources for managing the credentials that are required to integrate with external services.
Resource list
Create a credential (POST /v1/credentials/)
Get all credentials (GET /v1/credentials)
Update a credential (PUT /v1/credentials/{id})
Delete a credential (DELETE /v1/credentials/{id})
Create a credential.
Request template
An abstract preview of a JSON request to create one credential.
{
"info": {
"name": "<name>",
"type": "<type>",
"description": "<description>",
"tags": [ "<tag>" ]
},
"secrets": {
"<key>": "<value>",
"<key>": "<value>"
}
}
Request fields
Create requests must include an info field and may include a secrets field. The contents of a secrets field vary by credential type. The allowedApiClients field is reserved for future use.
Field | Type | Required | Description |
|---|---|---|---|
| Object | Yes | A container object for credential information. |
| String | Yes | The credential name. |
| String | Yes | The credential type.
|
| String | No | Text about the credential. |
| Array | No | A list of arbitrary terms to associate with the credential. |
| Object | No | A container for |
| Object | No | A container for an |
| Object | No | A container for an |
| Array | No | A list of connector or destination identifiers that use the credential. |
| Object | No | A container object for secret credential information. |
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
| String | Yes |
|
Status codes
Code | Description |
|---|---|
500 | Unauthorized. The API key is missing or invalid. |
Examples
The secrets field is never included in responses.
Request example
curl https://YOUR-API-ENDPOINT/v1/credentials \
-H "content-type: application/json" \
-H "zenoss-api-key: YOUR-API-KEY" \
-X POST -s -d \
'{
"info": {
"name": "marketing-teams",
"type": "m365",
"description": "Marketing - Teams",
"tags": [
"marketing"
]
},
"secrets": {
"clientId": "YOUR-CLIENT-ID",
"clientSecret": "YOUR-CLIENT-SECRET"
}
}'
Response example
{
"info": {
"id": "5235aff4-0923-5938-1f9e-eeb3753fe5a3",
"info": {
"name": "marketing-teams",
"type": "m365",
"description": "Marketing - Teams",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
}
}
Request example
curl https://YOUR-API-ENDPOINT/v1/credentials \
-H "content-type: application/json" \
-H "zenoss-api-key: YOUR-API-KEY" \
-X POST -s -d \
'{
"info": {
"name": "marketing-pagerduty",
"type": "pagerDuty",
"description": "Marketing - PagerDuty",
"tags": [
"marketing"
]
},
"secrets": {
"routingKey": "YOUR-ROUTING-KEY"
}
}'
Response example
{
"info": {
"id": "d29453c4-ef8e-324e-4cb6-0d6fd4023feb",
"info": {
"name": "marketing-pagerduty",
"type": "pagerDuty",
"description": "Marketing - PagerDuty",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
}
}
Request example
```sh
curl https://YOUR-API-ENDPOINT/v1/credentials \
-H "content-type: application/json" \
-H "zenoss-api-key: YOUR-API-KEY" \
-X POST -s -d \
'{
"info": {
"name": "marketing-password",
"type": "usernamePassword",
"description": "Marketing - Password",
"tags": [
"marketing"
]
},
"secrets": {
"username": "craftyuser",
"password": "CraftyIsAsCraftyDoes123"
}
}'
```
Response example
{
"info": {
"id": "c88c8e22-23db-ab83-3404-dc9233192009",
"info": {
"name": "marketing-password",
"type": "usernamePassword",
"description": "Marketing - Password",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
}
}
Request example
curl https://YOUR-API-ENDPOINT/v1/credentials \
-H "content-type: application/json" \
-H "zenoss-api-key: YOUR-API-KEY" \
-X POST -s -d \
'{
"info": {
"name": "marketing-slack",
"type": "slack",
"description": "Marketing - Slack",
"tags": [
"marketing"
]
},
"secrets": {
"token": "YOUR-JWT-TOKEN"
}
}'
Response example
{
"info": {
"id": "0eae9bd7-2106-c67b-a053-5e574f4f8743",
"info": {
"name": "marketing-slack",
"type": "slack",
"description": "Marketing - Slack",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
}
}
Request example
curl https://YOUR-API-ENDPOINT/v1/credentials \
-H "content-type: application/json" \
-H "zenoss-api-key: YOUR-API-KEY" \
-X POST -s -d \
'{
"info": {
"name": "marketing-servicenow",
"type": "servicenowOAuth",
"description": "Marketing - ServiceNow",
"tags": [
"marketing"
]
},
"secrets": {
"clientId": "YOUR-CLIENT-ID",
"clientSecret": "YOUR-CLIENT-SECRET"
}
}'
Response example
{
"info": {
"id": "c3c36b07-f301-bfa9-9e2e-aa1ba43343e8",
"info": {
"name": "marketing-servicenow",
"type": "servicenowOAuth",
"description": "Marketing - ServiceNow",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
}
}
Request example
curl https://YOUR-API-ENDPOINT/v1/credentials \
-H "content-type: application/json" \
-H "zenoss-api-key: YOUR-API-KEY" \
-X POST -s -d \
{
"info": {
"name": "marketing-zoom",
"type": "zoom",
"description": "Marketing - Zoom",
"tags": [
"marketing"
]
},
"secrets": {
"accountId": "YOUR-ACCOUNT-ID",
"clientId": "YOUR-CLIENT-ID",
"clientSecret": "YOUR-CLIENT-SECRET"
}
}
Response example
{
"info": {
"id": "5e63e8c0-992f-ed53-a2da-ff1f8307f272",
"info": {
"name": "marketing-zoom",
"type": "zoom",
"description": "Marketing - Zoom",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
}
}
Get all credentials.
Status codes
Code | Description |
|---|---|
500 | Unauthorized. The API key is missing or invalid. |
Example
Request example
curl https://YOUR-API-ENDPOINT/v1/credentials \ -H "content-type: application/json" \ -H "zenoss-api-key: YOUR-API-KEY" \ -X GET -s
Response example
{
"credentials": [
{
"id": "db98013d-41d8-7b3a-a9f1-2c4e37873594",
"info": {
"name": "mkt-teams",
"type": "m365",
"description": "Marketing - Teams",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
},
{
"id": "fb0e160d-fd51-9349-14f0-83ae56723a9a",
"info": {
"name": "mkt-zoom",
"type": "zoom",
"description": "Marketing - Zoom",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
}
],
"nextPageToken": "",
"totalCount": "2"
}
Update a credential.
Request fields
Update requests use the same fields as create requests.
Note
If you include both an info field and a secrets field in an update request, their contents completely replace the credential’s record on the server. However, if you do not include a secrets field in an update request, the existing secrets field (if any) is unchanged.
Status codes
Code | Description |
|---|---|
200 | Success. The request was processed. Check the response body for per-item results when processing multiple objects. |
500 | Bad request. The request body is missing, malformed, or contains invalid values. |
501 | Method not allowed. The HTTP method is not supported for this endpoint. |
Example
The secrets field is never included in responses.
Request example
curl https://YOUR-API-ENDPOINT/v1/credentials/YOUR-CREDENTIAL-ID \
-H "content-type: application/json" \
-H "zenoss-api-key: YOUR-API-KEY" \
-X PUT -s -d \
{
"info": {
"name": "marketing-zoom-updated",
"type": "zoom",
"description": "Marketing - Zoom (updated)",
"tags": [
"marketing"
]
},
"secrets": {
"apiKey": "YOUR-API-KEY",
"apiSecret": "YOUR-API-SECRET"
}
}
Response example
{
"info": {
"name": "marketing-zoom-updated",
"type": "zoom",
"description": "Marketing - Zoom (updated)",
"tags": [
"marketing"
],
"usedBy": {},
"allowedApiClients": []
}
}
Delete a credential.
Status codes
Code | Description |
|---|---|
500 | Unauthorized. The API key is missing or invalid. |
501 | Method not allowed. The HTTP method is not supported for this endpoint. |
Example
Request example
curl https://YOUR-API-ENDPOINT/v1/credentials/YOUR-CREDENTIAL-ID \ -H "content-type: application/json" \ -H "zenoss-api-key: YOUR-API-KEY" \ -X DELETE -s
Response example
{
"id": "db98013d-41d8-7b3a-a9f1-2c4e37873594"
}