> ## 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

> Wappfy API responses कैसे structured होते हैं — standard envelope, pagination, और error format।

# Response Format

सभी Wappfy API responses एक consistent envelope format का पालन करते हैं।

## सफल responses

प्रत्येक सफल response एक standard object में wrapped होता है:

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

| Field            | Type              | विवरण                                      |
| ---------------- | ----------------- | ------------------------------------------ |
| `success`        | `boolean`         | सफल responses के लिए हमेशा `true`          |
| `data`           | `object \| array` | Response payload                           |
| `meta.requestId` | `string`          | Debugging के लिए unique request identifier |
| `meta.timestamp` | `string`          | ISO 8601 timestamp                         |

## Paginated responses

जो endpoints lists लौटाते हैं उनमें 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"
  }
}
```

Pagination को control करने के लिए `page` और `limit` query parameters का उपयोग करें:

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

## Error responses

विफल requests एक 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"
  }
}
```

### सामान्य error codes

| HTTP Status | Code                  | विवरण                            |
| ----------- | --------------------- | -------------------------------- |
| `400`       | `VALIDATION_ERROR`    | Request body validation में विफल |
| `401`       | `UNAUTHORIZED`        | Auth token गायब या अमान्य        |
| `403`       | `FORBIDDEN`           | अपर्याप्त permissions            |
| `404`       | `NOT_FOUND`           | Resource मौजूद नहीं है           |
| `409`       | `PLAN_LIMIT_REACHED`  | आपके plan की instance limit      |
| `429`       | `RATE_LIMIT_EXCEEDED` | बहुत अधिक requests               |
| `500`       | `INTERNAL_ERROR`      | अप्रत्याशित server error         |

<Note>
  `meta.requestId` support requests के लिए उपयोगी है — तेज debugging के लिए support से संपर्क करते समय इसे शामिल करें।
</Note>
