# 400 Attempt Failed

The server will not process the request due to validation error.

The client can try again after fixing the indicated validation issue IFF number of `remainingAttempts` is greater than `0`.

### Extra metadata

#### `remainingAttempts`

A `number` indicating number of remaining attempts the client can re-try the submission before needing to restart the process.&#x20;

Usually used around some verification process, i.e. in a user profile collection were user needs to provide a verification code for email or phone number.

#### `fields`

*Optional*

A optional property which is a JSON object listing validation issues where the key is the name of the field and the value is validation issue. These fields should refer to the primary entity being validated by the endpoint, for instance query parameters for GET requests, request body for POST requests.

For nested input objects, the server can either use nested objects (`{ "person": { "lastName": "Issue" } }` or the path to the field (`{ "person.lastName": "Issue" }`).

These validation issues should be written in such a way that they can be presented to the user. As such, they should be localized according to the user locale, for example using the Accept-Language header.

### Example

```
400 Attempt Failed
Content-Type: application/problem+json

{
  "type": "https://docs.devland.is/reference/problems/attempt-failed",
  "title": "Attempt Failed",
  "status": 400,
  "detail": "2 attempts remaining. Validation issues found in fields: smsVerificationCode.",
  "remainingAttempts": 2
  "fields": {
    "smsVerificationCode": "Verification code does not match.",
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devland.is/reference/problems/attempt-failed.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
