POST
/
organizations
/
{organization}
/
databases
/
{database}
/
deploy-requests
Create a deploy request
curl --request POST \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "branch": "<string>",
  "into_branch": "<string>",
  "notes": "<string>",
  "auto_cutover": true,
  "auto_delete_branch": true
}'
{
  "id": "<string>",
  "number": 123,
  "actor": {},
  "closed_by": {},
  "branch": "<string>",
  "branch_id": "<string>",
  "branch_deleted": true,
  "branch_deleted_by": {},
  "branch_deleted_at": "<string>",
  "into_branch": "<string>",
  "into_branch_sharded": true,
  "into_branch_shard_count": 123,
  "approved": true,
  "state": "open",
  "deployment_state": "pending",
  "deployment": {},
  "num_comments": 123,
  "html_url": "<string>",
  "notes": "<string>",
  "html_body": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "closed_at": "<string>",
  "deployed_at": "<string>"
}

Authorizations

Authorization
string
header
required

Path Parameters

organization
string
required

The name of the deploy request's organization

database
string
required

The name of the deploy request's database

Body

application/json
branch
string
required

The name of the branch the deploy request is created from

into_branch
string
required

The name of the branch the deploy request will be merged into

notes
string

Notes about the deploy request

auto_cutover
boolean

Whether or not to enable auto_cutover for the deploy request. When enabled, will auto cutover to the new schema as soon as it is ready.

auto_delete_branch
boolean

Whether or not to enable auto_delete_branch for the deploy request. When enabled, will delete the branch once the DR successfully completes.

Response

Returns the created deploy request

id
string
required

The ID of the deploy request

number
number
required

The number of the deploy request

actor
object
required
closed_by
object
required
branch
string
required

The name of the branch the deploy request was created from

branch_id
string
required

The ID of the branch the deploy request was created from

branch_deleted
boolean
required

Whether or not the deploy request branch was deleted

branch_deleted_by
object
required
branch_deleted_at
string
required

When the deploy request branch was deleted

into_branch
string
required

The name of the branch the deploy request will be merged into

into_branch_sharded
boolean
required

Whether or not the branch the deploy request will be merged into is sharded

into_branch_shard_count
number
required

The number of shards the branch the deploy request will be merged into has

approved
boolean
required

Whether or not the deploy request is approved

state
enum<string>
required

Whether the deploy request is open or closed

Available options:
open,
closed
deployment_state
enum<string>
required

The deployment state of the deploy request

Available options:
pending,
ready,
no_changes,
queued,
submitting,
in_progress,
pending_cutover,
in_progress_vschema,
in_progress_cancel,
in_progress_cutover,
complete,
complete_cancel,
complete_error,
complete_pending_revert,
in_progress_revert,
in_progress_revert_vschema,
complete_revert,
complete_revert_error,
cancelled,
error
deployment
object
required
num_comments
number
required

The number of comments on the deploy request

html_url
string
required

The PlanetScale app address for the deploy request

notes
string
required

Notes on the deploy request

html_body
string
required

The HTML body of the deploy request

created_at
string
required

When the deploy request was created

updated_at
string
required

When the deploy request was last updated

closed_at
string
required

When the deploy request was closed

deployed_at
string
required

When the deploy request was deployed