Log a custom action
POST
/api/activity-logs
const url = 'https://api.usegro.co/api/activity-logs';const options = { method: 'POST', headers: { Authorization: 'Bearer <token>', 'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json' }, body: '{"loggable_type":"order","loggable_id":"example","action":"example","description":"example","metadata":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.usegro.co/api/activity-logs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "loggable_type": "order", "loggable_id": "example", "action": "example", "description": "example", "metadata": {} }'Append a custom activity log entry to a subscription or order. The loggable_id must reference a record (subscription or order) owned by the authenticated account. The action must be prefixed with integration_ (e.g. integration_shipment_dispatched) so custom entries are distinguishable from system-generated actions.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
loggable_type
required
string
loggable_id
required
string
action
required
string
description
string
metadata
object
key
additional properties
any
Responses
Section titled “Responses”Media typeapplication/json
object
id
string format: uuid
loggable_type
string
loggable_id
string format: uuid
action
string
description
string
metadata
object
key
additional properties
any
actor_type
string
actor_name
string
created_at
string format: date-time
Example
{ "loggable_type": "order"}