Overview
POST
/usage/usage-eventsusageCreate usage_events
Create a record in usage-events.
Auth: bearerAuth — calls run as the authenticated user.
Request body
application/json · optional
- scopestring
- principalIdstring
- ecosystemIdoptionalstring?
- routestring
- methodstring
- statusinteger
- requestBytesinteger
- responseBytesinteger
- occurredAtstring
Example
{
"scope": "string",
"principalId": "string",
"ecosystemId": "string",
"route": "string",
"method": "string",
"status": 0,
"requestBytes": 0,
"responseBytes": 0,
"occurredAt": "string"
}Responses
201
usage_events
- idinteger
- scopestring
- principalIdstring
- ecosystemIdstring?
- routestring
- methodstring
- statusinteger
- requestBytesinteger
- responseBytesinteger
- occurredAtstring
Example
{
"id": 0,
"scope": "string",
"principalId": "string",
"ecosystemId": "string",
"route": "string",
"method": "string",
"status": 0,
"requestBytes": 0,
"responseBytes": 0,
"occurredAt": "string"
}400
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}401
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/usage/usage-events" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"scope": "string",
"principalId": "string",
"ecosystemId": "string",
"route": "string",
"method": "string",
"status": 0,
"requestBytes": 0,
"responseBytes": 0,
"occurredAt": "string"
}'JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/usage/usage-events", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: "{\n \"scope\": \"string\",\n \"principalId\": \"string\",\n \"ecosystemId\": \"string\",\n \"route\": \"string\",\n \"method\": \"string\",\n \"status\": 0,\n \"requestBytes\": 0,\n \"responseBytes\": 0,\n \"occurredAt\": \"string\"\n}",
});
const data = await res.json();