Skip to main content
POST
/
metrics
Create a billable metric
curl --request POST \
  --url https://api.alguna.io/metrics \
  --header 'Alguna-Version: <alguna-version>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "aggregation": {
    "method": "sum",
    "field": "amount"
  },
  "event_name": "api_call",
  "name": "API Calls",
  "description": "Counts API calls per customer",
  "filter_groups": [
    {
      "filters": [
        {
          "field": "region",
          "operator": "equal",
          "value": "us-east-1"
        }
      ],
      "operator": "and"
    }
  ],
  "tag_ids": [
    "<string>"
  ]
}
'
{
  "aggregation": {
    "field": "amount",
    "method": "sum"
  },
  "created_at": "2026-04-01T10:00:00Z",
  "event_name": "api_call",
  "id": "mtr_01H1VECT",
  "name": "API Calls",
  "updated_at": "2026-04-01T12:30:00Z",
  "description": "Counts API calls per customer",
  "filter_groups": [
    {
      "filters": [
        {
          "field": "region",
          "operator": "equal",
          "value": "us-east-1"
        }
      ],
      "operator": "and"
    }
  ],
  "tag_ids": [
    "<string>"
  ]
}

Documentation Index

Fetch the complete documentation index at: https://alguna.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Headers

Alguna-Version
enum<string>
required
Available options:
2026-04-01
Idempotency-Key
string

A unique string used to ensure the request is processed exactly once. If you retry a request with the same idempotency key within 24 hours, the original response is returned without re-executing the operation.

Maximum string length: 255
Example:

"ik_a1b2c3d4e5f6"

Body

application/json
aggregation
object
required

How events are aggregated into a metric value

event_name
string
required

Event name that triggers this metric

Example:

"api_call"

name
string
required

Name of the metric

Example:

"API Calls"

description
string | null

Description of the metric

Example:

"Counts API calls per customer"

filter_groups
object[]

Filter groups to apply to events before aggregation

tag_ids
string[]

Tag identifiers to associate with this metric

Response

Success

aggregation
object
required

How events are aggregated into a metric value

created_at
string<date-time>
required

Timestamp when the metric was created

Example:

"2026-04-01T10:00:00Z"

event_name
string
required

Event name that triggers this metric

Example:

"api_call"

id
string
required

Unique identifier for the metric

Example:

"mtr_01H1VECT"

name
string
required

Name of the metric

Example:

"API Calls"

updated_at
string<date-time>
required

Timestamp when the metric was last updated

Example:

"2026-04-01T12:30:00Z"

description
string | null

Description of the metric

Example:

"Counts API calls per customer"

filter_groups
object[]

Filter groups applied to events before aggregation

tag_ids
string[]

Tag identifiers associated with this metric