diff --git a/docs/sources/developers/http_api/annotations.md b/docs/sources/developers/http_api/annotations.md index c0cd017b6b7..a7314df7905 100644 --- a/docs/sources/developers/http_api/annotations.md +++ b/docs/sources/developers/http_api/annotations.md @@ -122,6 +122,10 @@ See note in the [introduction]({{< ref "#annotations-api" >}}) for an explanatio | ------------------ | ----------------------- | | annotations:create | annotations:type: | +**Required JSON Body Fields** + +- `text`: description of the annotation. + **Example Request**: ```http diff --git a/pkg/api/dtos/annotations.go b/pkg/api/dtos/annotations.go index 1f480334494..1235e077bea 100644 --- a/pkg/api/dtos/annotations.go +++ b/pkg/api/dtos/annotations.go @@ -3,14 +3,15 @@ package dtos import "github.com/grafana/grafana/pkg/components/simplejson" type PostAnnotationsCmd struct { - DashboardId int64 `json:"dashboardId"` - DashboardUID string `json:"dashboardUID,omitempty"` - PanelId int64 `json:"panelId"` - Time int64 `json:"time"` - TimeEnd int64 `json:"timeEnd,omitempty"` // Optional - Text string `json:"text"` - Tags []string `json:"tags"` - Data *simplejson.Json `json:"data"` + DashboardId int64 `json:"dashboardId"` + DashboardUID string `json:"dashboardUID,omitempty"` + PanelId int64 `json:"panelId"` + Time int64 `json:"time"` + TimeEnd int64 `json:"timeEnd,omitempty"` // Optional + // required: true + Text string `json:"text"` + Tags []string `json:"tags"` + Data *simplejson.Json `json:"data"` } type UpdateAnnotationsCmd struct { diff --git a/public/api-merged.json b/public/api-merged.json index f7d052cb916..908510961ef 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -14150,6 +14150,7 @@ }, "PostAnnotationsCmd": { "type": "object", + "required": ["text"], "properties": { "dashboardId": { "type": "integer", diff --git a/public/api-spec.json b/public/api-spec.json index 5c01a5b4bbd..9957b5cd237 100644 --- a/public/api-spec.json +++ b/public/api-spec.json @@ -12099,6 +12099,7 @@ }, "PostAnnotationsCmd": { "type": "object", + "required": ["text"], "properties": { "dashboardId": { "type": "integer",