---
title: "method_not_allowed error"
url: "https://lookvalid.com/docs/errors/method_not_allowed.md"
canonical_url: "https://lookvalid.com/docs/errors/method_not_allowed"
last_updated: "2026-10-22"
type: "reference"
summary: "HTTP 405 method_not_allowed: This endpoint does not accept that HTTP method. Cause, fix and a curl example."
related: ["https://lookvalid.com/docs/errors.md", "https://lookvalid.com/docs/api.md"]
---

# method_not_allowed error

HTTP 405 method_not_allowed: This endpoint does not accept that HTTP method. Cause, fix and a curl example.

`method_not_allowed` is returned with HTTP **405**. Retryable: no. Sending the same request again returns the same error. Nothing is charged for this error.

## What it means

This endpoint does not accept that HTTP method.

## Most likely cause

The request used GET, PUT or another method on a lookup endpoint, often by opening the URL in a browser.

## How to fix it

Use the method named in the Allow response header (lookup endpoints and /v1/mcp accept POST).

## Example

Lookup endpoints accept POST only. A GET returns HTTP 405 with an `Allow: POST` header.

```sh
curl -i https://YOUR_API_HOST/v1/ip -H "Authorization: Bearer $LOOKVALID_API_KEY"
```

An error response is one JSON envelope. Branch on `code`, never on the message text. The `message` and `fix` of a real response can be more specific than the defaults shown here.

```json
{
  "error": {
    "code": "method_not_allowed",
    "message": "This endpoint does not accept that HTTP method.",
    "fix": "Use the method named in the Allow response header (lookup endpoints and /v1/mcp accept POST).",
    "docs_url": "https://lookvalid.com/docs/errors/method_not_allowed",
    "retryable": false,
    "request_id": "req_3fK9pQ2xVb7LmN4sTz8WcA"
  }
}
```

## See also

- [All error codes](https://lookvalid.com/docs/errors.md) with the response envelope.
- [API reference](https://lookvalid.com/docs/api.md).
- Quote the `request_id` when you write to [hello@lookvalid.com](mailto:hello@lookvalid.com).

## Related

- [Errors](https://lookvalid.com/docs/errors.md)
- [API reference](https://lookvalid.com/docs/api.md)
