> For the complete documentation index, see [llms.txt](https://closer.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://closer.gitbook.io/documentation/api.md).

# API Reference

Welcome to the **Closer Platform API** documentation. This API allows you to build applications that interact with the Closer ecosystem—manage bookings, events, users, payments, and more.

## Getting Started

### Base URL

```
https://api.traditionaldreamfactory.com
```

### Authentication

All API requests require authentication using a Bearer token in the HTTP header:

```bash
curl -X GET "https://api.traditionaldreamfactory.com/api/user" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

> 🔑 **Getting an API Key:** Contact the platform administrator or generate one from your account settings.

### Response Format

All responses are returned in JSON format:

```json
{
  "results": [...],
  "count": 10,
  "page": 1
}
```

### Error Handling

| Status Code | Meaning                                   |
| ----------- | ----------------------------------------- |
| `200`       | Success                                   |
| `201`       | Created                                   |
| `400`       | Bad Request - Invalid parameters          |
| `401`       | Unauthorized - Invalid or missing API key |
| `403`       | Forbidden - Insufficient permissions      |
| `404`       | Not Found - Resource doesn't exist        |
| `500`       | Server Error                              |

***

## API Reference

### Core APIs

| API                                        | Description                            | Endpoints |
| ------------------------------------------ | -------------------------------------- | --------- |
| [Auth](/documentation/api/auth.md)         | Authentication and session management  | 20        |
| [Users](/documentation/api/users.md)       | User profile management                | 1         |
| [Bookings](/documentation/api/bookings.md) | Booking and reservation operations     | 21        |
| [Crud](/documentation/api/crud.md)         | Generic CRUD operations for all models | 547       |

### Payments & Billing

| API                                                                                      | Description                 | Endpoints |
| ---------------------------------------------------------------------------------------- | --------------------------- | --------- |
| [Payments](/documentation/api/payments.md)                                               | Payment processing          | 1         |
| [Payments-arx](https://github.com/closerdao/documentation/blob/main/api/payments-arx.md) | ARX payment integration     | 4         |
| [Stripe](/documentation/api/stripe.md)                                                   | Stripe payment integration  | 3         |
| [Subscriptions](/documentation/api/subscriptions.md)                                     | Subscription management     | 5         |
| [Charges](https://github.com/closerdao/documentation/blob/main/api/charges.md)           | Payment charges and billing | 2         |
| [Carrots](https://github.com/closerdao/documentation/blob/main/api/carrots.md)           | Token rewards system        | 7         |

### Content & Resources

| API                                                                              | Description                     | Endpoints |
| -------------------------------------------------------------------------------- | ------------------------------- | --------- |
| [Articles](https://github.com/closerdao/documentation/blob/main/api/articles.md) | Content articles and blog posts | 1         |
| [Event](/documentation/api/event.md)                                             | Event management                | 1         |
| [Products](https://github.com/closerdao/documentation/blob/main/api/products.md) | Product catalog                 | 2         |
| [Photo](https://github.com/closerdao/documentation/blob/main/api/photo.md)       | Photo uploads and management    | 2         |

### System & Utilities

| API                                                                                  | Description           | Endpoints |
| ------------------------------------------------------------------------------------ | --------------------- | --------- |
| [Health](https://github.com/closerdao/documentation/blob/main/api/health.md)         | API health checks     | 1         |
| [Meta](https://github.com/closerdao/documentation/blob/main/api/meta.md)             | API metadata          | 4         |
| [Swagger](https://github.com/closerdao/documentation/blob/main/api/swagger.md)       | OpenAPI specification | 1         |
| [Moderator](https://github.com/closerdao/documentation/blob/main/api/moderator.md)   | Content moderation    | 2         |
| [Onboarding](https://github.com/closerdao/documentation/blob/main/api/onboarding.md) | User onboarding flows | 1         |

### Other APIs

| API                                                                                                    | Description            | Endpoints |
| ------------------------------------------------------------------------------------------------------ | ---------------------- | --------- |
| [Accounting](https://github.com/closerdao/documentation/blob/main/api/accounting.md)                   | Accounting operations  | 1         |
| [Actions](https://github.com/closerdao/documentation/blob/main/api/actions.md)                         | Custom actions         | 1         |
| [Emails](https://github.com/closerdao/documentation/blob/main/api/emails.md)                           | Email notifications    | 1         |
| [Finance-application](https://github.com/closerdao/documentation/blob/main/api/finance-application.md) | Finance applications   | 4         |
| [Metrics](https://github.com/closerdao/documentation/blob/main/api/metrics.md)                         | Analytics and metrics  | 1         |
| [Paygrid](https://github.com/closerdao/documentation/blob/main/api/paygrid.md)                         | Paygrid integration    | 1         |
| [Proposals](/documentation/api/proposals.md)                                                           | Governance proposals   | 6         |
| [Reporting](https://github.com/closerdao/documentation/blob/main/api/reporting.md)                     | Reports generation     | 1         |
| [Sale](https://github.com/closerdao/documentation/blob/main/api/sale.md)                               | Sales operations       | 1         |
| [Toconline](https://github.com/closerdao/documentation/blob/main/api/toconline.md)                     | TOC Online integration | 1         |
| [Token](/documentation/api/token.md)                                                                   | Token operations       | 4         |
| [User-reports](https://github.com/closerdao/documentation/blob/main/api/user-reports.md)               | User reporting         | 1         |
| [Webinar](https://github.com/closerdao/documentation/blob/main/api/webinar.md)                         | Webinar management     | 1         |

***

## Data Models

See [**schemas.md**](/documentation/api/schemas.md) for complete documentation of all data models including:

* **Booking** - Accommodation and event reservations
* **Event** - Community events and gatherings
* **User** - User profiles and authentication
* **Listing** - Accommodation listings
* **Product** - Products for sale
* **Ticket** - Event tickets
* And many more...

***

## Common Patterns

### Pagination

Most list endpoints support pagination:

```bash
GET /api/booking?limit=20&page=1
```

| Parameter | Type    | Default | Description                |
| --------- | ------- | ------- | -------------------------- |
| `limit`   | integer | 20      | Number of results per page |
| `page`    | integer | 1       | Page number                |

### Filtering

Filter results using query parameters:

```bash
GET /api/booking?where={"status":"confirmed"}
```

### Sorting

Sort results by any field:

```bash
GET /api/booking?sort_by=-created
```

Use `-` prefix for descending order.

### Field Selection

Select specific fields to reduce response size:

```bash
GET /api/booking?fields=_id,status,checkin,checkout
```

***

## Rate Limiting

API requests are rate-limited to ensure fair usage. If you exceed the limit, you'll receive a `429 Too Many Requests` response.

***

## Need Help?

* 📖 **Interactive API:** [Swagger UI](https://api.traditionaldreamfactory.com/swagger)
* 💬 **Support:** Contact the platform team
* 🐛 **Found a bug?** Report issues through the appropriate channels

***

*This documentation is auto-generated from the OpenAPI specification.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://closer.gitbook.io/documentation/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
