# REST API Reference

Onoxsoft Panel REST API allows you to manage all hosting operations programmatically.

## Base URL

```
https://panel.yourdomain.com/api/v1
```

## Authentication

All API requests require a Bearer token:

```http
Authorization: Bearer onox_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
Content-Type: application/json
```

Generate tokens from **Admin > System > API Tokens**.

## Response Format

### Success

```json
{
    "success": true,
    "data": { ... },
    "meta": { "request_id": "req_01HX..." }
}
```

### Error

```json
{
    "success": false,
    "error": {
        "code": "ERROR_CODE",
        "message": "Human readable description"
    }
}
```

## Key Endpoints

| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | `/api/v1/accounts` | List all accounts |
| POST | `/api/v1/accounts` | Create account |
| DELETE | `/api/v1/accounts/{username}` | Delete account |
| POST | `/api/v1/accounts/{username}/suspend` | Suspend account |
| GET | `/api/v1/dns/zones` | List DNS zones |
| POST | `/api/v1/dns/zones/{zone}/records` | Add DNS record |
| POST | `/api/v1/ssl/certificates` | Issue SSL certificate |

## Quick Example

```bash
# Create a new hosting account
curl -X POST https://panel.yourdomain.com/api/v1/accounts \
  -H "Authorization: Bearer onox_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "newcustomer",
    "email": "customer@example.com",
    "password": "StrongP@ss123",
    "domain": "customer.com",
    "package_id": 2
  }'
```

For complete API documentation, see the [Turkish API reference](/tr/api/giris) which covers all endpoints with detailed examples.

## Rate Limiting

Default: 120 requests/minute for admin tokens. Rate limit headers are included in every response:

```
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 115
X-RateLimit-Reset: 1748808060
```
