Docs / API / Add Record

Add New Record

Create a new DNS record for a registered domain. This endpoint supports various record types including A, AAAA, CNAME, MX, TXT, SRV, CAA, and NAPTR.

Endpoint

POSThttps://api.alinflow.com/v1/domain/records/add

Headers

HeaderValueRequired
AuthorizationBearer <token>Yes
Content-Typeapplication/jsonYes

Body Parameters

Common parameters required for all record types:

ParameterTypeRequiredDescription
domainNamestringYesThe root domain name (e.g., example.com).
namestringYesThe record name/host. Use @ for root or sub for subdomains.
typestringYesRecord type (A, AAAA, CNAME, MX, TXT, SRV, CAA, NAPTR).
valuestringYesThe content/target of the record (e.g., IP address or hostname).
ttlintegerNoTime to Live in seconds. Default is 300.

Type-specific parameters:

ParameterTypeApplies ToDescription
priorityintegerMX, SRVPriority value (0-65535).
weightintegerSRVRelative weight for records with same priority.
portintegerSRVTCP/UDP port number.
flagsintegerCAA, NAPTRIssuer critical flag (0-255) or NAPTR flags (e.g., "s").
tagstringCAAProperty tag (issue, issuewild, iodef).
orderintegerNAPTRProcessing order.
preferenceintegerNAPTROrder preference.
servicestringNAPTRService parameter (e.g., "SIP+D2U").
regexpstringNAPTRSubstitution expression.
replacementstringNAPTRNext domain name to query.

Example Requests

1. Standard A Record

curl -X POST "https://api.alinflow.com/v1/domain/records/add" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "domainName": "example.com",
    "name": "blog",
    "type": "A",
    "value": "192.0.2.123",
    "ttl": 3600
  }'

2. MX Record

curl -X POST "https://api.alinflow.com/v1/domain/records/add" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "domainName": "example.com",
    "name": "@",
    "type": "MX",
    "value": "mail.example.com",
    "priority": 10
  }'

Success Response

{
  "success": true,
  "message": "Record added successfully",
  "data": {
    "name": "blog.example.com",
    "type": "A",
    "content": "192.0.2.123",
    "ttl": 3600
  }
}