# version_conflict

- HTTP status: 412
- Retry: No
- Execution: not started
- Admin needed: no

**Version conflict.** The `If-Match` value is not the current `ETag`. Someone (or something, such as a running campaign) changed the resource after your read.

## What it means

The API returns HTTP 412 with `error.code` set to `version_conflict`. The default message is: "The resource changed since you read it."

## Common causes

- Another client or a console user updated the resource.
- A campaign changed state while you were editing it.

## How to identify it

Check the response status (`412`) and `error.code` (`version_conflict`). Branch on `error.code`, not on the message text: messages can be reworded, codes do not change within v1. Log `error.request_id` (also sent as the `X-Request-Id` header) so support can find the request.

## How to fix it

- Retrieve the resource again, re-apply your change to the new version, and resend with the new `ETag`.

## Retry guidance

Sending the request unchanged fails the same way. Fix the cause first (see How to fix it), then send it again.

## Did anything happen?

This request was refused before any call was placed and before anything was charged.

## Idempotency

PATCH does not use an Idempotency-Key.

## Who can fix it

The developer who sends the request can fix it; no administrator action is normally needed.

## When to contact support

If the error persists after the steps above, contact [support@relationsai.com](mailto:support@relationsai.com). See [Support](/resources/support) for what to include (the `request_id`, the time in UTC, the operation, and whether you used a test or live key) and what never to send (API keys, Authorization headers, webhook signing secrets, recording links, transcripts or customer data).

## Example error response

```json
{
  "error": {
    "code": "version_conflict",
    "message": "The resource changed since you read it.",
    "details": {},
    "request_id": "req_75h5mlew62uzae24hyvx2c2t",
    "retry": "no",
    "doc_url": "https://docs.relationsai.com/errors/version_conflict"
  }
}
```

## Incorrect and corrected request

Incorrect: The ETag is from a read made before someone else changed the campaign.

```http
PATCH /v1/campaigns/cmp_3Uat7Kq2Lm9Px4Rv8Ny5Bc
Authorization: Bearer rai_test_YOUR_TEST_KEY
Content-Type: application/json
If-Match: "9b1e0c4d2a77"

{
  "name": "October renewals"
}
```

Corrected: Retrieved again, the change re-applied to the current version, and sent with its new ETag.

```http
PATCH /v1/campaigns/cmp_3Uat7Kq2Lm9Px4Rv8Ny5Bc
Authorization: Bearer rai_test_YOUR_TEST_KEY
Content-Type: application/json
If-Match: "c3f1a9e2b7d4"

{
  "name": "October renewals"
}
```

## Operations that can return this error

- [`PATCH /campaigns/{campaign_id}`](/api/campaigns#update-a-campaign): Update a campaign
- [`PATCH /contacts/{contact_id}`](/api/contacts#update-a-contact): Update a contact

See all codes in the [error-code reference](/fundamentals/error-codes).
