---
title: "Create a scheduled deployment"
method: POST
path: "/projects/{project_id}/scheduled_deployments"
tags: ["Scheduled Deployments"]
---

# Create a scheduled deployment

`POST /projects/{project_id}/scheduled_deployments`

## Request

- Base URL: `https://sg.deployhq.com`
- URL: `https://sg.deployhq.com/projects/{project_id}/scheduled_deployments`
- Auth: HTTP basic

Creates a new scheduled deployment for the project.

## Path parameters

- `project_id` string, required

## Request body

- ScheduledDeploymentObject2
  - `scheduled_deployment` object, required
    - `server_identifier` string, required
    - `frequency` string, required
    - `at` string
    - `weekday` string
    - `day` integer
    - `month` integer
    - `year` integer
    - `schedule` string
    - `copy_config_files` boolean
    - `run_build_commands` boolean
    - `use_build_cache` boolean
    - `skip_if_not_changes` boolean
    - `start_revision` string
    - `end_revision` string
    - `use_latest` boolean
    - `deploy_entire_repository` boolean

## Response `201`

Created

- ScheduledDeployment
  - `identifier` string
  - `server` object
    - `identifier` string
    - `name` string
    - `servers` object[]
      - `id` integer
      - `identifier` string
      - `name` string
      - `protocol_type` string
      - `server_path` string
      - `last_revision` string
      - `preferred_branch` string
      - `branch` string
      - `notify_email` string
      - `server_group_identifier` string
      - `auto_deploy` boolean
      - `environment` string
      - `enabled` boolean
      - `agent` string, nullable
      - `atomic` string, nullable
      - `atomic_strategy` string
      - `atomic_retention` integer
      - `use_compression` boolean
      - `use_accelerated_transfer` boolean
      - `use_parallel_upload` boolean
      - `root_path` string
      - `position` integer
      - `created_at` string
      - `updated_at` string
      - `connection_checked_at` string, nullable
      - `connection_error_message` string, nullable
      - `hostname` string
      - `username` string
      - `port` string
      - `passive` boolean
      - `force_hidden_files` boolean
    - `preferred_branch` string
    - `last_revision` string
    - `environment` string
    - `transfer_order` string
  - `start_revision` string
  - `end_revision` string
  - `frequency` string
  - `at` object
    - `day` integer
    - `month` integer
    - `year` integer
    - `hour` integer
    - `minute` integer
  - `next_deployment_at` string
  - `copy_config_files` boolean
  - `run_build_commands` boolean
  - `use_build_cache` boolean
  - `skip_project_files` boolean
  - `config_files_deployment` boolean

## Other responses

- `401`: You are not authorized to access this resource. You need to authenticate yourself first.
- `403`: You are not allowed to access this resource. You do not have the necessary permissions.
- `422`: Unprocessable Entity
- `500`: An unexpected error occurred on the server. The server was unable to process the request.

---

[API](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation.md) · [All operations](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation/revisions/830264ae58be?raw)
