> ## Documentation Index
> Fetch the complete documentation index at: https://gtmsdk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fix: Attio company endpoints return 400/404 for validation and not-found errors

> The http_attio_company_* endpoints caught only a narrow exception allow-list, so AttioValidationError and AttioNotFoundError escaped as HTTP 500; the wrappers now convert every exception through the error envelope.

## Bug fixes

**Validation and not-found errors on the company HTTP endpoints (issue #858)**

The three company HTTP endpoints — `http_attio_company_add`,
`http_attio_companies_search`, and `http_attio_company_update` — wrap the
typed-error contract of `libs/attio/companies.py`, but their `except` clause
allowed only `(ValueError, RuntimeError, KeyError, AttributeError, TypeError,
ConflictError)`. The typed errors the library raises locally on
Pydantic-valid input — `AttioValidationError` for an empty search query or a
missing record selector, and `AttioNotFoundError` for a domain selector that
matches nothing — are not subclasses of any caught type, so they escaped the
`@modal.fastapi_endpoint` wrapper and surfaced as HTTP 500.

`error_response_from_exception` already classified both to 400 and 404; the
wrappers simply never called it for them. The catch is now `except Exception`
— the same pattern the note endpoints use — so a future `AttioError` subclass
can't silently reopen the gap. The conflict path was already correct and is
unchanged.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.