Chart Annotations API
Endpoint
Region | Endpoint |
---|---|
Standard Server | |
EU Residency Server |
Chart Annotations API
The Chart Annotations API allows you to programmatically annotate important dates (e.g. feature releases and marketing campaigns) on your organization's charts with a horizontal axis of calendar dates.
Create an Annotation
Authenticate via basic authentication with the credentials API_Key:Secret_Key.
POST https://amplitude.com/api/2/annotations
Below are the required parameters you will need to create an annotation programmatically.
Parameter | Type | Description |
---|---|---|
app_id (required) | integer | The Project ID of the project your chart belongs to. |
date (required) | date | Date (YYYY-MM-DD) of the annotation. |
label (required) | string | The title of your annotation. |
chart_id (optional) | string | The ID of the chart (found in URL) you wish to annotate. |
details (optional) | string | Additional details you would like to add to the annotation. |
IMPORTANT: If you do not include a chart_id, the annotation will be global.
Example Request
curl -d "label=Version 2.4 Release&date=2018-09-16&details=Added new user properties.&chart_id=c4cbl1k" -u API_Key:Secret_Key -X POST https://amplitude.com/api/2/annotations
Example Response
{
"annotation":
{
"date": "2018-09-16",
"details": "Added new user properties.",
"id": 50079,
"label": "Version 2.4 Release"
}
"success": true
}
Get an Annotation
Authenticate via basic authentication with the credentials API_Key:Secret_Key.
POST https://amplitude.com/api/2/annotations/<id>
Below are the required parameters you will need to get a specific annotation.
Parameter | Type | Description |
---|---|---|
id (required) | integer | The ID of your annotation, which was returned when you created the annotation programmatically. |
Example Request
curl -u API_Key:Secret_Key -X GET https://amplitude.com/api/2/annotations/50079
Example Response
{
"annotation":
{
"date": "2018-09-16",
"details": "Added new user properties.",
"id": 50079,
"label": "Version 2.4 Release"
}
}
Get All Annotations
Authenticate via basic authentication with the credentials API_Key:Secret_Key. This call will help you fetch all annotations in your project.
Example Request
curl -u API_Key:Secret_Key -X GET https://amplitude.com/api/2/annotations
Example Response
{
"annotation":
{
"date": "2018-09-16",
"details": "Added new user properties.",
"id": 50079,
"label": "Version 2.4 Release"
}
}
Updated 5 months ago