Skip to main content
GET
/
deployments
JavaScript
import Kernel from '@onkernel/sdk';

const client = new Kernel({
  apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const deploymentListResponse of client.deployments.list()) {
  console.log(deploymentListResponse.id);
}
import os
from kernel import Kernel

client = Kernel(
    api_key=os.environ.get("KERNEL_API_KEY"),  # This is the default and can be omitted
)
page = client.deployments.list()
page = page.items[0]
print(page.id)
package main

import (
	"context"
	"fmt"

	"github.com/kernel/kernel-go-sdk"
	"github.com/kernel/kernel-go-sdk/option"
)

func main() {
	client := kernel.NewClient(
		option.WithAPIKey("My API Key"),
	)
	page, err := client.Deployments.List(context.TODO(), kernel.DeploymentListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
curl --request GET \
  --url https://api.onkernel.com/deployments \
  --header 'Authorization: Bearer <token>'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.onkernel.com/deployments",
  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;
}
HttpResponse<String> response = Unirest.get("https://api.onkernel.com/deployments")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.onkernel.com/deployments")

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
[
  {
    "id": "rr33xuugxj9h0bkf1rdt2bet",
    "status": "queued",
    "region": "aws.us-east-1a",
    "created_at": "2023-11-07T05:31:56Z",
    "status_reason": "Deployment in progress",
    "entrypoint_rel_path": "src/app.py",
    "env_vars": {},
    "updated_at": "2023-11-07T05:31:56Z",
    "source_type": "github",
    "source_url": "https://github.com/org/repo",
    "source_ref": "main",
    "source_path": "apps/api",
    "source_checksum": "3f4d0ea1bd2c5c1a1a1f0e9d8c7b6a5948372615049382716a5b4c3d2e1f0a9b"
  }
]
{
  "code": "bad_request",
  "message": "Missing required field: app_name",
  "details": [
    {
      "code": "invalid_input",
      "message": "Provided version string is not semver compliant"
    }
  ],
  "inner_error": {
    "code": "invalid_input",
    "message": "Provided version string is not semver compliant"
  }
}
{
  "code": "bad_request",
  "message": "Missing required field: app_name",
  "details": [
    {
      "code": "invalid_input",
      "message": "Provided version string is not semver compliant"
    }
  ],
  "inner_error": {
    "code": "invalid_input",
    "message": "Provided version string is not semver compliant"
  }
}
{
  "code": "bad_request",
  "message": "Missing required field: app_name",
  "details": [
    {
      "code": "invalid_input",
      "message": "Provided version string is not semver compliant"
    }
  ],
  "inner_error": {
    "code": "invalid_input",
    "message": "Provided version string is not semver compliant"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

app_name
string

Filter results by application name.

app_version
string

Filter results by application version. Requires app_name to be set.

limit
integer
default:20

Limit the number of deployments to return.

Required range: 1 <= x <= 100
offset
integer
default:0

Offset the number of deployments to return.

Required range: x >= 0
query
string

Search deployments by ID or app name.

Response

List of deployments.

id
string
required

Unique identifier for the deployment

Example:

"rr33xuugxj9h0bkf1rdt2bet"

status
enum<string>
required

Current status of the deployment

Available options:
queued,
in_progress,
running,
failed,
stopped
Example:

"queued"

region
string
required

Deployment region code

Allowed value: "aws.us-east-1a"
Example:

"aws.us-east-1a"

created_at
string<date-time>
required

Timestamp when the deployment was created

status_reason
string

Status reason

Example:

"Deployment in progress"

entrypoint_rel_path
string

Relative path to the application entrypoint

Example:

"src/app.py"

env_vars
object

Environment variables configured for this deployment. Values are redacted for API key, OAuth, and managed-auth callers, which receive every key with an empty string value. Only dashboard sessions receive the actual values.

updated_at
string<date-time> | null

Timestamp when the deployment was last updated

source_type
enum<string>

Origin of the deployed source code. This is read-only response provenance; file indicates an uploaded archive and github indicates a repository fetched by the API.

Available options:
file,
github
Example:

"github"

source_url
string

For GitHub-sourced deployments, the repository URL that was fetched. Omitted for file uploads.

Example:

"https://github.com/org/repo"

source_ref
string

For GitHub-sourced deployments, the git ref as requested at deploy time (branch, tag, or commit SHA — not resolved to a commit). Omitted for file uploads.

Example:

"main"

source_path
string

For GitHub-sourced deployments, the subpath within the repository that was used as the deploy root. Omitted when the repo root was used or for file uploads.

Example:

"apps/api"

source_checksum
string

Hex-encoded SHA-256 checksum of the source archive. For file uploads, this hashes the uploaded archive; for GitHub-sourced deployments, this hashes the GitHub archive downloaded by the API. Omitted for deployments created before this field was recorded.

Example:

"3f4d0ea1bd2c5c1a1a1f0e9d8c7b6a5948372615049382716a5b4c3d2e1f0a9b"