# List deployments GET https://api.astropod.ai/api/v1/deployments Lists all active deployments for the given account, including pod and job status. Reference: https://docs.astropod.ai/api-reference/endpoints/astro-ai-api/deployments/list-deployments ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: List deployments version: endpoint_deployments.listDeployments 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 session token from WorkOS 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: {} '401': description: Authentication required content: {} '403': description: Insufficient permissions for this account content: {} '500': description: Server error content: {} components: schemas: AgentDeploymentStatus: type: string enum: - value: Running - value: Pending - value: Stopped ServiceEndpoint: type: object properties: name: type: string url: type: string type: type: string PodDetailPhase: type: string enum: - value: Pending - value: Running - value: Succeeded - value: Failed - value: Unknown ContainerStatusState: type: string enum: - value: Running - value: Waiting - value: Terminated - value: Unknown 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`) 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' 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' JobDetailStatus: type: string enum: - value: Pending - value: Running - value: Succeeded - value: Failed 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`) 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' deployments_listDeployments_Response_200: type: object properties: deployments: type: array items: $ref: '#/components/schemas/AgentDeployment' count: type: integer ``` ## SDK Code Examples ```python import requests url = "https://api.astropod.ai/api/v1/deployments" querystring = {"account":"account"} payload = {} headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.get(url, json=payload, headers=headers, params=querystring) print(response.json()) ``` ```javascript const url = 'https://api.astropod.ai/api/v1/deployments?account=account'; const options = { method: 'GET', headers: {Authorization: 'Bearer ', '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://api.astropod.ai/api/v1/deployments?account=account" payload := strings.NewReader("{}") req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Authorization", "Bearer ") 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://api.astropod.ai/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 ' 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 response = Unirest.get("https://api.astropod.ai/api/v1/deployments?account=account") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('GET', 'https://api.astropod.ai/api/v1/deployments?account=account', [ 'body' => '{}', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.astropod.ai/api/v1/deployments?account=account"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.astropod.ai/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() ```