Spending policy for an agent
GET
/merchants/agent-policies/{agentId}
const url = 'https://hub.stablezact.com/api/v1/merchants/agent-policies/example';const options = {method: 'GET', headers: {'X-Public-Key': '<X-Public-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://hub.stablezact.com/api/v1/merchants/agent-policies/example \ --header 'X-Public-Key: <X-Public-Key>'Returns policy: null with a message when no policy exists, rather than 404. Check the field, not the status code. The DELETE on this path does return 404 for an agent that does not exist, so the two verbs disagree.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”agentId
required
string
Responses
Section titled “Responses”The policy, or null with a message.
Media typeapplication/json
object
success
boolean
policy
object | null
message
string
Examplegenerated
{ "success": true, "policy": "example", "message": "example"}Missing or invalid credentials.
Media typeapplication/json
object
success
boolean
error
required
Short machine-ish reason.
string
message
Longer explanation, when there is one.
string
Example
{ "error": "API credentials required. Use x-public-key header or x-api-key and x-api-secret headers."}