On-demand metrics refresh for an agent
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/refresh-metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period_start": "<string>",
"period_end": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({period_start: '<string>', period_end: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/refresh-metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/refresh-metrics"
payload = {
"period_start": "<string>",
"period_end": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "refreshed",
"agent_id": "<string>",
"granularity": "5m",
"period_start": "<string>",
"period_end": "<string>",
"entries_written": 123,
"error": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Analytics
On-demand metrics refresh for an agent
Re-aggregates the cached analytics for the requested period. The
front-end passes period_start / period_end / granularity for
the window currently being viewed. The legacy fallback uses
hours_back (1..168) ending at the current hour boundary at hourly
granularity. Available to agent owners and writers.
POST
/
v1
/
agents
/
{agentId}
/
refresh-metrics
On-demand metrics refresh for an agent
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/refresh-metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period_start": "<string>",
"period_end": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({period_start: '<string>', period_end: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/refresh-metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/{agentId}/refresh-metrics"
payload = {
"period_start": "<string>",
"period_end": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "refreshed",
"agent_id": "<string>",
"granularity": "5m",
"period_start": "<string>",
"period_end": "<string>",
"entries_written": 123,
"error": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
BearerAuthOrgApiKeyAuth
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Path Parameters
Maximum string length:
64Query Parameters
Legacy fallback - number of hours back from now (max 168).
Body
application/json
Was this page helpful?