# not_found: HTTP 404
URL: https://emailforagents.ai/docs/errors/not_found
Summary: No resource matching the identifiers in the path is visible to this credential, which covers both a resource that does not exist and one that exists outside the credential's allowed projects or inboxes. What triggers it in the implementation, and how to resolve it.

## not_found

HTTP 404 Don’t retry REST and MCP

No resource matching the identifiers in the path is visible to this credential, which covers both a resource that does not exist and one that exists outside the credential's allowed projects or inboxes.

### How to fix it

1. Check the identifier prefix. Ids are prefixed by type (prj_, ibx_, msg_ and so on), so an id copied from the wrong column never resolves. With a key or a connection, a project or inbox id that isn’t yours answers not_found; any other id in the path with the wrong prefix or shape currently gets a 503 temporarily_unavailable instead, which retrying won’t fix.
2. List the parent collection with the same credential. If the resource is absent from that listing, the credential is scoped away from it rather than the resource being missing.
3. Check the credential's project and inbox restrictions at GET /me. A key created with an inbox list only ever sees those inboxes.
4. Confirm the environment. A test key resolves only to test projects, so a live project id under a test key is correctly a 404.

### Which rule fired

Two different situations deliberately share this code. A row lookup that returns nothing raises it, which is the ordinary case. So does a scope check: when a credential is restricted to specific projects or inboxes and the path names one outside that list, the guard raises not_found rather than permission_denied. From outside, a project you may not touch is indistinguishable from a project that was never created, which is the point.

| In error.message | Means |
| --- | --- |
| `Resource not found.` | The credential is restricted to a project list and the project in the path is not on it. The credential is restricted to an inbox list and the inbox in the path is not on it. A row lookup that must return exactly one record returns none. This is the shared helper behind most single-resource reads. Reading or downloading an export that another member requested. An export is visible only to the member who asked for it. |
| `Workspace not found.` | The signed-in person's workspace has been deleted. |
| `No workspace for this identity.` | A signed-in person who belongs to no workspace calls a route that needs one. |
| `Approval not found.` | Reading, approving or rejecting an approval that is not in the project, or not in an inbox this credential can see. |
| `Thread not found.` | Listing the messages of a thread that is not in the inbox. |
| `Inbox not found.` | Reading or saving the sending rules of an inbox that is not in the project. Reserving an upload for an inbox that is not in the project, or not active. |
| `Active project not found.` | Reading or saving sending rules, or changing a webhook, in a project that is not active. |
| `Attachment not found in this inbox.` | An attachment id does not resolve within the workspace, project and inbox it was requested under. |
| `Attachment not found.` | Writing bytes to, completing, reading or downloading an upload or attachment that is not in the project. |
| `Webhook not found.` | Changing a webhook that is not in the project, or has been deleted. |
| `Key not found.` | Revoking a key that is not in the workspace. |
| `Inbox not found in the chosen project.` | Creating a key with an inbox_ids entry that is not in the project. |
| `Connection not found.` | Revoking a connection that is not in the project, or is already revoked. |

**Why it works this way:** Returning 404 instead of 403 for an out-of-scope resource is a deliberate trade against debuggability. A 403 would confirm that the id you guessed names a real project in someone's workspace, which turns any endpoint taking an id into an existence oracle. The cost is that a scoping mistake looks like a typo, which is why GET /me reports the restrictions.

### Example

GET /v1/projects/{project_id}/inboxes/{inbox_id}/messages/{message_id}/body → 404

```
{
  "error": {
    "code": "not_found",
    "message": "Resource not found.",
    "request_id": "req_8Kd2x91",
    "retryable": false,
    "details": {}
  }
}
```

The MCP server answers with this body when it refuses a call itself. Inside a tool call it comes back as text in a result marked `isError: true`, without the code.

#### Where it appears

- Every /v1 route that names a resource
- `GET /projects/{project_id}/inboxes`
- `GET /projects/{project_id}/inboxes/{inbox_id}/messages/{message_id}/body`
- `GET /projects/{project_id}/approvals/{approval_id}`
- `GET /projects/{project_id}/inboxes/{inbox_id}/threads/{thread_id}/messages`

Paths are relative to `https://api.emailforagents.ai/v1`.

### Often confused with

[permission_denied](https://emailforagents.ai/docs/errors/permission_denied) [unauthenticated](https://emailforagents.ai/docs/errors/unauthenticated)
