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

# API reference

> Base URL, authentication, and response format for the ego API.

The ego API is HTTP and JSON. Every request reads through ego, scoped to the connections your key can see. The endpoint pages in this section are generated from the [OpenAPI specification](https://github.com/yasyf/ego/blob/main/docs/api-reference/openapi.json), so the parameters and responses shown there match the spec exactly.

<Note>
  The API is in preview. The base URL and endpoints describe the shape we're building
  toward and aren't live yet.
</Note>

## Base URL

All endpoints are relative to:

```
https://api.myego.dev
```

## Authentication

Authenticate with an API key, passed as a bearer token on every request:

```bash theme={null}
Authorization: Bearer $EGO_API_KEY
```

Keys are secrets. Keep them out of source control and client-side code. A request with a missing or invalid key returns `401`.

## Scopes

A token carries the scopes you grant on the consent screen. Each endpoint requires its native scope; a request without it returns `403`.

| Scope                 | Authorizes                                                          |
| --------------------- | ------------------------------------------------------------------- |
| `approvals:write`     | Submit approvals for the owner to decide.                           |
| `approvals:read`      | List and fetch the app's submitted approvals and their resolutions. |
| `approvals:resolve`   | Resolve the app's own approvals through the API.                    |
| `notifications:write` | Push notifications to the owner's inbox.                            |
| `notifications:read`  | List the app's pushed notifications.                                |

## Responses

Successful responses are JSON. List endpoints return their results under a `data` array.

Errors return a JSON object with a human-readable `error` message:

```json theme={null}
{
  "error": "Unauthorized"
}
```
