# API errors

Every failed HTTP request returns a closed envelope:

```json
{
  "error": {
    "type": "urn:dominican-locations:problem:invalid_parameter",
    "code": "invalid_parameter",
    "message": "Request parameters are invalid",
    "param": "q",
    "docUrl": "https://github.com/gustavovalverde/dominican-locations/blob/main/docs/api-errors.md#invalid_parameter",
    "requestId": "req-..."
  }
}
```

The `type` URI and `code` are stable. `param` is either the rejected parameter name or `null` when the error is not tied to one input. `requestId` identifies the request in server logs.

## Codes

<a id="catalog_unavailable"></a>

### Catalog unavailable

No active catalog can serve the request.

<a id="catalog_publication_restricted"></a>

### Catalog publication restricted

The active or requested release has not cleared its provenance and redistribution gates.

<a id="release_not_found"></a>

### Release not found

The requested release key does not exist.

<a id="place_not_found"></a>

### Place not found

The requested public place ID does not exist in the release.

<a id="invalid_parameter"></a>

### Invalid parameter

A path or query value failed schema validation.

<a id="invalid_cursor"></a>

### Invalid cursor

The cursor is malformed or belongs to a different release, operation, search, parent, or filter set.

<a id="unsupported_filter"></a>

### Unsupported filter

The current query implementation cannot safely provide a requested filter.

<a id="malformed_json"></a>

### Malformed JSON

The request body is not valid JSON.

<a id="route_not_found"></a>

### Route not found

No public route matches the request.

<a id="internal_error"></a>

### Internal error

An unexpected server failure occurred.
