# List Service Principal Secrets Proxy

Launch stage: GA

`GET /api/2.0/accounts/servicePrincipals/{service_principal}/credentials/secrets`

List all secrets associated with the given service principal. This operation only returns information about the secrets themselves and does not include the secret values.

API scopes: authentication

## Path parameters

- `service_principal` (string, optional)
  The service principal ID.

## Query parameters

- `account_id` (string, optional)
  The account ID.
- `page_token` (string, optional)
  An opaque page token which was the `next_page_token` in the response of the previous request to list the secrets for this service principal. Provide this token to retrieve the next page of secret entries.
   When providing a `page_token`, all other parameters provided to the request must match the previous request.
   To list all of the secrets for a service principal, it is necessary to continue requesting pages of entries until the response contains no `next_page_token`. Note that the number of entries returned must not be used to determine when the listing is complete.
- `page_size` (int32, optional)
  Default: `100`

## Returns

- `secrets` (array of object, optional)
  List of the secrets
  - `id` (string, optional)
    ID of the secret
    Example: `09094e3230c893775eac3a9e7d912a8ad08ffd7e592feec9afd51958cb662110`
  - `secret` (string, optional)
    Secret Value
    Example: `x8ipcf0482bcaah6b3dfcb3fb217461f8b83`
  - `secret_hash` (string, optional)
    Secret Hash
  - `create_time` (string, optional)
    UTC time when the secret was created
    Example: `2023-01-01T19:30:41.000Z`
  - `update_time` (string, optional)
    UTC time when the secret was updated
    Example: `2023-01-01T19:30:41.000Z`
  - `status` (string, optional)
    Status of the secret
    Example: `ACTIVE`
  - `expire_time` (string, optional)
    UTC time when the secret will expire. If the field is not present, the secret does not expire.
    Example: `2024-01-01T19:30:41.000Z`
- `next_page_token` (string, optional)
  A token, which can be sent as `page_token` to retrieve the next page.

## Response

```json
{
  "secrets": [
    {
      "create_time": "2023-01-01T19:30:41.000Z",
      "expire_time": "2024-01-01T19:30:41.000Z",
      "id": "09094e3230c893775eac3a9e7d912a8ad08ffd7e592feec9afd51958cb662110",
      "secret_hash": "string",
      "status": "ACTIVE",
      "update_time": "2023-01-01T19:30:41.000Z"
    }
  ]
}
```

