---
title: "Create a private location"
method: POST
path: "/api/v1/synthetics/private-locations"
tags: ["Synthetics"]
---

# Create a private location

`POST /api/v1/synthetics/private-locations`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v1/synthetics/private-locations`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `synthetics_private_location_write`

Create a new Synthetic private location.

## Request body

- SyntheticsPrivateLocation: Object containing information about the private location to create.
  - `description` string, required: Description of the private location.
  - `id` string: Unique identifier of the private location.
  - `metadata` SyntheticsPrivateLocationMetadata: Object containing metadata about the private location.
    - `restricted_roles` string[]: A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions.
  - `name` string, required: Name of the private location.
  - `secrets` SyntheticsPrivateLocationSecrets: Secrets for the private location. Only present in the response when creating the private location.
    - `authentication` SyntheticsPrivateLocationSecretsAuthentication: Authentication part of the secrets.
      - `id` string: Access key for the private location.
      - `key` string: Secret access key for the private location.
    - `config_decryption` SyntheticsPrivateLocationSecretsConfigDecryption: Private key for the private location.
      - `key` string: Private key for the private location.
  - `tags` string[], required: Array of tags attached to the private location.

## Response `200`

OK

- SyntheticsPrivateLocationCreationResponse: Object that contains the new private location, the public key for result encryption, and the configuration skeleton.
  - `config` object: Configuration skeleton for the private location. See installation instructions of the private location on how to use this configuration.
  - `private_location` SyntheticsPrivateLocation: Object containing information about the private location to create.
    - `description` string, required: Description of the private location.
    - `id` string: Unique identifier of the private location.
    - `metadata` SyntheticsPrivateLocationMetadata: Object containing metadata about the private location.
      - `restricted_roles` string[]: A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions.
    - `name` string, required: Name of the private location.
    - `secrets` SyntheticsPrivateLocationSecrets: Secrets for the private location. Only present in the response when creating the private location.
      - `authentication` SyntheticsPrivateLocationSecretsAuthentication: Authentication part of the secrets.
        - `id` string: Access key for the private location.
        - `key` string: Secret access key for the private location.
      - `config_decryption` SyntheticsPrivateLocationSecretsConfigDecryption: Private key for the private location.
        - `key` string: Private key for the private location.
    - `tags` string[], required: Array of tags attached to the private location.
  - `result_encryption` SyntheticsPrivateLocationCreationResponseResultEncryption: Public key for the result encryption.
    - `id` string: Fingerprint for the encryption key.
    - `key` string: Public key for result encryption.

## Other responses

- `402`: Quota reached for private locations
- `404`: Private locations are not activated for the user
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v1-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/revisions/ca5871004d26?raw)
