StarDomain

Getting Started with the API

Getting Started with the API

The {{COMPANY_NAME}} API allows you to programmatically manage your hosting services, domains, DNS records, and account settings. This guide provides an overview of the API, how to authenticate, and how to make your first request.

API Overview

Our RESTful API enables you to:

  • Domain management: Register, renew, transfer, and configure domains
  • DNS management: Create, update, and delete DNS records
  • Hosting management: Provision, manage, and monitor hosting services
  • Account management: Update profile information, view invoices, manage contacts
  • Order management: Place new orders, check order status, view order history

Base URL

All API requests are made to:

https://api.{{COMPANY_NAME}}.com/v1

All requests must use HTTPS. HTTP requests will be rejected.

Authentication

The API uses Bearer token authentication. Include your API token in the Authorization header of every request:

Authorization: Bearer YOUR_API_TOKEN

To generate an API token:

  1. Log in to your {{COMPANY_NAME}} client portal
  2. Navigate to Account Settings > API Access
  3. Click Generate New Token
  4. Give your token a descriptive name (e.g., "Production App", "Dev Testing")
  5. Copy and securely store the token — it will only be displayed once

Tip: Treat your API token like a password. Never expose it in client-side code, public repositories, or logs. See our API Authentication Guide for security best practices.

Making Your First Request

Check Your Account Profile

A simple GET request to verify your authentication:

curl -X GET https://api.{{COMPANY_NAME}}.com/v1/account/profile \\
  -H "Authorization: Bearer YOUR_API_TOKEN" \\
  -H "Content-Type: application/json"

Example Response

{
  "status": "success",
  "data": {
    "id": "cust_abc123",
    "name": "John Doe",
    "email": "[email protected]",
    "company": "Example Corp"
  }
}

Request Format

Headers

All requests must include:

  • Authorization: Bearer YOUR_API_TOKEN
  • Content-Type: application/json (for POST/PUT/PATCH requests)

HTTP Methods

MethodUsage
GETRetrieve resources
POSTCreate new resources
PUTReplace a resource entirely
PATCHPartially update a resource
DELETERemove a resource

Response Format

All responses are JSON and follow this structure:

Success Response

{
  "status": "success",
  "data": { ... }
}

Error Response

{
  "status": "error",
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "The domain name is invalid"
  }
}

Common HTTP Status Codes

CodeMeaning
200Success
201Resource created
400Bad request (invalid parameters)
401Unauthorized (invalid or missing token)
403Forbidden (insufficient permissions)
404Resource not found
429Rate limit exceeded
500Internal server error

Rate Limits

To ensure fair usage, the API enforces rate limits:

  • Standard: 60 requests per minute
  • Burst: Up to 10 requests per second

Rate limit headers are included in every response:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 55
X-RateLimit-Reset: 1679900000

If you exceed the rate limit, you will receive a 429 status code. Wait until the reset time before making more requests.

Pagination

List endpoints return paginated results:

GET /v1/domains?page=1&limit=25

Pagination metadata is included in the response:

{
  "status": "success",
  "data": [...],
  "pagination": {
    "page": 1,
    "limit": 25,
    "total": 150,
    "totalPages": 6
  }
}

Next Steps

  1. API Authentication Guide — detailed token management and security
  2. Explore the full API documentation in your client portal under API Access
  3. Test endpoints using tools like curl, Postman, or Insomnia

Need help with the API? Contact our support team at {{SUPPORT_EMAIL}} or open a ticket at {{SUPPORT_URL}}.