---
type: api
title: Create a security project
description: The response will include the created project details, such as the project ID, the credentials to access the project, and the endpoints to access different apps such as Elasticsearch and Kibana. The credentials can be regenerated at any time using the _reset-credentials endpoint.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-serverless/operation/operation-createsecurityproject
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-serverless/operation/operation-createsecurityproject
products:
  - Elastic Cloud Serverless
---

# Create a security project

- Server: `https://api.elastic-cloud.com`

## Paths

- `POST` `/api/v1/serverless/projects/security`

## Description

The response will include the created project details, such as the project ID, the credentials to access the project, and the endpoints to access different apps such as Elasticsearch and Kibana. The credentials can be regenerated at any time using the _reset-credentials endpoint.

## Authentication

- Api key: `Authorization: <value>`
  API keys are used to authenticate requests to the Elastic Cloud Serverless REST API.
  Generate your secret API key in https://cloud.elastic.co/account/keys
  You must provide the API key for all API requests in the Authorization header as follows:
  
  ```
  "Authorization: ApiKey $API_KEY"
  ```
  
  For example, if you interact with the API using the curl command:
  
  ```
  curl -H "Authorization: ApiKey essu_..." https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch
  ```

## Query string parameters

- `exclude_credentials` (boolean) — optional
  If true, the username and password fields in the response credentials are set to empty strings and no usable credentials are returned. Credentials can be retrieved later using the _reset-credentials endpoint.

## Request body

Configuration of the security project to create.

`application/json`

- `name` (string · min length: 1 · max length: 255) — required
  Descriptive name for a project.
- `alias` (string · min length: 1 · max length: 50 · pattern: ^[a-zA-Z]{1}(?:[a-zA-Z0-9-]*[a-zA-Z0-9]{1})?$) — optional
  A custom domain label compatible with RFC-1035 standards. Derived from the project name by default.
- `region_id` (string) — required
  Unique human-readable identifier for a region in Elastic Cloud.
- `admin_features_package` (enum) — optional
  admin features package (BYOK, BYOIDP, CCS, CCR)
  Values: `standard`, `enterprise`
- `product_types` (object[] · min items: 1 · max items: 3 · default: [
  {
    "product_line": "security",
    "product_tier": "complete"
  },
  {
    "product_line": "cloud",
    "product_tier": "complete"
  },
  {
    "product_line": "endpoint",
    "product_tier": "complete"
  }
]) — optional
  - `product_line` (enum) — required
    The identifier of the Security Solution product line.
    Values: `security`, `cloud`, `endpoint`
  - `product_tier` (enum) — required
    The identifier of the Security Solution product tier.
    Values: `complete`, `essentials`
- `search_lake` (object) — optional
  Configuration for the entire set of capabilities that make the data searchable in Security.
  - `data_retention` (object) — optional — nullable
    Configuration to control the data retention in Elasticsearch data streams.
    - `max_retention_days` (integer · min: 7 · max: 3681) — optional — nullable
      Maximum number of days allowed for retaining data in Elasticsearch data streams. Can be set to "null" for unlimited. A default of 396 will be applied if no value is specified on project creation.
    - `default_retention_days` (integer · min: 7 · max: 3681) — optional — nullable
      Default number of days during which data remains available in Elasticsearch data streams. Can be set to "null" for unlimited. A default of 396 will be applied if no value is specified on project creation.
- `traffic_filters` (object[]) — optional
  traffic filters IDs
  - `id` (string) — required
    traffic filter ID
- `linked` (object) — optional
  Configuration for linked projects associated with this project
  - `projects` (map string to object · min properties: 1) — required
    Map values (object)
    - `type` (enum) — required
      The type of the linked project
      Values: `elasticsearch`, `observability`, `security`, `vectordb`
- `metadata` (object) — optional
  Metadata request for a project with tags.
  - `tags` (map string to string · min properties: 1 · max properties: 64) — required
    Tags associated with a project in the form of key-value pairs. Tags are limited to a minimum of 1 and a maximum of 64 per project. Each tag key must begin with a lowercase letter (a-z), contain only lowercase letters, digits, underscores, and hyphens (a-z0-9_-), and have a maximum length of 32 characters.
    Map values (string · min length: 1 · max length: 128 · pattern: ^[a-z0-9][a-z0-9_-]*$)

## Responses

#### `201`

The created security project.

`application/json`

- `id` (string · pattern: ^[a-z0-9]{32}$)
  ID of the project.
- `name` (string · min length: 1 · max length: 255)
  Descriptive name for a project.
