Rotate the agent-owned credential
curl --request POST \
--url https://api.paywithlocus.com/api/credits/agent/credential/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"registrationToken": "<string>"
}
'import requests
url = "https://api.paywithlocus.com/api/credits/agent/credential/rotate"
payload = { "registrationToken": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({registrationToken: '<string>'})
};
fetch('https://api.paywithlocus.com/api/credits/agent/credential/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paywithlocus.com/api/credits/agent/credential/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'registrationToken' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paywithlocus.com/api/credits/agent/credential/rotate"
payload := strings.NewReader("{\n \"registrationToken\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.paywithlocus.com/api/credits/agent/credential/rotate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"registrationToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/agent/credential/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"registrationToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "<string>",
"onboardingState": "funding_required",
"balance": {
"usd": "<string>",
"credits": "<string>",
"creditsPerDollar": "<string>"
},
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"keyPrefix": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"credential": "<string>"
},
"identity": {
"provider": "agentid",
"email": "[email protected]"
},
"mcp": {},
"links": {},
"nextAction": {},
"activated": true,
"created": true,
"credentialRenewed": true,
"credentialRecovered": true
}
}Agent-native onboarding
Rotate the agent-owned credential
Atomically replaces the account recovery digest and bearer credential from a newly generated 24-byte base64url token, then extends expiry by 365 days.
POST
/
credits
/
agent
/
credential
/
rotate
Rotate the agent-owned credential
curl --request POST \
--url https://api.paywithlocus.com/api/credits/agent/credential/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"registrationToken": "<string>"
}
'import requests
url = "https://api.paywithlocus.com/api/credits/agent/credential/rotate"
payload = { "registrationToken": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({registrationToken: '<string>'})
};
fetch('https://api.paywithlocus.com/api/credits/agent/credential/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paywithlocus.com/api/credits/agent/credential/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'registrationToken' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paywithlocus.com/api/credits/agent/credential/rotate"
payload := strings.NewReader("{\n \"registrationToken\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.paywithlocus.com/api/credits/agent/credential/rotate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"registrationToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/agent/credential/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"registrationToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "<string>",
"onboardingState": "funding_required",
"balance": {
"usd": "<string>",
"credits": "<string>",
"creditsPerDollar": "<string>"
},
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"keyPrefix": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"credential": "<string>"
},
"identity": {
"provider": "agentid",
"email": "[email protected]"
},
"mcp": {},
"links": {},
"nextAction": {},
"activated": true,
"created": true,
"credentialRenewed": true,
"credentialRecovered": true
}
}Authorizations
Scoped lcac_ credential. Tenant-managed Agent Connections authorize only their bound MCP and wrapped execution surfaces. A bootstrap connection for a self-registered agent additionally authorizes the explicit /credits/agent/* self-service routes for its own account; neither form authorizes general tenant management.
Body
application/json
Canonical base64url encoding of 24 bytes generated by a cryptographically secure random-number generator.
Pattern:
^[A-Za-z0-9_-]{32}$