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

# API Reference Introduction

> Complete reference for the Widgetic API

Welcome to the Widgetic API Reference. This documentation covers all public endpoints available to developers and partners.

## Base URL

All API requests should be made to:

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

## Authentication

Include your API key in the Authorization header:

```
Authorization: Bearer YOUR_API_KEY
```

See [Authentication](https://widgetic.com/docs/authentication.md) for details on API key types and access levels.

## Request Format

* **Content-Type**: `application/json` for request bodies
* **Accept**: `application/json` for responses

## Response Format

All responses follow a consistent envelope:

### Success Response

```json theme={null}
{
  "success": true,
  "data": { ... },
  "meta": {
    "page": 1,
    "size": 20,
    "total": 150
  }
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "correlationId": "req_unique-correlation-id"
  }
}
```

## Endpoint Access Levels

Endpoints specify their access level via `x-access-level`:

| Level | Description | Required Key |
| - | - | - |
| `public` | Any authenticated user | Any key type |
| `user` | User-level access | `wgt_usr_`, `wdg_org_`, `wgt_prt_`, or `wgt_adm_` |
| `partner` | Partner-level access | `wgt_prt_` or `wgt_adm_` |
| `admin` | Admin-level access | `wgt_adm_` only |

## Available Tags

The API is organized by these resource tags:

> [card] Tokens
>
> Token validation and exchange

> [card] Entitlements
>
> Feature access and limits

> [card] Widgets
>
> Widget management

> [card] Compositions
>
> Composition layouts

> [card] Canvases
>
> Widget editing canvases

> [card] Components
>
> Canvas components

> [card] Managed Users
>
> End-user management and editor sessions (partners)

> [card] Partners
>
> Partner billing and credits

> [card] Conversations
>
> AI conversation history

> [card] Messages
>
> Conversation messages

> [card] Analytics
>
> Usage analytics

## SDK Support

Use our official TypeScript SDK for the best developer experience:

```bash theme={null}
npm install @widgetic/api-sdk-ts
```

```typescript theme={null}
import { WidgetsApi, CompositionsApi } from '@widgetic/api-sdk-ts';

const widgets = new WidgetsApi('YOUR_API_KEY');
const compositions = new CompositionsApi('YOUR_API_KEY');
```

## Try It Out

Each endpoint in this reference includes a "Try It" feature. Enter your API key to test endpoints directly from the documentation.

> [!WARNING]
>
> Be careful when testing destructive operations (DELETE, PUT) on production data.

## Getting Help

* Check [Errors](https://widgetic.com/api-reference/errors.md) for error code explanations
* See [Usage Limits](https://widgetic.com/api-reference/usage-limits.md) for rate limits
* Contact [support@widgetic.com](mailto:support@widgetic.com) for assistance


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.