Metrics

Metrics are real-time widgets that . They are versatile and can include icons, symbols, and be used to display any information you want in any of your projects.

SaasHound Events

Endpoint Url

POST
https://api.saashound.co/send-metric

This endpoint allows you to send a metric to SaasHound.

Request Headers

Parameter Type Description Required
Content-Type * string application/json Required
Authorization * string Bearer <TOKEN> Required

Request Params

Parameter Type Description Required
project string The project associated with the metric Optional
title string The title of the metric Optional
value string | boolean | number The value of the metric. If increment is set to true, value will be updated by the new value Optional
icon emoji The icon associated with the metric Optional
symbol string The symbol associated with the metric, e.g. $, %, etc. Optional
increment boolean If true, the value will be incremented by the new value Optional

Response

{
success: true,
statusCode: 200,
}

Example Code

Terminal window
curl --location --request POST 'https://api.saashound.com/send-metric' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Users",
"value": 1254,
"icon": "👥"
}'

Incrementing Metric Values

When sending a metric, you can choose to increment the value of the metric by setting the increment property to true. This will add the value to the existing value of the metric.

For example, if you send a metric with a value of 1254 and then send another metric with a value of 5 and increment set to true, the value of the metric will be 1259.

Example Code

Terminal window
curl --location --request POST 'https://api.saashound.com/send-metric' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"project": "my-project",
"title": "Customers",
"value": 1259,
"icon": "👥",
"increment": true,
}'