---
title: "CONFLICT"
description: "What triggers a CONFLICT error (HTTP 409) and how to resolve conflicting resource state."
canonical_url: "https://docs.leyr.io/api/error-handling/conflict"
---
# CONFLICT

> What triggers a CONFLICT error (HTTP 409) and how to resolve conflicting resource state.

## Summary

Corresponds to a standard `409 Conflict` HTTP response status

> The request conflicts with the current state of the target resource - for example, when creating a resource that already exists.

## Example Response

```json
{
    "code": "CONFLICT",
    "type": "https://docs.leyr.io/api/error-handling/conflict",
    "title": "Conflict",
    "status": 409,
    "detail": "Conflicting data with the current state of the target resource.",
    "instance": "36b5909e-4391-4520-b303-84cbb80c4264"
}
```

## Common Causes

- Creating a patient that already exists in the EHR (`PATIENT_ALREADY_EXISTS`)
- Creating or updating a resource that conflicts with existing data in the EHR

## Resolution Steps

1. Check the `errors` array in the response body for a specific `error_code`. See [Error Codes](https://docs.leyr.io/api/error-handling/error_codes) for the full list.
2. Look up the existing resource instead of creating a new one - for example, use patient search endpoints to find the already existing patient.
3. If you believe the conflict is incorrect, contact our support team at [contact@leyr.io](mailto:contact@leyr.io) with the `instance` ID from the error response.


## Sitemap

See the full [sitemap](https://docs.leyr.io/sitemap.md) for all pages.
