﻿---
title: stack kb apm-annotations create-annotation cli command
description: Create a service annotation Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4116/reference/elastic-cli/cli/stack/kb/apm-annotations/create-annotation
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb apm-annotations create-annotation cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb apm-annotations create-annotation \
  --service-name <service-name> \
  --@timestamp <@timestamp> \
  --service <service> \
  [options]
```

Create a service annotation
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--service-name string required">
    The name of the service
  </definition>
  <definition term="--@timestamp string required">
    The date and time of the annotation. It must be in ISO 8601 format.
  </definition>
  <definition term="--service string required">
    The service that identifies the configuration to create or update.
  </definition>
  <definition term="--message string">
    The message displayed in the annotation. It defaults to `service.version`.
  </definition>
  <definition term="--tags string[]">
    Tags are used by the Applications UI to distinguish APM annotations from other annotations. Tags may have additional functionality in future releases. It defaults to `[apm]`. While you can add additional tags, you cannot remove the `apm` tag.
    **Repeatable:** pass `--tags` multiple times to supply more than one value
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>