- `alias` (string · min length: 8 · max length: 57 · pattern: ^[a-zA-Z]{1}(?:[a-zA-Z0-9-]*[a-zA-Z0-9]{1})?$)
  A domain label compatible with RFC-1035 standards. Project alias with a unique suffix added by the system to avoid naming conflicts.
- `region_id` (string)
  Unique human-readable identifier for a region in Elastic Cloud.
- `metadata` (object)
  Additional details about the project.
  - `created_at` (string · format: date-time)
    Date and time when the project was created.
  - `created_by` (string)
    ID of the user.
  - `organization_id` (string)
    The Organization ID who owns the project.
  - `suspended_at` (string · format: date-time)
    Date and time when the project was suspended.
  - `suspended_reason` (string)
    Reason why the project was suspended.
  - `tags` (map string to string · min properties: 1 · max properties: 64)
    Tags associated with a project in the form of key-value pairs. Tags are limited to a minimum of 1 and a maximum of 64 per project. Each tag key must begin with a lowercase letter (a-z), contain only lowercase letters, digits, underscores, and hyphens (a-z0-9_-), and have a maximum length of 32 characters.
    Map values (string · min length: 1 · max length: 128 · pattern: ^[a-z0-9][a-z0-9_-]*$)
  - `system_tags` (map string to string)
    System tags associated with a project in the form of key-value pairs. These tags are added by the internal system and are read-only. The keys are prefixed with an underscore to differentiate them from user tags.
    Map values (string · min length: 1 · max length: 128 · pattern: ^[a-z0-9][a-z0-9_-]*$)
- `cloud_id` (string)
  The cloud ID, an encoded string that provides other Elastic services with the necessary information to connect to this Elasticsearch and Kibana.
- `traffic_filters` (object[])
  traffic filters IDs
  - `id` (string)
    traffic filter ID
- `linked` (object)
  Configuration for projects linked to this project
  - `projects` (map string to object)
    Map values (object)
    - `status` (enum)
      The state of the linked project.
      Values: `enabled`, `suspended`, `deleted`
    - `type` (enum)
      The type of the linked project
      Values: `elasticsearch`, `observability`, `security`, `vectordb`
- `type` (enum)
  the type of the project
  Values: `security`
- `endpoints` (object)
  The endpoints to access the different apps of the project.
  - `elasticsearch` (string)
    The endpoint to access elasticsearch.
  - `kibana` (string)
    The endpoint to access kibana.
  - `ingest` (string)
    The endpoint to access the Managed OTLP Endpoint.
- `private_endpoints` (object)
  Private endpoints (URLs) for Security projects when PrivateLink is enabled.
  - `elasticsearch` (string)
    The PrivateLink endpoint URL to access elasticsearch.
  - `kibana` (string)
    The PrivateLink endpoint URL to access kibana.
  - `ingest` (string)
    The PrivateLink endpoint URL to access the Managed OTLP Endpoint.
- `search_lake` (object)
  Configuration for the entire set of capabilities that make the data searchable in Security.
  - `data_retention` (object) — nullable
    Configuration to control the data retention in Elasticsearch data streams.
    - `max_retention_days` (integer · min: 7 · max: 3681) — nullable
      Maximum number of days allowed for retaining data in Elasticsearch data streams. Can be set to "null" for unlimited. A default of 396 will be applied if no value is specified on project creation.
    - `default_retention_days` (integer · min: 7 · max: 3681) — nullable
      Default number of days during which data remains available in Elasticsearch data streams. Can be set to "null" for unlimited. A default of 396 will be applied if no value is specified on project creation.
- `admin_features_package` (enum)
  admin features package (BYOK, BYOIDP, CCS, CCR)
  Values: `standard`, `enterprise`
- `product_types` (object[] · min items: 1 · max items: 3 · default: [
  {
    "product_line": "security",
    "product_tier": "complete"
  },
  {
    "product_line": "cloud",
    "product_tier": "complete"
  },
  {
    "product_line": "endpoint",
    "product_tier": "complete"
  }
])
  - `product_line` (enum)
    The identifier of the Security Solution product line.
    Values: `security`, `cloud`, `endpoint`
  - `product_tier` (enum)
    The identifier of the Security Solution product tier.
    Values: `complete`, `essentials`
- `credentials` (object)
  Basic auth credentials to access the Elasticsearch API.
  - `username` (string)
    Basic auth username that can be used to access the Elasticsearch API.
  - `password` (string · format: password)
    Basic auth password that can be used to access the Elasticsearch API.
##### Response headers

- `ETag` (string)

#### `400`

Bad request

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
#### `422`

Unprocessable entity

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
## Code examples

#### curl

```curl
curl -X POST "https://api.elastic-cloud.com/api/v1/serverless/projects/security" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my project",
    "region_id": "aws-us-east-1"
  }'
```

