
# Create Contract

```
POST /api/v1/conformance-contracts
```

Creates a contract for one integration and one field. Run [Reconcile](/docs/api/endpoints/conformance/reconcile) afterwards to check it.

CLI: [`fob-mdm contracts create`](/docs/cli/contracts#contracts-create)

## Request Body

| Field | Type | Required | Description |
|---|---|---|---|
| `integration` | number | Yes | The integration |
| `field` | number | Yes | The field id, on the object the integration links to |
| `must_match` | boolean | No | The app's copy must equal golden. Default `true` |
| `enforcement_mode` | string | No | `auto` (default) or `ticket` |

## Example Request

```bash
curl -X POST "https://mdm.finopsbricks.com/api/v1/conformance-contracts" \
  -H "api-key: $MDM_API_KEY" \
  -H "api-secret: $MDM_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "integration": 5,
    "field": 12,
    "enforcement_mode": "ticket"
  }'
```

## Response

`201 Created`

```json
{
  "data": {
    "id": 3,
    "integration": 5,
    "object": 1,
    "field": 12,
    "field_key": "bank_ifsc",
    "must_match": true,
    "enforcement_mode": "ticket",
    "created_at": "2026-11-26T07:20:08.000Z",
    "updated_at": "2026-11-26T07:20:08.000Z"
  }
}
```

## Errors

| Status | Code | When |
|---|---|---|
| 400 | `VALIDATION_ERROR` | `integration` or `field` is missing, or `enforcement_mode` isn't allowed |
| 401 | `UNAUTHORIZED` | Missing, wrong or expired API credentials |
| 403 | `FORBIDDEN` | The key lacks `conformance:create` permission |
| 404 | `NOT_FOUND` | No such integration or field in your organization |
| 409 | `CONFLICT` | The integration already has a contract for this field |
| 422 | `FIELD_RETIRED` | The field is retired |

See [Errors](/docs/api/errors) for the envelope.
