﻿---
title: stack kb synthetics post-private-location cli command
description: Create a private location Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4492/reference/elastic-cli/cli/stack/kb/synthetics/post-private-location
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb synthetics post-private-location cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb synthetics post-private-location \
  --agent-policy-id <agent-policy-id> \
  --label <label> \
  [options]
```

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

## Options

<definitions>
  <definition term="--agent-policy-id string required">
    The ID of the agent policy associated with the private location.
  </definition>
  <definition term="--label string required">
    A label for the private location.
  </definition>
  <definition term="--geo string">
    Geographic coordinates (WGS84) for the location.
  </definition>
  <definition term="--spaces string[]">
    An array of space IDs where the private location is available. If it is not provided, the private location is available in all spaces.
    **Repeatable:** pass `--spaces` multiple times to supply more than one value
  </definition>
  <definition term="--tags string[]">
    An array of tags to categorize the private location.
    **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>
  <definition term="--no-validate">
    skip input validation and send the request as-is
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--output-fields string">
    comma-separated list of fields to include in output (dot-notation supported)
  </definition>
  <definition term="--output-template string">
    Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
  </definition>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>