> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# List deployments

GET https://astropods.com/api/v1/deployments

Lists all active deployments for the given account, including pod and job status.

Reference: https://docs.astropods.com/api-reference/astro-ai-api/deployments/list-deployments

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: astro-api
  version: 1.0.0
paths:
  /deployments:
    get:
      operationId: list-deployments
      summary: List deployments
      description: >-
        Lists all active deployments for the given account, including pod and
        job status.
      tags:
        - subpackage_deployments
      parameters:
        - name: account
          in: query
          description: Account name
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: OAuth 2.0 device flow or platform session token
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of active deployments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deployments_listDeployments_Response_200'
        '400':
          description: Invalid request body or parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient permissions for this account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
servers:
  - url: https://astropods.com/api/v1
    description: Astro AI API server
components:
  schemas:
    AgentDeploymentStatus:
      type: string
      enum:
        - Running
        - Pending
        - Stopped
      title: AgentDeploymentStatus
    ServiceEndpoint:
      type: object
      properties:
        name:
          type: string
        url:
          type: string
        type:
          type: string
      title: ServiceEndpoint
    PodDetailPhase:
      type: string
      enum:
        - Pending
        - Running
        - Succeeded
        - Failed
        - Unknown
      title: PodDetailPhase
    ContainerStatusState:
      type: string
      enum:
        - Running
        - Waiting
        - Terminated
        - Unknown
      title: ContainerStatusState
    EnvVar:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
          description: Literal value (omitted for secret/configmap references)
        from:
          type: string
          description: Source reference (e.g. `secret:my-secret/key`)
      title: EnvVar
    ContainerStatus:
      type: object
      properties:
        name:
          type: string
        state:
          $ref: '#/components/schemas/ContainerStatusState'
        ready:
          type: boolean
        restart_count:
          type: integer
        reason:
          type: string
        message:
          type: string
        env:
          type: array
          items:
            $ref: '#/components/schemas/EnvVar'
      title: ContainerStatus
    PodDetail:
      type: object
      properties:
        name:
          type: string
        phase:
          $ref: '#/components/schemas/PodDetailPhase'
        pod_ip:
          type: string
        age:
          type: string
        containers:
          type: array
          items:
            $ref: '#/components/schemas/ContainerStatus'
      title: PodDetail
    JobDetailStatus:
      type: string
      enum:
        - Pending
        - Running
        - Succeeded
        - Failed
      title: JobDetailStatus
    JobDetail:
      type: object
      properties:
        name:
          type: string
        status:
          $ref: '#/components/schemas/JobDetailStatus'
        component:
          type: string
        age:
          type: string
        start_time:
          type: string
          format: date-time
        completions:
          type: string
          description: Completion ratio (e.g. `1/1`)
      title: JobDetail
    AgentDeployment:
      type: object
      properties:
        name:
          type: string
        build_id:
          type: string
        namespace:
          type: string
        status:
          $ref: '#/components/schemas/AgentDeploymentStatus'
        replicas:
          type: integer
        ready:
          type: integer
        created_at:
          type: string
          format: date-time
        components:
          type: array
          items:
            type: string
        manual_ingestions:
          type: array
          items:
            type: string
        external_urls:
          type: array
          items:
            $ref: '#/components/schemas/ServiceEndpoint'
        pods:
          type: array
          items:
            $ref: '#/components/schemas/PodDetail'
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/JobDetail'
      title: AgentDeployment
    deployments_listDeployments_Response_200:
      type: object
      properties:
        deployments:
          type: array
          items:
            $ref: '#/components/schemas/AgentDeployment'
        count:
          type: integer
      title: deployments_listDeployments_Response_200
    Error:
      type: object
      properties:
        error:
          type: string
        details:
          type: string
      title: Error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 device flow or platform session token

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "deployments": [
    {
      "name": "astro-agent-alpha",
      "build_id": "build-20240612-xyz123",
      "namespace": "astro-ai-prod",
      "status": "Running",
      "replicas": 3,
      "ready": 3,
      "created_at": "2024-01-15T09:30:00Z",
      "components": [
        "ingestion-service",
        "processing-engine",
        "api-gateway"
      ],
      "manual_ingestions": [
        "user-data-upload",
        "sensor-feed"
      ],
      "external_urls": [
        {
          "name": "Dashboard",
          "url": "https://dashboard.astropods.com/astro-agent-alpha",
          "type": "web-ui"
        },
        {
          "name": "Metrics API",
          "url": "https://api.astropods.com/metrics/astro-agent-alpha",
          "type": "api"
        }
      ],
      "pods": [
        {
          "name": "astro-agent-alpha-5f7d9c8b7f-abcde",
          "phase": "Running",
          "pod_ip": "10.244.1.15",
          "age": "3d12h",
          "containers": [
            {
              "name": "agent-container",
              "state": "Running",
              "ready": true,
              "restart_count": 0,
              "reason": "",
              "message": "",
              "env": [
                {
                  "name": "LOG_LEVEL",
                  "value": "info",
                  "from": ""
                },
                {
                  "name": "API_KEY",
                  "value": "",
                  "from": "secret:astro-agent-alpha/api-key"
                }
              ]
            }
          ]
        },
        {
          "name": "astro-agent-alpha-5f7d9c8b7f-fghij",
          "phase": "Running",
          "pod_ip": "10.244.1.16",
          "age": "3d12h",
          "containers": [
            {
              "name": "agent-container",
              "state": "Running",
              "ready": true,
              "restart_count": 1,
              "reason": "CrashLoopBackOff",
              "message": "Back-off restarting failed container",
              "env": [
                {
                  "name": "LOG_LEVEL",
                  "value": "debug",
                  "from": ""
                }
              ]
            }
          ]
        }
      ],
      "jobs": [
        {
          "name": "data-cleanup-job-20240614",
          "status": "Succeeded",
          "component": "cleanup-service",
          "age": "2h30m",
          "start_time": "2024-06-14T07:00:00Z",
          "completions": "1/1"
        },
        {
          "name": "model-training-job-20240613",
          "status": "Running",
          "component": "training-engine",
          "age": "1h15m",
          "start_time": "2024-06-14T08:15:00Z",
          "completions": "0/1"
        }
      ]
    }
  ],
  "count": 1
}
```

**SDK Code**

```python
import requests

url = "https://astropods.com/api/v1/deployments"

querystring = {"account":"account"}

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://astropods.com/api/v1/deployments?account=account';
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://astropods.com/api/v1/deployments?account=account"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://astropods.com/api/v1/deployments?account=account")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://astropods.com/api/v1/deployments?account=account")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://astropods.com/api/v1/deployments?account=account', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://astropods.com/api/v1/deployments?account=account");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://astropods.com/api/v1/deployments?account=account")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```