> 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.

# Validate a deployment spec

POST https://astropods.com/api/v1/deploy/validate
Content-Type: application/json

Validates a fulfilled deployment spec without applying it.

Reference: https://docs.astropods.com/api-reference/astropods-api/deployments/validate-a-deployment-spec

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an AstroDeploymentSpec.

- `access` (InterfaceAccess, optional)
- `agent` (DeploymentAgent, optional)
- `ingestion` (map from string to DeploymentIngestion, optional)
- `integrations` (map from string to DeploymentIntegration, optional)
- `interfaces` (DeploymentInterfaces, optional)
- `knowledge` (map from string to DeploymentKnowledge, optional)
- `models` (map from string to DeploymentModel, optional)
- `observability` (DeploymentObservability, optional)
- `source` (DeploymentSource, optional)
- `spec` (string, optional)
- `target` (DeploymentTarget, optional)
- `variables` (map from string to Variable, optional)

## Response

### 200

OK

- `build_id` (string, optional)
- `name` (string, optional)
- `valid` (boolean, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `code` (string, optional)
- `details` (string, optional)
- `error` (string, optional)

## Types

### InterfaceAccess

- `custom` (InterfaceGrants, optional)
- `slack` (InterfaceGrants, optional)
- `web` (InterfaceGrants, optional)

### DeploymentAgent

- `astro_ai_gateway` (boolean, optional)
- `distributed` (boolean, optional)
- `endpoints` (map from string to Endpoint, optional)
- `environment` (map from string to string, optional)
- `healthcheck` (Healthcheck, optional)
- `image` (string, optional)
- `replicas` (integer, optional)
- `resources` (DeploymentResources, optional)
- `response_timeout` (string, optional)
- `storage` (StorageConfig, optional)
- `update` (UpdateStrategy, optional)
- `volume` (string, optional)

### DeploymentIngestion

- `endpoints` (map from string to Endpoint, optional)
- `environment` (map from string to string, optional)
- `healthcheck` (Healthcheck, optional)
- `image` (string, optional)
- `resources` (DeploymentResources, optional)
- `trigger` (DeploymentTrigger, optional)

### DeploymentIntegration

- `endpoints` (map from string to Endpoint, optional)
- `environment` (map from string to string, optional)
- `healthcheck` (Healthcheck, optional)
- `image` (string, optional)
- `replicas` (integer, optional)
- `resources` (DeploymentResources, optional)
- `update` (UpdateStrategy, optional)

### DeploymentInterfaces

- `adapters` (list of string, optional)
- `auth` (DeploymentInterfacesAuth, optional)
- `endpoints` (map from string to Endpoint, optional)
- `environment` (map from string to string, optional)
- `healthcheck` (Healthcheck, optional)
- `image` (string, optional)
- `jobs` (list of Job, optional)
- `resources` (DeploymentResources, optional)

### DeploymentKnowledge

- `binding` (string, optional)
- `endpoints` (map from string to Endpoint, optional)
- `environment` (map from string to string, optional)
- `healthcheck` (Healthcheck, optional)
- `image` (string, optional)
- `persistent` (boolean, optional)
- `provider` (string, optional)
- `replicas` (integer, optional)
- `resources` (DeploymentResources, optional)
- `storage` (StorageConfig, optional)
- `update` (UpdateStrategy, optional)
- `volume` (string, optional)

### DeploymentModel

- `endpoints` (map from string to Endpoint, optional)
- `environment` (map from string to string, optional)
- `healthcheck` (Healthcheck, optional)
- `image` (string, optional)
- `model` (string, optional)
- `persistent` (boolean, optional)
- `provider` (string, optional)
- `replicas` (integer, optional)
- `resources` (DeploymentResources, optional)
- `update` (UpdateStrategy, optional)

### DeploymentObservability

- `enabled` (boolean, optional)
- `environment` (map from string to string, optional)
- `image` (string, optional)
- `log_stream` (string, optional)
- `port` (integer, optional)
- `provider` (string, optional)
- `resources` (DeploymentResources, optional)

### DeploymentSource

- `account` (string, optional)
- `build` (string, optional)
- `name` (string, optional)
- `registry` (string, optional)

### DeploymentTarget

- `account` (string, optional)
- `cluster_id` (string, optional)
- `deployment_id` (string, optional)
- `display_name` (string, optional)
- `environment_id` (string, optional)
- `runtime` (string, optional)

### Variable

- `configured` (boolean, optional)
- `datatype` (string, optional)
- `default` (string, optional)
- `deprecated` (string, optional)
- `description` (string, optional)
- `display-as` (string, optional)
- `fields` (map from string to VariableField, optional)
- `help_url` (string, optional)
- `label` (string, optional)
- `optional` (boolean, optional)
- `options` (list of string, optional)
- `placeholder` (string, optional)
- `ref` (string, optional)
- `secret` (boolean, optional)
- `targets` (list of string, optional)
- `value` (string, optional)

### InterfaceGrants

- `grants` (list of DeploymentAuthorizationGrant, optional)

### Endpoint

- `expose` (EndpointExpose, optional)
- `port` (integer, optional)
- `protocol` (string, optional)

### Healthcheck

- `interval` (string, optional)
- `path` (string, optional)
- `retries` (integer, optional)
- `test` (list of string, optional)
- `timeout` (string, optional)

### DeploymentResources

- `auto` (AutoSizing, optional)
- `cpu` (string, optional)
- `cpu_limit` (string, optional)
- `memory` (string, optional)
- `memory_limit` (string, optional)

### StorageConfig

- `access_mode` (string, optional)
- `class` (string, optional)
- `size` (string, optional)

### UpdateStrategy

- `max_surge` (string, optional)
- `max_unavailable` (string, optional)
- `strategy` (string, optional)

### DeploymentTrigger

- `schedule` (string, optional)
- `type` (string, optional)

### DeploymentInterfacesAuth

- `custom` (DeploymentCustomAuth, optional)
- `slack` (DeploymentSlackAuth, optional)
- `web` (DeploymentWebAuth, optional)

### Job

- `description` (string, optional)
- `name` (string, optional)

### VariableField

- `datatype` (string, optional)
- `deprecated` (string, optional)
- `description` (string, optional)
- `label` (string, optional)
- `optional` (boolean, optional)
- `placeholder` (string, optional)

### DeploymentAuthorizationGrant

- `anyone` (boolean, optional)
- `audience` (string, optional)
- `org` (string, optional)
- `user_id` (string, optional)

### EndpointExpose

- `domain` (string, optional)
- `enabled` (boolean, optional)

### AutoSizing

- `max_cpu` (string, optional)
- `max_memory` (string, optional)
- `min_cpu` (string, optional)
- `min_memory` (string, optional)

### DeploymentCustomAuth

- `grants` (list of DeploymentAuthorizationGrant, optional)
- `public` (boolean, optional)

### DeploymentSlackAuth

- `grants` (list of DeploymentAuthorizationGrant, optional)

### DeploymentWebAuth

- `grants` (list of DeploymentAuthorizationGrant, optional)
- `public` (boolean, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "build_id": "string",
  "name": "string",
  "valid": true
}
```

**SDK Code**

```python
import requests

url = "https://astropods.com/api/v1/deploy/validate"

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

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://astropods.com/api/v1/deploy/validate';
const options = {
  method: 'POST',
  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/deploy/validate"

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

	req, _ := http.NewRequest("POST", 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/deploy/validate")

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

request = Net::HTTP::Post.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.post("https://astropods.com/api/v1/deploy/validate")
  .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('POST', 'https://astropods.com/api/v1/deploy/validate', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://astropods.com/api/v1/deploy/validate");
var request = new RestRequest(Method.POST);
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/deploy/validate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```