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

# API Introduction

> Use the Nometria API to automate deployments, manage migrations, and integrate with your CI/CD pipeline.

The Nometria API lets you trigger deployments, check migration status, and manage your projects programmatically. Use it to integrate Nometria into your CI/CD pipeline or build internal tooling.

## Base URL

```
https://api.nometria.com/v1
```

## Authentication

All API requests require an API key passed in the `Authorization` header:

```bash theme={null}
Authorization: Bearer <your-api-key>
```

**Get your API key:** Dashboard → Settings → **API Keys** → **New Key**.

API keys are scoped to your account and have access to all your projects. Treat them like passwords — never commit them to source code.

<Warning>
  If an API key is compromised, revoke it immediately from Dashboard → Settings → API Keys.
</Warning>

## Request format

All request bodies must be JSON with `Content-Type: application/json`.

```bash theme={null}
curl -X POST https://api.nometria.com/v1/deployments \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"project_id": "proj_abc123"}'
```

## Response format

All responses are JSON. Successful responses return a `data` object. Errors return an `error` object:

```json theme={null}
// Success
{
  "data": {
    "id": "dep_xyz789",
    "status": "queued",
    "project_id": "proj_abc123"
  }
}

// Error
{
  "error": {
    "code": "not_found",
    "message": "Project proj_abc123 not found."
  }
}
```

## HTTP status codes

| Code  | Meaning                                                  |
| ----- | -------------------------------------------------------- |
| `200` | Success                                                  |
| `201` | Created                                                  |
| `400` | Bad request — check your request body                    |
| `401` | Unauthorized — invalid or missing API key                |
| `403` | Forbidden — API key doesn't have access to this resource |
| `404` | Not found                                                |
| `429` | Rate limited — back off and retry                        |
| `500` | Server error — contact support                           |

## Rate limits

| Tier | Requests per minute |
| ---- | ------------------- |
| Free | 30                  |
| Pro  | 120                 |
| Team | 600                 |

Rate limit headers are included in every response:

```
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 115
X-RateLimit-Reset: 1705000800
```

## Pagination

List endpoints return paginated results using cursor-based pagination:

```json theme={null}
{
  "data": [...],
  "pagination": {
    "has_more": true,
    "next_cursor": "cur_abc123"
  }
}
```

Pass `cursor=cur_abc123` as a query parameter to get the next page.

## SDKs

The Nometria API is a REST API — use it with any HTTP client.

**Node.js example:**

```javascript theme={null}
const response = await fetch('https://api.nometria.com/v1/projects', {
  headers: {
    'Authorization': `Bearer ${process.env.Nometria_API_KEY}`,
    'Content-Type': 'application/json'
  }
});
const { data } = await response.json();
```

**Python example:**

```python theme={null}
import urllib.request
import json
import os

req = urllib.request.Request(
    'https://api.nometria.com/v1/projects',
    headers={
        'Authorization': f"Bearer {os.environ['Nometria_API_KEY']}",
        'Content-Type': 'application/json'
    }
)
with urllib.request.urlopen(req) as res:
    data = json.loads(res.read())
```

## API endpoints

<Columns cols={2}>
  <Card title="Migrations" icon="arrow-right-arrow-left" href="/api-reference/migrations">
    Create, list, and check the status of migrations
  </Card>

  <Card title="Deployments" icon="rocket" href="/api-reference/deployments">
    Trigger, list, and rollback deployments
  </Card>
</Columns>
