---
title: "BAD_REQUEST"
description: "What triggers a BAD_REQUEST error (HTTP 400) and how to fix malformed or invalid API requests."
canonical_url: "https://docs.leyr.io/api/error-handling/bad_request"
---
# BAD_REQUEST

> What triggers a BAD_REQUEST error (HTTP 400) and how to fix malformed or invalid API requests.

## Summary

Corresponds to a standard `400 Bad Request` HTTP response status

> Indicates that the server cannot process the request due to a client error (such as malformed syntax, invalid message framing, or deceptive routing).

## Example Response

```json
{
    "code": "BAD_REQUEST",
    "type": "https://docs.leyr.io/api/error-handling/bad_request", 
    "title": "Request validation failed",
    "status": 400,
    "detail": "1 validation error for Request\nquery -> standard\n  value is not a valid enumeration member; permitted: 'fhir' (type=type_error.enum; enum_values=[<Standard.fhir: 'fhir'>])",
    "instance": "36b5909e-4391-4520-b303-84cbb80c4264"
}
```

## Common Causes

- Missing required parameters in the request body, headers, or query parameters
- Invalid parameter values, such as unsupported values for specific EHR systems
- Validation conflicts, such as attempting to create a user with an email address that already exists

## Resolution Steps

1. Check the `detail` field in the response body. This field contains specific information about the error, helping you identify the exact issue.
Our error responses follow the [Pydantic error message](https://docs.pydantic.dev/latest/concepts/models/#error-handling) format, providing detailed information about missing or invalid parameters and their location (body, query, path).
2. Verify your request against our [API Reference](https://api.leyr.io/docs). Pay particular attention to:
  - Required parameters
  - Parameter descriptions and constraints
  - Allowed value ranges or enumerations
3. If you need additional assistance, contact our support team at [contact@leyr.io](mailto:contact@leyr.io).


## Sitemap

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