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

# Response Format

> How Wappfy API responses are structured — the standard envelope, pagination, and error format.

# Response Format

All Wappfy API responses follow a consistent envelope format.

## Success responses

Every successful response is wrapped in a standard object:

```json theme={null}
{
  "success": true,
  "data": { ... },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2026-02-10T12:00:00.000Z"
  }
}
```

| Field            | Type              | Description                             |
| ---------------- | ----------------- | --------------------------------------- |
| `success`        | `boolean`         | Always `true` for successful responses  |
| `data`           | `object \| array` | The response payload                    |
| `meta.requestId` | `string`          | Unique request identifier for debugging |
| `meta.timestamp` | `string`          | ISO 8601 timestamp                      |

## Paginated responses

Endpoints that return lists include pagination metadata:

```json theme={null}
{
  "success": true,
  "data": {
    "items": [ ... ],
    "total": 42,
    "page": 1,
    "limit": 20,
    "totalPages": 3
  },
  "meta": {
    "requestId": "req_def456",
    "timestamp": "2026-02-10T12:00:00.000Z"
  }
}
```

Use the `page` and `limit` query parameters to control pagination:

```bash theme={null}
GET /api/instances?page=2&limit=10
```

## Error responses

Failed requests return an error object:

```json theme={null}
{
  "success": false,
  "error": {
    "code": "INSTANCE_NOT_FOUND",
    "message": "Instance with ID abc123 not found",
    "details": {}
  },
  "meta": {
    "requestId": "req_ghi789",
    "timestamp": "2026-02-10T12:00:00.000Z"
  }
}
```

### Common error codes

| HTTP Status | Code                  | Description                    |
| ----------- | --------------------- | ------------------------------ |
| `400`       | `VALIDATION_ERROR`    | Request body failed validation |
| `401`       | `UNAUTHORIZED`        | Missing or invalid auth token  |
| `403`       | `FORBIDDEN`           | Insufficient permissions       |
| `404`       | `NOT_FOUND`           | Resource does not exist        |
| `409`       | `PLAN_LIMIT_REACHED`  | Instance limit for your plan   |
| `429`       | `RATE_LIMIT_EXCEEDED` | Too many requests              |
| `500`       | `INTERNAL_ERROR`      | Unexpected server error        |

<Note>
  The `meta.requestId` is useful for support requests — include it when contacting support for faster debugging.
</Note>
