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

# REST API introduction

> Programmatic access to Metabind for components, content, assets, and packages

The Metabind REST API provides programmatic access to everything App Studio exposes — components and packages, content types and entries, assets, organizations and projects, roles and tokens. Use it to integrate Metabind into your workflows, automate content operations, or build custom tooling around the platform.

If you're new, start with the [REST API quickstart](/rest/quickstart) — it gets you to your first call in five minutes.

## API capabilities

* **Component management** for view and layout components
* **Package versioning** and dependency management
* **Content type definition** with template support
* **Content creation** and management
* **Asset management** with CDN integration for both content and components
* **Role-based access control** and user management
* **Multi-platform content delivery**

## Base URL

All API requests use this base URL:

```
https://api.metabind.ai
```

The API has two primary route prefixes:

| Route Prefix  | Authentication              | Use Case                                  |
| ------------- | --------------------------- | ----------------------------------------- |
| `/api/v1/...` | `x-api-key` header          | Client API (read-only, published content) |
| `/app/v1/...` | `Authorization: Bearer JWT` | Admin API (full CRUD operations)          |

All endpoints are scoped to an organization and project:

```
/app/v1/organizations/{organizationId}/projects/{projectId}/[resource]
```

## Authentication

API requests require authentication. The method depends on the route:

**Client API** (`/api/v1/...`) - for consuming published content:

```javascript theme={null}
headers: {
  'x-api-key': 'YOUR_API_KEY',
  'Content-Type': 'application/json'
}
```

**Admin API** (`/app/v1/...`) - for content management:

```javascript theme={null}
headers: {
  'Authorization': 'Bearer YOUR_JWT',
  'Content-Type': 'application/json'
}
```

## Making requests

### Example request

```bash theme={null}
curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content?status=published" \
  -H "Authorization: Bearer YOUR_JWT"
```

### Example response

```json theme={null}
{
  "data": [
    {
      "id": "cont124",
      "typeId": "ct123",
      "typeVersion": 2,
      "version": 1,
      "lastPublishedVersion": 1,
      "packageVersion": "1.0.0",
      "name": "Getting Started Guide",
      "description": "Getting Started with Metabind. A comprehensive guide...",
      "status": "published",
      "isTemplate": false,
      "content": {
        "title": "Getting Started with Metabind",
        "components": [...]
      },
      "tags": ["Tutorial"],
      "metadata": {
        "author": "jane.doe@metabind.ai",
        "publishedAt": "2024-03-21T14:30:00Z",
        "publishedBy": "user123",
        "locale": "en-US"
      },
      "createdAt": "2024-03-21T10:00:00Z",
      "updatedAt": "2024-03-21T14:30:00Z"
    }
  ],
  "pagination": {
    "lastKey": "eyJpZCI6ImNvbnQxMjQifQ=="
  }
}
```

## Where to go next

<CardGroup cols={2}>
  <Card title="REST API quickstart" icon="rocket" href="/rest/quickstart">
    Five-minute path to your first authenticated call.
  </Card>

  <Card title="Authentication" icon="key" href="/rest/authentication">
    JWTs, API keys, scopes, and rotation.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/rest/errors">
    Status codes and recovery patterns.
  </Card>

  <Card title="Core concepts" icon="cube" href="/rest/core-concepts">
    The resource model — components, packages, content.
  </Card>
</CardGroup>
