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

# Introduction

> Welcome to the iClosed.io V1 API documentation. This documentation provides detailed information about our API endpoints, authentication methods, and usage examples.

## Overview

The iClosed.io V1 API is a RESTful API with organization-based rate limiting. All requests require authentication and an `X-Org-Id` header from the API Gateway authorizer.

## Base URLs

* **Production**: `https://public.api.iclosed.io`
* **Development**: `https://api-dev.iclosed.io`
* **Local**: `http://localhost:4000`

## Authentication

All API requests require authentication using a Bearer token with the format `iclosed-<token>`.

```bash theme={null}
Authorization: Bearer iclosed-your-api-key-here
```

## Rate Limiting

Per-account, per-action rate limits apply to all endpoints. When rate limits are exceeded, the API returns:

* **Status Code**: `429 Too Many Requests`
* **Response Headers**:
  * `RateLimit-Limit`: Maximum requests allowed in the current window
  * `RateLimit-Remaining`: Requests remaining in the current window
  * `RateLimit-Reset`: ISO 8601 timestamp when the rate limit resets
  * `Retry-After`: Seconds until the client can retry

## Error Handling

The API uses standard HTTP status codes and provides detailed error messages:

### Common Status Codes

* `200` - Success
* `201` - Created
* `400` - Bad Request / Validation Error
* `401` - Unauthorized (missing or invalid API key)
* `403` - Forbidden (insufficient permissions)
* `404` - Resource Not Found
* `429` - Rate Limit Exceeded
* `500` - Internal Server Error

### Error Response Formats

#### V1 Zod Validation (Detailed)

```json theme={null}
{
  "message": {
    "status": 400,
    "details": {
      "formErrors": [],
      "fieldErrors": {
        "email": ["Invalid email format"]
      }
    },
    "endpoint": "/v1/contacts",
    "method": "POST"
  }
}
```

#### Standard Validation

```json theme={null}
{
  "message": "Invalid request",
  "errors": {
    "email": ["Invalid email"],
    "name": ["Required"]
  }
}
```

## Support

If you need help or have questions, please contact our support team at [https://app.iclosed.io/support](https://app.iclosed.io/support).
