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

# REST API

> Programmatic access to the Narrative data collaboration platform

The Narrative REST API provides programmatic access to all platform functionality. Use the API to automate workflows, build custom integrations, and connect external systems to your data collaboration environment.

## Overview

The API follows REST conventions with:

* Resource-oriented URLs (e.g., `/datasets`, `/access-rules`)
* Standard HTTP verbs (GET, POST, PUT, DELETE)
* JSON-encoded request and response bodies
* Standard HTTP status codes for success and error states

## Base URL

All API requests use the following base URL:

```
https://api.narrative.io
```

## Authentication

All API endpoints require authentication using Bearer tokens. Include your API key in the `Authorization` header:

```bash theme={null}
curl -X GET "https://api.narrative.io/datasets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

<Card title="Create an API key" icon="key" href="/account-settings/api-keys">
  Generate API keys in your account settings
</Card>

## SDK alternative

For TypeScript and JavaScript applications, consider using the official SDK instead of calling the REST API directly. The SDK provides type safety, convenient methods, and simplified error handling.

<Card title="TypeScript SDK" icon="js" href="/reference/sdks/typescript">
  Learn about the TypeScript SDK
</Card>

## Related resources

* [API Keys](/account-settings/api-keys) - Create and manage API keys
* [SDKs](/reference/sdks) - Official SDKs for programmatic access
* [Error Handling](/guides/sdk/error-handling) - Understanding error responses
