Create a service annotation

POST /api/apm/services/{serviceName}/annotation

Create a new annotation for a specific service.

Headers

  • elastic-api-version string Required

    The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Path parameters

  • serviceName string Required

    The name of the service

application/json

Body Required

  • @timestamp string Required

    Timestamp

  • message string

    Message

  • service object Required

    Service

    Hide service attributes Show service attributes object
    • environment string
    • version string Required
  • tags array[string]

    Tags

Responses

  • 200 application/json

    Annotation created successfully

    Hide response attributes Show response attributes object
    • _id string

      Identifier

    • _index string

      Index

    • _source object

      Response

      Hide _source attributes Show _source attributes object
      • @timestamp string
      • annotation object
        Hide annotation attributes Show annotation attributes object
        • title string
        • type string
      • event object
        Hide event attribute Show event attribute object
        • created string
      • message string
      • service object
        Hide service attributes Show service attributes object
        • environment string
        • name string
        • version string
      • tags array[string]
  • 400 application/json

    Bad Request response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 401 application/json

    Unauthorized response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 403 application/json

    Forbidden response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 404 application/json

    Not found response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

POST /api/apm/services/{serviceName}/annotation
curl \
 --request POST 'https://localhost:5601/api/apm/services/{serviceName}/annotation' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "elastic-api-version: 2023-10-31" \
 --header "kbn-xsrf: true" \
 --data '{"@timestamp":"string","message":"string","service":{"environment":"string","version":"string"},"tags":["string"]}'