Upsert Data Points
Create or update multiple data points for a metric (limited to up to 50 data points per request).
If you don't know the metric's ID you can get it from the metric's URL in the app:
https://app.visible.vc/companies/{company_id}/data/metrics/{metric_id}
.
Responses
-
Data points successfully upserted
-
Bad Request - The request is invalid or malformed
-
Unauthorized - Invalid or missing authentication token
-
Not Found - The requested resource was not found
-
Unprocessable Entity - The request is valid but contains semantic errors
-
Too Many Requests - Rate limit exceeded
PUT
/metrics/{metric_id}/data_points
curl \
--request PUT 'https://api.visible.vc/metrics/{metric_id}/data_points' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"data_points":[{"date":"2019-01-01","value":"10.99"},{"date":"2019-02-01","value":"20.99"}]}'
Request example
{
"data_points": [
{
"date": "2019-01-01",
"value": "10.99"
},
{
"date": "2019-02-01",
"value": "20.99"
}
]
}
Response examples (200)
{
"data_points": [
{
"id": "e68ab11c-a41b-4725-976f-62542883a392",
"date": "2019-01-01",
"value": "10.99",
"metric_id": "cad09a10-73e8-4205-ae67-4e6156f37be8"
},
{
"id": "af692eaf-c8de-4a09-883b-1c12dbdf13ff",
"date": "2019-02-01",
"value": "20.99",
"metric_id": "cad09a10-73e8-4205-ae67-4e6156f37be8"
}
]
}
Response examples (400)
{
"errors": [
{
"type": "parameter_invalid",
"field": "filter",
"message": "must be an object"
}
]
}
Response examples (401)
{
"errors": [
{
"type": "unauthorized"
}
]
}
Response examples (404)
{
"errors": [
{
"type": "record_missing"
}
]
}
Response examples (422)
{
"errors": [
{
"type": "attribute_invalid",
"field": "value",
"message": "required"
}
]
}
Response examples (429)
{
"errors": [
{
"type": "rate_limit_exceeded"
}
]
}