Create Definition
POST
/users/{user_id}/metric-definitions
const url = 'https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metric-definitions';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"display_name":"example","manual_fallback":true,"metric_type_slug":"example","resolution_operator":"priority","sources":[]}'};
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://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metric-definitions \ --header 'Content-Type: application/json' \ --data '{ "display_name": "example", "manual_fallback": true, "metric_type_slug": "example", "resolution_operator": "priority", "sources": [] }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”user_id
required
User Id
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
DefinitionCreate
object
manual_fallback
Manual Fallback
boolean
metric_type_slug
required
Metric Type Slug
string
resolution_operator
Resolution Operator
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
DefinitionRead
object
automations
required
Automations
Array<object>
AutomationReadobject
action_config
required
Action Config
object
key
additional properties
any
action_type
required
Action Type
string
enabled
required
Enabled
boolean
id
required
Id
string format: uuid
trigger_config
required
Trigger Config
object
key
additional properties
any
trigger_type
required
Trigger Type
string
enabled
required
Enabled
boolean
id
required
Id
string format: uuid
manual_fallback
required
Manual Fallback
boolean
metric_type_slug
required
Metric Type Slug
string
resolution_operator
required
Resolution Operator
string
Examplegenerated
{ "automations": [ { "action_config": {}, "action_type": "example", "enabled": true, "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "trigger_config": {}, "trigger_type": "example" } ], "display_name": "example", "enabled": true, "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "manual_fallback": true, "metric_type_slug": "example", "resolution_operator": "example", "sources": [ { "condition": {}, "rank": 1, "source": "example" } ]}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}