Keplars
Domains

Create a domain API key

POST
/api/v1/public/domains/api-keys/create

Generates a Regular API key (kms_xxx.live_xxx) tied to a verified custom domain. Use this key to authenticate calls to /send-email/*.

The full key is shown once and cannot be retrieved again — store it securely.

Requires api-keys:create scope.

Authorization

bearerAuth
AuthorizationBearer <token>

Bearer token authentication. Use a Regular API key for email sending, or an Admin API key for marketing and automation endpoints.

Get your API keys from Settings → API Keys (regular) or Settings → Admin API Keys (admin) in the dashboard.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.keplars.com/api/v1/public/domains/api-keys/create" \  -H "Content-Type: application/json" \  -d '{    "name": "My App Key",    "custom_domain_id": "c74cfd4b-32b2-4e2e-ac2b-c2a7fdf6814a"  }'
{
  "success": true,
  "message": "string",
  "data": {
    "api_key": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "key_id": "string",
      "name": "string",
      "is_active": true,
      "expires_at": "2019-08-24T14:15:22Z",
      "created_at": "2019-08-24T14:15:22Z"
    },
    "secret_key": "kms_a1b2c3d4.live_e5f6g7h8..."
  }
}
{
  "success": false,
  "error": "VALIDATION_ERROR",
  "message": "Field 'to' is required"
}
{
  "success": false,
  "error": "VALIDATION_ERROR",
  "message": "Field 'to' is required"
}
{
  "success": false,
  "error": "VALIDATION_ERROR",
  "message": "Field 'to' is required"
}
{
  "success": false,
  "error": "VALIDATION_ERROR",
  "message": "Field 'to' is required"
}