Report a view of the published app
POST
/api/workspaces/{workspaceId}/apps/{id}/usage
const url = 'http://localhost:8080/api/workspaces/example/apps/example/usage';const options = { method: 'POST', headers: {cookie: 'auth_session=<auth_session>', 'Content-Type': 'application/json'}, body: '{"kind":"open","source":"app","sessionId":"example","referrerKind":"internal","placement":{"surface":"home","shelf":"popular","position":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/workspaces/example/apps/example/usage \ --header 'Content-Type: application/json' \ --cookie auth_session=<auth_session> \ --data '{ "kind": "open", "source": "app", "sessionId": "example", "referrerKind": "internal", "placement": { "surface": "home", "shelf": "popular", "position": 1 } }'Sent by Mako’s own app views: open once per view, heartbeat every 60 s while the page is visible (each worth 60 active seconds), both carrying the view’s sessionId. Every accepted report lands in the raw event log; a repeat open inside the throttle window is logged flagged throttled and left out of the daily counters, a heartbeat flood is refused (429). API keys without a user are not viewers and are ignored. Answers 204.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string
id
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
kind
required
string
source
string
sessionId
string
referrerKind
string
placement
object
surface
required
string
shelf
required
string
position
required
integer
Responses
Section titled “Responses”Successful response
Media typeapplication/json
object
success
Whether the request succeeded.
boolean
data
Endpoint-specific response payload.
message
string
error
string
Example
{ "message": "Operation completed", "error": "Error message"}Invalid request
Media typeapplication/json
object
success
boolean
error
string
Example
{ "error": "Error message"}Internal server error
Media typeapplication/json
object
success
boolean
error
string
Example
{ "error": "Error message"}