# create_deployment

`tools/call` · `POST /agent/v1/deployments:create`

Deploy a product to an environment, with the URL where it answers, its Fixture API if it has one and the version running. Website and API products need a base URL. Refused when the product is already deployed there or either one is archived. Returns the deployment. Needs write access.

- Area: Catalog
- Needs the write grant.

## Inputs

- `product` (string, required): The product's slug, such as storefront.
- `environment` (string, required): The environment's slug, such as staging.
- `baseUrl` (nullable string): The http:// or https:// URL where the product answers in this environment, such as https://staging.acme.dev. Website and API products need one.
- `fixtureUrl` (nullable string): The http:// or https:// URL of the deployment's Fixture API, which test runs call to create and delete test data, such as https://staging.acme.dev/fixtures.
- `version` (nullable string): The build running in this environment, such as a git SHA or v2.4.1, up to 100 characters.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_deployment",
    "arguments": {
      "product": "storefront",
      "environment": "staging",
      "baseUrl": "https://staging.acme.dev",
      "fixtureUrl": "https://staging.acme.dev/fixtures",
      "version": "4f2c9e1"
    }
  }
}
```

## HTTP request

The same call over the agent HTTP API, with an agent OAuth access token:

```bash
curl -X POST https://api.qa.clankership.net/agent/v1/deployments:create \
  -H "Authorization: Bearer $CLANKER_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product": "storefront",
    "environment": "staging",
    "baseUrl": "https://staging.acme.dev",
    "fixtureUrl": "https://staging.acme.dev/fixtures",
    "version": "4f2c9e1"
  }'
```
