Deployments
Create Deployment
API Reference
- Overview
- Python SDK Overview
- Settings reference
- REST API
- REST API overview
- Cloud API
- Server API
- Server API Overview
- Root
- Flows
- Flow Runs
- Task Runs
- Flow Run States
- Task Run States
- Deployments
- POSTCreate Deployment
- GETRead Deployment
- DELDelete Deployment
- PATCHUpdate Deployment
- GETRead Deployment By Name
- POSTRead Deployments
- POSTPaginate Deployments
- POSTGet Scheduled Flow Runs For Deployments
- POSTCount Deployments
- POSTSchedule Deployment
- POSTResume Deployment
- POSTPause Deployment
- POSTCreate Flow Run From Deployment
- GETWork Queue Check For Deployment
- GETRead Deployment Schedules
- POSTCreate Deployment Schedules
- DELDelete Deployment Schedule
- PATCHUpdate Deployment Schedule
- POST
- SavedSearches
- Logs
- Concurrency Limits
- Concurrency Limits V2
- Block types
- Block documents
- Work Pools
- Task Workers
- Work Queues
- Artifacts
- Block schemas
- Block capabilities
- Collections
- Variables
- GETCreate Csrf Token
- Events
- Automations
- Admin
- CLI Reference
Deployments
Create Deployment
Gracefully creates a new deployment from the provided schema. If a deployment with the same name and flow_id already exists, the deployment is updated.
If the deployment has an active schedule, flow runs will be scheduled. When upserting, any scheduled runs from the existing deployment will be deleted.
For more information, see https://docs.prefect.io/v3/deploy.
POST
/
api
/
deployments
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"name": "<string>",
"version": "<string>",
"description": "<string>",
"flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paused": false,
"schedules": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule": {
"interval": 123,
"anchor_date": "2020-01-01T00:00:00Z",
"timezone": "America/New_York"
},
"active": true,
"max_scheduled_runs": 1,
"parameters": {},
"slug": "<string>"
}
],
"concurrency_limit": 123,
"global_concurrency_limit": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"active": true,
"name": "<string>",
"limit": 123,
"active_slots": 123,
"slot_decay_per_second": 2
},
"concurrency_options": {
"collision_strategy": "ENQUEUE"
},
"job_variables": {},
"parameters": {},
"tags": [
"tag-1",
"tag-2"
],
"labels": {
"key": "value1",
"key2": 42
},
"work_queue_name": "<string>",
"last_polled": "2023-11-07T05:31:56Z",
"parameter_openapi_schema": {},
"path": "<string>",
"pull_steps": [
{}
],
"entrypoint": "<string>",
"storage_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"infrastructure_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_value": "<string>"
},
"updated_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_value": "<string>"
},
"work_pool_name": "<string>",
"status": "READY",
"enforce_parameter_schema": true
}
Headers
Body
application/json
Data used by the Prefect REST API to create a deployment.
Response
200
application/json
Successful Response
The response is of type object
.
Was this page helpful?
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"name": "<string>",
"version": "<string>",
"description": "<string>",
"flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paused": false,
"schedules": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"deployment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"schedule": {
"interval": 123,
"anchor_date": "2020-01-01T00:00:00Z",
"timezone": "America/New_York"
},
"active": true,
"max_scheduled_runs": 1,
"parameters": {},
"slug": "<string>"
}
],
"concurrency_limit": 123,
"global_concurrency_limit": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"active": true,
"name": "<string>",
"limit": 123,
"active_slots": 123,
"slot_decay_per_second": 2
},
"concurrency_options": {
"collision_strategy": "ENQUEUE"
},
"job_variables": {},
"parameters": {},
"tags": [
"tag-1",
"tag-2"
],
"labels": {
"key": "value1",
"key2": 42
},
"work_queue_name": "<string>",
"last_polled": "2023-11-07T05:31:56Z",
"parameter_openapi_schema": {},
"path": "<string>",
"pull_steps": [
{}
],
"entrypoint": "<string>",
"storage_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"infrastructure_document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_value": "<string>"
},
"updated_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_value": "<string>"
},
"work_pool_name": "<string>",
"status": "READY",
"enforce_parameter_schema": true
}