# Faults

Faults generated from API requests are .json documents with `fault` as the `object` property value. When reading and writing context properties, a `path` property will usually be available, representing the full property path. A fault may also have children, especially in the case of `cortex.invalidArgument.validation`, where property validation errors are represented as children, whose `path` property can be examined to pinpoint the error source.

Here's an example of listing a non-existent object:

{% tabs %}
{% tab title="" %}

```
$ mdctl api GET /missing
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "object": "fault",
    "name": "error",
    "code": "kInvalidObject",
    "errCode": "cortex.invalidArgument.object",
    "status": 400,
    "message": "Invalid or unknown object.",
    "path": "missing"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
There are two faults, `cortex.success.newLocation` and `cortex.accepted.mediaNotReady`, whose HTTP statuses are in the 2XX range. In these cases, clients must handle a seemingly successful response as a fault.
{% endhint %}

{% hint style="info" %}
Some faults may also have child faults represented as a `faults` array. For example, most validation errors (`cortex.invalidArgument.validation`) contains child faults so clients can pinpoint the source of each error.
{% endhint %}


---

# 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.medable.com/cortex-api/faults.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.
