Skip to content

Roll Service Secret

POST
/api/v1/sectors/{sectorID}/services/{id}/roll
curl --request POST \
--url https://api.spartanauth.com/api/v1/sectors/example/services/example/roll \
--header 'Content-Type: application/json' \
--data '{}'

Replaces a service secret and returns the new secret once. The previous secret can still mint tokens for 24 hours. The service name does not change. Requires sector-admin or tenant-root admin access.

sectorID
required
string
id
required
string
Media type application/json
object
Example generated
{}

A successful response.

Media type application/json
object
secret
plaintext secret — shown only once
string
service

Service is one of the customer’s own programs. Its secret mints short-lived tokens for calls to other programs in the same app sector.

object
id
string
name
string
sectorID
string
prefix
string
createdAt
string format: int64
lastExchangedAt
string format: int64
Example generated
{
"secret": "example",
"service": {
"id": "example",
"name": "example",
"sectorID": "example",
"prefix": "example",
"createdAt": "example",
"lastExchangedAt": "example"
}
}

An unexpected error response.

Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{
"code": 1,
"message": "example",
"details": [
{
"@type": "example"
}
]
}