List deploy requests
curl --request GET \
--url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"type": "<string>",
"current_page": 123,
"per_page": 123,
"next_page": 123,
"next_page_url": "<string>",
"prev_page": 123,
"prev_page_url": "<string>",
"total_count": 123,
"total_pages": 123,
"data": [
{
"id": "<string>",
"number": 123,
"actor": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"branch": "<string>",
"branch_id": "<string>",
"branch_deleted": true,
"branch_deleted_at": "<string>",
"into_branch": "<string>",
"into_branch_sharded": true,
"into_branch_shard_count": 123,
"into_branch_keyspace_count": 123,
"approved": true,
"state": "open",
"deployment_state": "pending",
"deployment": {
"id": "<string>",
"auto_cutover": true,
"auto_delete_branch": true,
"aggressive_cutover": true,
"created_at": "<string>",
"cutover_at": "<string>",
"cutover_expiring": true,
"finished_at": "<string>",
"force_cutover_requested_at": "<string>",
"retry_requested": true,
"retry_requested_at": "<string>",
"queued_at": "<string>",
"ready_to_cutover_at": "<string>",
"started_at": "<string>",
"state": "pending",
"submitted_at": "<string>",
"updated_at": "<string>",
"into_branch": "<string>",
"deploy_request_number": 123,
"deployable": true,
"preceding_deployments": [
{}
],
"deploy_operations": [
{
"id": "<string>",
"state": "pending",
"keyspace_name": "<string>",
"table_name": "<string>",
"operation_name": "<string>",
"eta_seconds": 123,
"progress_percentage": 123,
"deploy_error_docs_url": "<string>",
"ddl_statement": "<string>",
"syntax_highlighted_ddl": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"throttled_at": "<string>",
"can_drop_data": true,
"table_locked": true,
"table_recently_used": true,
"table_recently_used_at": "<string>",
"removed_foreign_key_names": [
"<string>"
],
"deploy_errors": "<string>"
}
],
"deploy_operation_summaries": [
{
"id": "<string>",
"created_at": "<string>",
"deploy_errors": "<string>",
"ddl_statement": "<string>",
"eta_seconds": 123,
"keyspace_name": "<string>",
"operation_name": "<string>",
"progress_percentage": 123,
"state": "pending",
"syntax_highlighted_ddl": "<string>",
"table_name": "<string>",
"table_recently_used_at": "<string>",
"throttled_at": "<string>",
"removed_foreign_key_names": [
"<string>"
],
"shard_count": 123,
"shard_names": [
"<string>"
],
"can_drop_data": true,
"table_recently_used": true,
"sharded": true,
"operations": [
{
"id": "<string>",
"shard": "<string>",
"state": "pending",
"progress_percentage": 123,
"eta_seconds": 123
}
]
}
],
"lint_errors": [
{}
],
"sequential_diff_dependencies": [
{}
],
"lookup_vindex_operations": [
{}
],
"deployment_revert_request": {},
"schema_last_updated_at": "<string>",
"table_locked": true,
"instant_ddl": true,
"instant_ddl_eligible": true,
"queue_paused": true,
"queue_pause_reason": "<string>",
"deploy_check_errors": "<string>",
"throttler_configurations": {},
"actor": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"cutover_actor": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"cancelled_actor": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"locked_table_name": "<string>"
},
"num_comments": 123,
"html_url": "<string>",
"notes": "<string>",
"html_body": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"closed_at": "<string>",
"deployed_at": "<string>",
"closed_by": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"branch_deleted_by": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
}
}
]
}Deploy requests
List deploy requests
List deploy requests for a database
Authorization
A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint:
Service Token Accesses
read_deploy_request
OAuth Scopes
| Resource | Scopes |
|---|---|
| Organization | read_deploy_requests |
| Database | read_deploy_requests |
GET
/
organizations
/
{organization}
/
databases
/
{database}
/
deploy-requests
List deploy requests
curl --request GET \
--url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/deploy-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"type": "<string>",
"current_page": 123,
"per_page": 123,
"next_page": 123,
"next_page_url": "<string>",
"prev_page": 123,
"prev_page_url": "<string>",
"total_count": 123,
"total_pages": 123,
"data": [
{
"id": "<string>",
"number": 123,
"actor": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"branch": "<string>",
"branch_id": "<string>",
"branch_deleted": true,
"branch_deleted_at": "<string>",
"into_branch": "<string>",
"into_branch_sharded": true,
"into_branch_shard_count": 123,
"into_branch_keyspace_count": 123,
"approved": true,
"state": "open",
"deployment_state": "pending",
"deployment": {
"id": "<string>",
"auto_cutover": true,
"auto_delete_branch": true,
"aggressive_cutover": true,
"created_at": "<string>",
"cutover_at": "<string>",
"cutover_expiring": true,
"finished_at": "<string>",
"force_cutover_requested_at": "<string>",
"retry_requested": true,
"retry_requested_at": "<string>",
"queued_at": "<string>",
"ready_to_cutover_at": "<string>",
"started_at": "<string>",
"state": "pending",
"submitted_at": "<string>",
"updated_at": "<string>",
"into_branch": "<string>",
"deploy_request_number": 123,
"deployable": true,
"preceding_deployments": [
{}
],
"deploy_operations": [
{
"id": "<string>",
"state": "pending",
"keyspace_name": "<string>",
"table_name": "<string>",
"operation_name": "<string>",
"eta_seconds": 123,
"progress_percentage": 123,
"deploy_error_docs_url": "<string>",
"ddl_statement": "<string>",
"syntax_highlighted_ddl": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"throttled_at": "<string>",
"can_drop_data": true,
"table_locked": true,
"table_recently_used": true,
"table_recently_used_at": "<string>",
"removed_foreign_key_names": [
"<string>"
],
"deploy_errors": "<string>"
}
],
"deploy_operation_summaries": [
{
"id": "<string>",
"created_at": "<string>",
"deploy_errors": "<string>",
"ddl_statement": "<string>",
"eta_seconds": 123,
"keyspace_name": "<string>",
"operation_name": "<string>",
"progress_percentage": 123,
"state": "pending",
"syntax_highlighted_ddl": "<string>",
"table_name": "<string>",
"table_recently_used_at": "<string>",
"throttled_at": "<string>",
"removed_foreign_key_names": [
"<string>"
],
"shard_count": 123,
"shard_names": [
"<string>"
],
"can_drop_data": true,
"table_recently_used": true,
"sharded": true,
"operations": [
{
"id": "<string>",
"shard": "<string>",
"state": "pending",
"progress_percentage": 123,
"eta_seconds": 123
}
]
}
],
"lint_errors": [
{}
],
"sequential_diff_dependencies": [
{}
],
"lookup_vindex_operations": [
{}
],
"deployment_revert_request": {},
"schema_last_updated_at": "<string>",
"table_locked": true,
"instant_ddl": true,
"instant_ddl_eligible": true,
"queue_paused": true,
"queue_pause_reason": "<string>",
"deploy_check_errors": "<string>",
"throttler_configurations": {},
"actor": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"cutover_actor": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"cancelled_actor": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"locked_table_name": "<string>"
},
"num_comments": 123,
"html_url": "<string>",
"notes": "<string>",
"html_body": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"closed_at": "<string>",
"deployed_at": "<string>",
"closed_by": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"branch_deleted_by": {
"id": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
}
}
]
}Authorizations
oauth2service_token
Path Parameters
Query Parameters
Response
Returns a list of deploy requests

