Typescript (SDK)
import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.client.management.refreshSecret({
serviceId: "<id>",
clientIdentifier: "<value>",
});
console.log(result);
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.client_management.refresh_secret(service_id: '<id>', client_identifier: '<value>')
unless res.client_secret_refresh_response.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Client.Management.RefreshSecret(ctx, "<id>", "<value>")
if err != nil {
log.Fatal(err)
}
if res.ClientSecretRefreshResponse != nil {
// handle response
}
}curl --request GET \
--url https://us.authlete.com/api/{serviceId}/client/secret/refresh/{clientIdentifier} \
--header 'Authorization: Bearer <token>'{
"resultCode": "A148001",
"resultMessage": "[A148001] Successfully refreshed the client secret of the client (ID = 26478243745571).",
"newClientSecret": "6Rg_WDO23F0HSZe8GzE5_ZxRHD2pCA02M7T87s0MNOmnf8hg9eYScgeH6P_tb42yiaRuptJmMY12jwWuoy2KeA",
"oldClientSecret": "gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ"
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Client Management
Rotate Client Secret
Refresh the client secret of a client. A new value of the client secret will be generated by the Authlete server.
If you want to specify a new value, use /api/client/secret/update API.
GET
/
api
/
{serviceId}
/
client
/
secret
/
refresh
/
{clientIdentifier}
Typescript (SDK)
import { Authlete } from "@authlete/typescript-sdk";
const authlete = new Authlete({
bearer: process.env["AUTHLETE_BEARER"] ?? "",
});
async function run() {
const result = await authlete.client.management.refreshSecret({
serviceId: "<id>",
clientIdentifier: "<value>",
});
console.log(result);
}
run();require 'authlete_ruby_sdk'
Models = ::Authlete::Models
s = ::Authlete::Client.new(
bearer: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.client_management.refresh_secret(service_id: '<id>', client_identifier: '<value>')
unless res.client_secret_refresh_response.nil?
# handle response
endpackage main
import(
"context"
"os"
authlete "github.com/authlete/authlete-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := authlete.New(
authlete.WithSecurity(os.Getenv("AUTHLETE_BEARER")),
)
res, err := s.Client.Management.RefreshSecret(ctx, "<id>", "<value>")
if err != nil {
log.Fatal(err)
}
if res.ClientSecretRefreshResponse != nil {
// handle response
}
}curl --request GET \
--url https://us.authlete.com/api/{serviceId}/client/secret/refresh/{clientIdentifier} \
--header 'Authorization: Bearer <token>'{
"resultCode": "A148001",
"resultMessage": "[A148001] Successfully refreshed the client secret of the client (ID = 26478243745571).",
"newClientSecret": "6Rg_WDO23F0HSZe8GzE5_ZxRHD2pCA02M7T87s0MNOmnf8hg9eYScgeH6P_tb42yiaRuptJmMY12jwWuoy2KeA",
"oldClientSecret": "gXz97ISgLs4HuXwOZWch8GEmgL4YMvUJwu3er_kDVVGcA0UOhA9avLPbEmoeZdagi9yC_-tEiT2BdRyH9dbrQQ"
}{
"resultCode": "A001201",
"resultMessage": "[A001201] /auth/authorization, TLS must be used."
}{
"resultCode": "A001202",
"resultMessage": "[A001202] /auth/authorization, Authorization header is missing."
}{
"resultCode": "A001215",
"resultMessage": "[A001215] /auth/authorization, The client (ID = 26837717140341) is locked."
}{
"resultCode": "A001311",
"resultMessage": "[A001311] /auth/authorization, Too many requests, retry after 1 seconds. (Entity: 23769878923/87122303)"
}{
"resultCode": "A001101",
"resultMessage": "[A001101] /auth/authorization, Authlete Server error."
}Authorizations
Authenticate every request with a Service Access Token or Organization Token.
Set the token value in the Authorization: Bearer <token> header.
Service Access Token: Scoped to a single service. Use when automating service-level configuration or runtime flows.
Organization Token: Scoped to the organization; inherits permissions across services. Use for org-wide automation or when managing multiple services programmatically.
Both token types are issued by the Authlete console or provisioning APIs.
Path Parameters
A service ID.
The client ID or the client ID alias of a client.