API Reference

Complete REST API documentation for SitemapHost with authentication, endpoints, and error handling

The SitemapHost REST API lets you programmatically manage domains, upload sitemaps, and monitor status. All API access is over HTTPS and uses JSON request and response bodies.

Base URL

All API requests are made to:

https://dash.sitemaphost.app/api

Authentication

Every API request requires authentication via an API key. You can send your key using either method:

MethodHeaderFormat
API Key headerX-API-Keysk_live_xxxxxxxxxxxxxxxx
Bearer tokenAuthorizationBearer sk_live_xxxxxxxxxxxxxxxx
# Using X-API-Key header
curl https://dash.sitemaphost.app/api/domains \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxx"

# Using Authorization header
curl https://dash.sitemaphost.app/api/domains \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx"

API keys are created in the dashboard. See Authentication for details on key management and security best practices.

Content Type

All requests with a body must use Content-Type: application/json. Responses are always JSON.

curl -X POST https://dash.sitemaphost.app/api/sitemap/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxx" \
  -d '{ ... }'

Rate Limits

API rate limits are based on your plan:

PlanRequests per Minute
Free5
Starter20
Pro100
Business500
Enterprise1,000

When you exceed your rate limit, the API returns a 429 Too Many Requests response with a Retry-After header indicating how many seconds to wait:

HTTP/1.1 429 Too Many Requests
Retry-After: 30
Content-Type: application/json

{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Please retry after 30 seconds."
  }
}

Response Format

All API responses follow a consistent structure.

Success responses

{
  "success": true,
  "data": {
    // Response payload
  }
}

Error responses

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "A human-readable error description."
  }
}

Common error codes

HTTP StatusError CodeDescription
400BAD_REQUESTInvalid request body or parameters
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENAPI key does not have access to this resource
404NOT_FOUNDResource not found
409CONFLICTResource already exists (e.g., duplicate domain)
413PAYLOAD_TOO_LARGERequest body exceeds maximum size
422VALIDATION_ERRORRequest body failed validation
429RATE_LIMIT_EXCEEDEDToo many requests
500INTERNAL_ERRORServer error (please report these)

API Endpoints

MethodEndpointDescriptionDocs
POST/api/sitemap/generateUpload URLs and generate sitemapUpload
POST/api/domainsAdd a new domainDomains
GET/api/domainsList all domainsDomains
POST/api/domains/:id/verifyVerify domain DNSDomains
DELETE/api/domains/:idDelete a domainDomains

Pagination

List endpoints that may return many results support cursor-based pagination:

# First page
curl https://dash.sitemaphost.app/api/domains \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxx"

# Next page (using cursor from previous response)
curl "https://dash.sitemaphost.app/api/domains?cursor=abc123" \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxx"

Paginated responses include a pagination object:

{
  "success": true,
  "data": [ ... ],
  "pagination": {
    "hasMore": true,
    "cursor": "abc123"
  }
}

SDKs and Libraries

SitemapHost provides a REST API that works with any HTTP client. Here are examples in common languages:

cURL

curl -X POST https://dash.sitemaphost.app/api/sitemap/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk_live_xxxxxxxxxxxxxxxx" \
  -d '{"domain": "sitemap.yoursite.com", "urls": [{"loc": "https://yoursite.com/"}]}'

JavaScript (fetch)

const response = await fetch(
  "https://dash.sitemaphost.app/api/sitemap/generate",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": "sk_live_xxxxxxxxxxxxxxxx",
    },
    body: JSON.stringify({
      domain: "sitemap.yoursite.com",
      urls: [{ loc: "https://yoursite.com/" }],
    }),
  }
);

const result = await response.json();

Python (requests)

import requests

response = requests.post(
    "https://dash.sitemaphost.app/api/sitemap/generate",
    headers={
        "Content-Type": "application/json",
        "X-API-Key": "sk_live_xxxxxxxxxxxxxxxx",
    },
    json={
        "domain": "sitemap.yoursite.com",
        "urls": [{"loc": "https://yoursite.com/"}],
    },
)

result = response.json()

PHP

$response = wp_remote_post(
    'https://dash.sitemaphost.app/api/sitemap/generate',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'X-API-Key'    => 'sk_live_xxxxxxxxxxxxxxxx',
        ],
        'body' => json_encode([
            'domain' => 'sitemap.yoursite.com',
            'urls'   => [['loc' => 'https://yoursite.com/']],
        ]),
    ]
);

Next Steps