Roll Service Secret
POST
/api/v1/sectors/{sectorID}/services/{id}/roll
const url = 'https://api.spartanauth.com/api/v1/sectors/example/services/example/roll';const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” sectorID
required
string
id
required
string
Request Body
Section titled “Request Body ” Media type application/json
object
Example generated
{}Responses
Section titled “ Responses ”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" }}default
Section titled “default ”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" } ]}