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

# API-overzicht

> Bouw en implementeer webapplicaties programmatisch met de Macaly API

De Macaly API stelt externe applicaties in staat om chatsessies aan te maken, webapplicaties te bouwen met AI en deze programmatisch in productie te implementeren.

<Callout icon="user">
  Alleen beschikbaar in het [**pakket Bureaus**](/docs/nl/welcome/pricing)
</Callout>

## Basis-URL

```
https://www.macaly.com
```

## Snel starten

1. **Haal een API-sleutel op** - Zie [Authenticatie](/docs/nl/api/authentication)
2. **Maak een chat aan** - Stuur een prompt om te beginnen met bouwen
3. **Controleer de status** - Wacht tot de AI klaar is
4. **Implementeer** - Publiceer uw app in productie

## Beschikbare endpoints

| Methode | Endpoint                                                   | Beschrijving                                             |
| ------- | ---------------------------------------------------------- | -------------------------------------------------------- |
| POST    | [`/api/chat`](/docs/nl/api/create-chat)                         | Een nieuwe chat aanmaken en beginnen met bouwen          |
| POST    | [`/api/chat/{chatId}/publish`](/docs/nl/api/publish-message)    | Een bericht naar een bestaande chat sturen               |
| POST    | [`/api/client-app/assets/upload`](/docs/nl/api/upload-asset)    | Een bestand uploaden en een permanente CDN-URL ontvangen |
| GET     | [`/api/chat/{chatId}/status`](/docs/nl/api/get-status)          | Workflowstatus opvragen                                  |
| GET     | [`/api/chat/{chatId}/subscribe`](/docs/nl/api/subscribe-stream) | Abonneren op de realtime stream                          |
| POST    | [`/api/chat/{chatId}/deploy`](/docs/nl/api/deploy)              | Chat implementeren in productie                          |
| GET     | [`/api/chat/{chatId}/deployment`](/docs/nl/api/get-deployment)  | Implementatiestatus ophalen                              |

## Limieten en credits

* API-verzoeken verbruiken credits van het saldo van uw team
* Elke chataanmaak kost hetzelfde als via de webinterface
* Mislukte API-sleutelpogingen zijn gelimiteerd (5 per minuut per IP)
* Houd uw verbruik in de gaten via **Instellingen → Gebruik en limieten**

## Foutafhandeling

Alle fouten retourneren JSON met een `error`-veld:

```json theme={null}
{
  "error": "Error message here"
}
```

### HTTP-statuscodes

| Status | Beschrijving                                                     |
| ------ | ---------------------------------------------------------------- |
| 400    | Bad Request - Ongeldig verzoek                                   |
| 401    | Unauthorized - Ongeldige of ontbrekende API-sleutel              |
| 402    | Payment Required - Onvoldoende credits                           |
| 403    | Forbidden - Geen toestemming of verkeerd team                    |
| 404    | Not Found - Resource niet gevonden                               |
| 422    | Unprocessable Entity - Validatiefout                             |
| 429    | Too Many Requests - Limiet bereikt                               |
| 500    | Internal Server Error - Serverfout                               |
| 503    | Service Unavailable - Server is bezig, probeer het later opnieuw |
