API Documentation
Comprehensive guide to the Flexiscale RESTful API for automated domain management
Getting Started with the API
Base URL
https://api.flexiscale.co.uk/v1/Authentication
All API requests require authentication using API keys. Generate your API key from the dashboard.
API Key Setup
- Log in to your Flexiscale dashboard
- Navigate to Account → API Keys
- Click "Generate New API Key"
- Set permissions (read-only, read-write, admin)
- Copy and securely store your API key
Request Headers
Authorization: Bearer YOUR_API_KEY Content-Type: application/json Accept: application/json
Domain Management Endpoints
List Domains
GET /domains
Retrieve a list of all domains in your account
Example Request
curl -X GET "https://api.flexiscale.co.uk/v1/domains" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
Example Response
{
"status": "success",
"data": {
"domains": [
{
"id": "12345",
"name": "example.co.uk",
"status": "active",
"expiry_date": "2025-12-31",
"auto_renew": true,
"nameservers": [
"ns1.flexiscale.co.uk",
"ns2.flexiscale.co.uk"
]
}
],
"total": 1,
"page": 1,
"per_page": 50
}
}Register Domain
POST /domains
Register a new domain name
Example Request
curl -X POST "https://api.flexiscale.co.uk/v1/domains" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "newdomain.co.uk",
"period": 1,
"registrant": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+44 1234 567890",
"address": {
"line1": "123 Main Street",
"city": "London",
"postal_code": "SW1A 1AA",
"country": "GB"
}
},
"nameservers": [
"ns1.example.com",
"ns2.example.com"
],
"auto_renew": true
}'DNS Management Endpoints
Get DNS Records
GET /domains/{domain}/dns
Retrieve DNS records for a domain
Create DNS Record
POST /domains/{domain}/dns
Add a new DNS record
Supported Record Types
- • A: IPv4 address
- • AAAA: IPv6 address
- • CNAME: Canonical name
- • MX: Mail exchange
- • TXT: Text records
- • SRV: Service records
- • NS: Nameserver
- • PTR: Pointer records
Example: Add A Record
curl -X POST "https://api.flexiscale.co.uk/v1/domains/example.co.uk/dns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "A",
"name": "www",
"value": "192.168.1.1",
"ttl": 3600
}'Response Codes & Error Handling
HTTP Status Codes
200OK - Request successful
201Created - Resource created successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing API key
404Not Found - Resource not found
429Rate Limited - Too many requests
Error Response Format
{
"status": "error",
"error": {
"code": "DOMAIN_NOT_FOUND",
"message": "The specified domain was not found in your account",
"details": {
"domain": "nonexistent.co.uk"
}
}
}Rate Limiting
- Standard: 1000 requests per hour
- Burst: 100 requests per minute
- Rate limit headers included in responses
- Contact support for higher limits
SDKs & Libraries
We provide official SDKs for popular programming languages:
PHP SDK
composer require flexiscale/php-sdkFull-featured PHP library with Laravel integration
Python SDK
pip install flexiscale-pythonPython 3.6+ compatible with async support
Node.js SDK
npm install @flexiscale/node-sdkTypeScript definitions included
Go SDK
go get github.com/flexiscale/go-sdkIdiomatic Go with full context support