- Elastic Cloud Serverless
- Elasticsearch
- Elastic Observability
- Get started
- Observability overview
- Elastic Observability Serverless billing dimensions
- Create an Observability project
- Quickstart: Monitor hosts with Elastic Agent
- Quickstart: Monitor your Kubernetes cluster with Elastic Agent
- Quickstart: Monitor hosts with OpenTelemetry
- Quickstart: Unified Kubernetes Observability with Elastic Distributions of OpenTelemetry (EDOT)
- Quickstart: Collect data with AWS Firehose
- Get started with dashboards
- Applications and services
- Application performance monitoring (APM)
- Get started with traces and APM
- Learn about data types
- Collect application data
- View and analyze data
- Act on data
- Use APM securely
- Reduce storage
- Managed intake service event API
- Troubleshooting
- Synthetic monitoring
- Get started
- Scripting browser monitors
- Configure lightweight monitors
- Manage monitors
- Work with params and secrets
- Analyze monitor data
- Monitor resources on private networks
- Use the CLI
- Configure a Synthetics project
- Multifactor Authentication for browser monitors
- Configure Synthetics settings
- Grant users access to secured resources
- Manage data retention
- Scale and architect a deployment
- Synthetics Encryption and Security
- Troubleshooting
- Application performance monitoring (APM)
- Infrastructure and hosts
- Logs
- Inventory
- Incident management
- Data set quality
- Observability AI Assistant
- Machine learning
- Reference
- Limitations
- Get started
- Elastic Security
- Elastic Security overview
- Security billing dimensions
- Create a Security project
- Elastic Security requirements
- Elastic Security UI
- AI for Security
- Ingest data
- Configure endpoint protection with Elastic Defend
- Manage Elastic Defend
- Endpoints
- Policies
- Trusted applications
- Event filters
- Host isolation exceptions
- Blocklist
- Optimize Elastic Defend
- Event capture and Elastic Defend
- Endpoint protection rules
- Allowlist Elastic Endpoint in third-party antivirus apps
- Elastic Endpoint self-protection features
- Elastic Endpoint command reference
- Endpoint response actions
- Cloud Security
- Explore your data
- Dashboards
- Detection engine overview
- Rules
- Alerts
- Advanced Entity Analytics
- Investigation tools
- Asset management
- Manage settings
- Troubleshooting
- Manage your project
- Changelog
Using the Project Management REST API
editUsing the Project Management REST API
editYou can manage serverless projects using the Elastic Cloud Serverless REST API. This API allows you to create, update, and delete projects, as well as manage project features and usage.
More APIs let you interact with data, capabilities, and settings inside of specific projects. Refer to the Serverless API reference page.
API Principles
edit-
The Elastic Cloud REST API is built following REST principles:
- Resources (such as projects) are represented as URIs.
- Standard HTTP response codes and verbs are used (GET, POST, PUT, PATCH and DELETE).
- API calls are stateless. Every request that you make happens in isolation from other calls and must include all the information necessary to fulfill the request.
- JSON is the data interchange format.
Authentication
editAPI keys are used to authenticate requests to the Elastic Cloud REST API. Learn how to create API 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
Open API Specification
editThe Project Management API is documented using the OpenAPI Specification. The current supported version of the specification is 3.0
.
For details, check the API reference or download the OpenAPI Specification.
This specification can be used to generate client SDKs, or on tools that support it, such as the Swagger Editor.
Examples
editTo try the examples in this section:
- Create an API key.
-
Store the generated API key as an environment variable so that you don’t need to specify it again for each request:
export API_KEY="YOUR_GENERATED_API_KEY"
Create an Elasticsearch Serverless project
editcurl -H "Authorization: ApiKey $API_KEY" \ -H "Content-Type: application/json" \ "https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch" \ -XPOST --data '{ "name": "My project", "region_id": "aws-us-east-1" }'
Replace |
|
You can obtain a list of available regions. |
The response from the create project request 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.
Example of Create project
response:
{ "id": "cace8e65457043698ed3d99da2f053f6", "endpoints": { "elasticsearch": "https://sample-project-c990cb.es.us-east-1.aws.elastic.cloud", "kibana": "https://sample-project-c990cb-c990cb.kb.us-east-1.aws.elastic.cloud" }, "credentials": { "username": "admin", "password": "abcd12345" } (...) }
You can store the project ID as an environment variable for the next requests:
export PROJECT_ID=cace8e65457043698ed3d99da2f053f6
Get project
editYou can retrieve your project details through an API call:
curl -H "Authorization: ApiKey $API_KEY" \ "https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}"
Get project status
editThe status endpoint indicates whether the project is initialized and ready to be used. In the response, the project’s phase
will change from "initializing" to "initialized" when it is ready:
curl -H "Authorization: ApiKey $API_KEY" \ "https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}/status"
Example response:
{ "phase":"initializing" }
Reset Credentials
editIf you lose the credentials provided at the time of the project creation, you can reset the credentials by using the following endpoint:
curl -H "Authorization: ApiKey $API_KEY" \ -XPOST \ "https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}/_reset-credentials"
Delete Project
editYou can delete your project via the API:
curl -XDELETE -H "Authorization: ApiKey $API_KEY" \ "https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}"
Update Project
editYou can update your project using a PATCH request. Only the fields included in the body of the request will be updated.
curl -H "Authorization: ApiKey $API_KEY" \ -H "Content-Type: application/json" \ "https://api.elastic-cloud.com/api/v1/serverless/projects/elasticsearch/${PROJECT_ID}" \ -XPATCH --data '{ "name": "new name", "alias": "new-project-alias" }'
List available regions
editYou can obtain the list of regions where projects can be created using the API:
curl -H "Authorization: ApiKey $API_KEY" \ "https://api.elastic-cloud.com/api/v1/serverless/regions"
On this page
ElasticON events are back!
Learn about the Elastic Search AI Platform from the experts at our live events.
Register now