DocsAPIMetrics

Insert metrics for a company

Insert one or more company metric(s).

POST
/metrics
Body

Example: 42

Example: false

Request Body

application/jsonOptional
company_idRequiredstring

Company ID

Pattern: "^\\d+$"
metricsRequiredarray<object>

Metrics to insert

dangerously_upsertboolean

If true, upserts on (company_id, name, period_label, source_id) conflict

Credentials

Bearer
curl -X POST "https://api.fundra.com/v1/metrics" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "company_id": "42",
    "metrics": [
      {
        "name": "revenue",
        "value": 1500000,
        "currency": "USD",
        "period_type": "month",
        "period_start": "2024-01",
        "period_end": "2024-03"
      }
    ],
    "dangerously_upsert": false
  }'

Metrics inserted successfully

{
  "success": true,
  "inserted": 5
}