Skip to main content
POST
/
api
/
metrics
Create metric
curl --request POST \
  --url https://dev.exante.app/api/metrics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "uid": "party_dso",
  "name": "Party DSO",
  "context_type": "ORGANIZATION",
  "description": "<string>",
  "formula": "<string>",
  "value_type": "count",
  "storage_unit": "raw",
  "is_snapshot": false,
  "period_definition": "as_of_date",
  "is_active": true
}
'
{
  "status": "success",
  "status_code": 200,
  "message": "<string>",
  "data": {
    "uid": "dso",
    "name": "Days Sales Outstanding",
    "context_type": "ORGANIZATION",
    "description": "<string>",
    "formula": "(Average AR / Credit Sales) x Days in period",
    "value_type": "currency",
    "storage_unit": "raw",
    "is_snapshot": true,
    "period_definition": "as_of_date",
    "is_active": true,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}
Creates a metric definition.

Notes

  • uid should be stable and machine-readable (for example, total_ar).
  • name is the human-readable display label (for example, Total AR Outstanding).
  • context_type, value_type, storage_unit, is_snapshot, and period_definition are treated as immutable after creation.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
uid
string
required

Machine-readable identifier (snake_case, unique)

Example:

"party_dso"

name
string
required
Example:

"Party DSO"

context_type
enum<string>
default:ORGANIZATION
Available options:
ORGANIZATION,
PARTY,
USER
description
string
formula
string
value_type
enum<string>
default:count
Available options:
currency,
percentage,
days,
count,
ratio
storage_unit
enum<string>
default:raw
Available options:
raw,
cents
is_snapshot
boolean
default:false
period_definition
enum<string>

Defines how metric_date should be interpreted for this metric.

Available options:
as_of_date,
trailing_30_days,
calendar_month,
month_to_date
is_active
boolean
default:true

Response

Metric created

status
string
Example:

"success"

status_code
integer
Example:

200

message
string
data
object