Skip to main content

Service Principal Secret

View as Markdown

List GA

GET /api/2.0/accounts/{account_id}/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

Parameters

account_idstringpath

The account ID.

service_principalstringpath

The service principal ID.

page_tokenstringquery

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_sizeint32query

Default: 100

Response

secretsarray of object

List of the secrets

Show child attributesHide child attributes
idstring

ID of the secret

Example: 09094e3230c893775eac3a9e7d912a8ad08ffd7e592feec9afd51958cb662110

secretstring

Secret Value

Example: x8ipcf0482bcaah6b3dfcb3fb217461f8b83

secret_hashstring

Secret Hash

create_timestring

UTC time when the secret was created

Example: 2023-01-01T19:30:41.000Z

update_timestring

UTC time when the secret was updated

Example: 2023-01-01T19:30:41.000Z

statusstring

Status of the secret

Example: ACTIVE

expire_timestring

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_tokenstring

A token, which can be sent as page_token to retrieve the next page.

Create GA

POST /api/2.0/accounts/{account_id}/servicePrincipals/{service_principal}/credentials/secrets

Create a secret for the given service principal.

API scopes: authentication

Parameters

account_idstringpath

The account ID.

service_principalstringpath

The service principal ID.

Request body

lifetimestring

The lifetime of the secret in seconds. If this parameter is not provided, the secret will have a default lifetime of 730 days (63072000s).

Example: 31536000s

Response

idstring

ID of the secret

Example: 09094e3230c893775eac3a9e7d912a8ad08ffd7e592feec9afd51958cb662110

secretstring

Secret Value

Example: x8ipcf0482bcaah6b3dfcb3fb217461f8b83

secret_hashstring

Secret Hash

create_timestring

UTC time when the secret was created

Example: 2023-01-01T19:30:41.000Z

update_timestring

UTC time when the secret was updated

Example: 2023-01-01T19:30:41.000Z

statusstring

Status of the secret

Example: ACTIVE

expire_timestring

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

Delete GA

DELETE /api/2.0/accounts/{account_id}/servicePrincipals/{service_principal}/credentials/secrets/{secret_id}

Delete a secret from the given service principal.

API scopes: authentication

Parameters

account_idstringpath

The account ID.

service_principalstringpath

The service principal ID.

secret_idstringpath

The secret ID.