---
title: "Create a terraform deployment restriction"
method: POST
path: "/terraform/{terraformId}/deploymentRestriction"
tags: ["Terraform Deployment Restriction"]
---

# Create a terraform deployment restriction

`POST /terraform/{terraformId}/deploymentRestriction`

## Request

- Base URL: `https://api.qovery.com`
- URL: `https://api.qovery.com/terraform/{terraformId}/deploymentRestriction`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/qovery/apis/qovery-api/docs/terraform/:terraformId/deploymentRestriction/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a terraform deployment restriction

## Request body

- TerraformDeploymentRestrictionRequest
  - `mode` 'EXCLUDE' | 'MATCH', required: Match mode will rebuild app only if specified items are updated. Exclude mode will not rebuild app if specified items are updated.
  - `type` 'PATH', required
  - `value` string, required: ‘For `PATH` restrictions, the value must not start with `/`’

## Response `201`

Added an terraform deployment restriction

- TerraformDeploymentRestrictionResponse
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time
  - `mode` 'EXCLUDE' | 'MATCH', required: Match mode will rebuild app only if specified items are updated. Exclude mode will not rebuild app if specified items are updated.
  - `type` 'PATH', required
  - `value` string, required: ‘For `PATH` restrictions, the value must not start with `/`’

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: Access forbidden
- `409`: A terraform deployment restriction with same properties already exists for this terraform

---

[API](https://skmtc.dev/qovery/apis/qovery-api.md) - [All operations](https://skmtc.dev/qovery/apis/qovery-api/llms.txt) - [OpenAPI document](https://skmtc.dev/qovery/apis/qovery-api/revisions/93c4960a44ba?raw)
