API: Discovery - Credentials
This guide covers endpoints for managing discovered credentials.
List Credentials
Retrieve a list of discovered credentials. You can use query parameters for paging, sorting, or filtering.
Request:
| GET /api/v1/discovery/credentials?{PAGING-SORT-PARAMETERS} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Query parameters:
- page: Results page number
- pageSize: Number of results per page
- sort: Format {FIELD}:{ASC/DESC} (can be repeated)
- username: Filter by username (wildcards allowed)
- password: Filter by password (wildcards allowed)
- host: Filter by host (wildcards allowed)
- realm: Filter by realm (wildcards allowed)
- source: Filter by source (wildcards allowed)
- anyFieldContains: Search across all fields
Examples:
| GET /api/v1/discovery/credentials?page=0&pageSize=10&sort=host:asc HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
| GET /api/v1/discovery/credentials?page=0&pageSize=10&username=*Bob* HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Get Credential Details
Retrieve details for a specific credential using its ID.
Request:
| GET /api/v1/discovery/credential/{CREDENTIAL-ID} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Create a New Credential
Add a new credential by providing the necessary configuration.
Request:
| POST /api/v1/discovery/credentials HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{CREDENTIAL-CONF}
|
Example:
| POST /api/v1/discovery/credentials HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"username": "Bob",
"password": "NeverGonnaExploitYouUp",
"host": "192.168.1.2",
"realm": null,
"source": "web",
"note": "seems to work"
}
|
Update Credential
Modify an existing credential. Only the "note" and "source" fields are updateable.
Request:
| PATCH /api/v1/discovery/credential/{CREDENTIAL-ID} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{CREDENTIAL-CONF}
|
Example:
| PATCH /api/v1/discovery/credential/d0e66c9e-28a7-48a2-be7e-7fbf91dffe7f HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"note": "Does not work anymore"
}
|
Bulk Archive Credentials
Archive one or more credentials by providing their IDs.
Request:
| POST /api/v1/discovery/credentials/bulk-archive HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"credentialIds": [CREDENTIAL-IDS]
}
|
Example:
| POST /api/v1/discovery/credentials/bulk-archive HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"credentialIds": ["b0561061-b8f2-4820-adb3-1a4a369ebb35", "215ds361-b232-4650-a5b3-354a369ebb36"]
}
|
Bulk Restore Credentials
Restore archived credentials by providing their IDs.
Request:
| POST /api/v1/discovery/credentials/bulk-restore HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"credentialIds": [CREDENTIAL-IDS]
}
|
Example:
| POST /api/v1/discovery/credentials/bulk-restore HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"credentialIds": ["b0561061-b8f2-4820-adb3-1a4a369ebb35", "215ds361-b232-4650-a5b3-354a369ebb36"]
}
|
Get Credential Events
Retrieve events related to a specific credential.
Request:
| GET /api/v1/discovery/credential/{CREDENTIAL-ID}/events HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|