### Setup Project Dependencies Source: https://github.com/easydmarc/public-api-docs/blob/main/README.md Install the necessary Node.js dependencies for the documentation site using npm. ```bash npm install ``` -------------------------------- ### Start Local Development Server Source: https://github.com/easydmarc/public-api-docs/blob/main/README.md Use this command to start a local development server for the documentation site. ```bash npm start ``` -------------------------------- ### DMARC Setup Record Response Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/get-started/3-basic-operations.mdx Example response containing the host, type, and value for your DMARC DNS record. ```json { "host": "_dmarc.domain1.com", "type": "txt", "value": "v=DMARC1;p=none;rua=mailto:abc123@rua.easydmarc.com;fo=1;" } ``` -------------------------------- ### GET /v1/domains/{domain}/setup Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/get-domains-domain-setup.api.mdx Retrieves the DMARC record information required for DNS setup. This endpoint is crucial for initiating DMARC implementation by providing the necessary DNS record details. ```APIDOC ## GET /v1/domains/{domain}/setup ### Description Returns the DMARC record to be added to DNS. This endpoint provides the necessary information to configure DMARC records within your DNS provider's settings. ### Method GET ### Endpoint /v1/domains/{domain}/setup ### Parameters #### Query Parameters - **type** (string) - Required - Record type, CNAME or TXT - **organizationId** (string) - Required - The ID of the organization owning the resources #### Path Parameters - **domain** (string) - Required - Domain name ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **example** (object) - Description of the response body structure #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Example Webhook Payload Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/get-started/5-webhooks.mdx This is an example of the JSON payload structure you can expect to receive for a 'domain.verified' event. It includes domain-specific data and metadata about the event. ```json { "data": { "domain": "easydmarc.us", "reason": "RUA address not found", "verificationStatus": "failed" }, "metadata": { "eventName": "domain.verified", "ownerId": "partner_1234567890" } } ``` -------------------------------- ### GET /v1/domains/{domain}/setup Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/get-started/3-basic-operations.mdx Generates the required DMARC record for a specific domain. ```APIDOC ## GET /v1/domains/{domain}/setup ### Description Generate a DMARC record and add it to your DNS provider. ### Method GET ### Endpoint /v1/domains/{domain}/setup ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name. #### Query Parameters - **type** (string) - Required - The record type (TXT or CNAME). - **organizationId** (string) - Required - The ID of the organization. ### Response #### Success Response (200) - **host** (string) - The DNS host record. - **type** (string) - The record type. - **value** (string) - The DMARC record value. ### Response Example { "host": "_dmarc.domain1.com", "type": "txt", "value": "v=DMARC1;p=none;rua=mailto:abc123@rua.easydmarc.com;fo=1;" } ``` -------------------------------- ### Get Available Plans Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/get-started/6-partner-integration.mdx Retrieves the list of plans and prices available for the partner to assign to organizations. ```bash curl -X GET https://api2.easydmarc.com/v1/partners/plans \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### API Response Format Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/index.mdx Example of a successful JSON response returned by the DNS lookup endpoint. ```json { "data": { "dmarc": "v=DMARC1; p=reject; rua=mailto:rua@example.com; ruf=mailto:ruf@example.com; pct=100" }, "meta": { "domain": "example.com", "record_type": "dmarc" } } ``` -------------------------------- ### Build for Production Source: https://github.com/easydmarc/public-api-docs/blob/main/README.md Commands to build the documentation site for production deployment. ```bash npm run build ``` ```bash npm run serve ``` -------------------------------- ### Create Organization Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/get-started/6-partner-integration.mdx Initializes a new organization for an end-customer. ```bash curl -X POST https://api2.easydmarc.com/v1.0/organizations \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -d '{"name":"Acme Inc."}' ``` -------------------------------- ### POST /v1/domains/{domain}/setup Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/post-domains-domain-setup.api.mdx Verifies the setup of a domain within the EasyDMARC system. This endpoint is used to confirm that a domain is correctly configured to work with EasyDMARC services. ```APIDOC ## POST /v1/domains/{domain}/setup ### Description Verifies the setup of a domain within the EasyDMARC system. This endpoint is used to confirm that a domain is correctly configured to work with EasyDMARC services. ### Method POST ### Endpoint /v1/domains/{domain}/setup ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name to verify. #### Request Body - **managed** (boolean) - Optional - Specifies if the domain is managed by EasyDMARC. - **tags** (object) - Optional - Key-value pairs for tagging the domain. ### Request Example ```json { "managed": true, "tags": { "environment": "production" } } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating successful verification. #### Response Example ```json { "message": "Domain setup verified successfully." } ``` ``` -------------------------------- ### Generate API Documentation Source: https://github.com/easydmarc/public-api-docs/blob/main/README.md Run this npm script to download the OpenAPI spec and generate the API documentation pages. ```bash npm run gen ``` -------------------------------- ### Domain Group Update Payload Example Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/update-domain-group.api.mdx Example JSON payload for updating a domain group. All fields are optional; only include fields you wish to change. ```json { "name": "Group A Updated", "policy": "reject", "spf_record": "v=spf1 include:example.com ~all", "bimi_record": "v=BIMI1; l=https://example.com/logo.svg", "dmarc_record": "v=DMARC1; p=reject", "favicon_path": "https://example.com/favicon.ico", "has_easy_spf": false, "total_volume": 1600, "domain_labels": "label1, label2", "spf_pass_rate": 99, "dkim_pass_rate": 97, "dkim_selectors": "default", "partner_owners": "Partner Inc.", "compliance_rate": 96, "group_object_id": "group-a", "compliant_volume": 1500, "has_managed_bimi": false, "has_managed_dkim": true, "has_managed_dmarc": true, "is_domain_verified": true, "has_managed_mta_sts": false, "non_compliant_volume": 100, "possible_dkim_selectors": "default", "previous_compliant_volume": 1400, "previous_non_compliant_volume": 200 } ``` -------------------------------- ### Get organization details Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/get-organization-by-id.api.mdx Retrieves the organization details by the specified ID. ```APIDOC ## GET /v1/organizations/{organizationId} ### Description Retrieves the organization details by the specified ID. ### Method GET ### Endpoint /v1/organizations/{organizationId} #### Path Parameters - **organizationId** (string) - Required - Unique identifier of the organization ### Response #### Success Response (200) - **id** (string) - Unique identifier of the organization - **name** (string) - Name of the organization - **createdAt** (string) - Timestamp when the organization was created - **updatedAt** (string) - Timestamp when the organization was last updated #### Response Example { "id": "org_68231dcfeb8e9f092a052b88", "name": "Acme Inc.", "createdAt": "2025-05-13T10:24:15.408Z", "updatedAt": "2025-05-17T11:35:15.567Z" } ``` -------------------------------- ### GET /failure-reports Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/get-failure-reports.api.mdx Retrieves a paginated list of email failure reports. ```APIDOC ## GET /failure-reports ### Description Returns a paginated list of failure reports associated with the account. ### Method GET ### Endpoint /failure-reports ### Response #### Success Response (200) - **data** (array) - List of failure report objects - **meta** (object) - Pagination metadata including total, page, pageCount, limit, hasPreviousPage, and hasNextPage #### Response Example { "data": [ { "id": "507f1f77bcf86cd799439011", "domain": "example.com", "sourceIp": "192.168.1.100", "ptr": "mail.sender.com", "ptrGroup": "sender.com", "countryCode": "US", "reportDate": "2024-01-15T10:30:00Z", "reporter": "reporter.com", "fromAddress": "sender@example.com", "toAddress": "recipient@example.com", "subject": "Important Message", "attachmentCount": 2 } ], "meta": { "total": 245, "page": 1, "pageCount": 1, "limit": 10, "hasPreviousPage": true, "hasNextPage": true } } ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/easydmarc/public-api-docs/blob/main/README.md Create a .env file to specify the URL for the OpenAPI specification source. ```bash EASYDMARC_PUBLIC_API_SPEC_URL= ``` -------------------------------- ### GET /eml-download Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/download-eml.api.mdx Retrieves a presigned URL to download an EML file. ```APIDOC ## GET /eml-download ### Description Returns a presigned download URL for an EML file, allowing secure access to the report. ### Method GET ### Endpoint /eml-download ### Response #### Success Response (200) - **data** (object) - Response containing a presigned download URL - **downloadUrl** (string) - Presigned download URL - **expiresAt** (string) - ISO 8601 timestamp when the URL expires #### Response Example { "data": { "downloadUrl": "https://s3.amazonaws.com/ruf-reports/ruf-eml/report-12345?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...", "expiresAt": "2024-01-15T10:35:00Z" } } ``` -------------------------------- ### GET /attachments/download Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/download-attachment.api.mdx Retrieves a presigned download URL for a specific attachment. ```APIDOC ## GET /attachments/download ### Description Returns a presigned download URL for the requested attachment, allowing secure access to the file. ### Method GET ### Endpoint /attachments/download ### Response #### Success Response (200) - **data** (object) - Response containing a presigned download URL - **downloadUrl** (string) - Presigned download URL - **expiresAt** (string) - ISO 8601 timestamp when the URL expires #### Response Example { "data": { "downloadUrl": "https://s3.amazonaws.com/ruf-reports/attachments/507f1f77bcf86cd799439011/0/document.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...", "expiresAt": "2024-01-15T10:35:00Z" } } ``` -------------------------------- ### GET /api/v1/dns/txt Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/dns-lookup-for-txt.api.mdx Retrieves and validates the TXT records for a given domain. ```APIDOC ## GET /api/v1/dns/txt ### Description Retrieves and validates the TXT records for a given domain. This endpoint is useful for checking DMARC, SPF, DKIM, and BIMI record configurations. ### Method GET ### Endpoint /api/v1/dns/txt ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name for which to retrieve TXT records. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **domain** (string) - The domain name of the TXT record. - **raw** (array) - The raw TXT records. - **object** (object) - The parsed TXT record object. - **records** (array) - The raw TXT records. - **validation** (object) - The validation of the TXT record. - **errors** (array) - The validation messages for the DNS record. - **key** (string) - The key of the validation message. - **message** (string) - The description of the validation. - **warnings** (array) - The warning messages for the DNS record. - **key** (string) - The key of the validation message. - **message** (string) - The description of the validation. - **info** (array) - The info messages for the DNS record. - **key** (string) - The key of the validation message. - **message** (string) - The description of the validation. - **queryStatus** (string) - The status of the BIMI TXT record. Enum: ["SUCCESS", "NODATA", "NOTFOUND", "TIMEOUT", "ERROR", "SERVFAIL", "NXDOMAIN"] - **timestamp** (number) - The timestamp of the TXT record lookup. #### Response Example ```json { "domain": "example.com", "raw": [ "v=spf1 include:_spf.google.com ~all", "google-site-verification=abcdef12345" ], "object": { "records": [ "v=spf1 include:_spf.google.com ~all", "google-site-verification=abcdef12345" ] }, "validation": { "errors": [], "warnings": [], "info": [] }, "queryStatus": "SUCCESS", "timestamp": 1704067200000 } ``` #### Error Responses - **400** - Bad Request - **404** - Not Found - **422** - Unprocessable Entity ``` -------------------------------- ### List Plans Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/list-plans.api.mdx Returns all plans available to the partner, including pricing information, feature sets, and billing details. Use this endpoint to discover sellable plans and prices for subscription assignment. ```APIDOC ## GET /v1/partners/plans ### Description Returns all plans available to the partner, including pricing information, feature sets, and billing details. Use this endpoint to discover sellable plans and prices for subscription assignment. ### Method GET ### Endpoint /v1/partners/plans ### Parameters ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /v1.0/dns/dmarc Source: https://github.com/easydmarc/public-api-docs/blob/main/README.md Performs a DMARC record lookup for a specified domain. ```APIDOC ## GET /v1.0/dns/dmarc ### Description Retrieve the DMARC record for a given domain. ### Method GET ### Endpoint https://api.easydmarc.com/v1.0/dns/dmarc ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name to query (e.g., example.com) ### Request Example curl -X GET "https://api.easydmarc.com/v1.0/dns/dmarc?domain=example.com" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Assign Subscription Plan Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/get-started/6-partner-integration.mdx Activates a specific plan for an organization using a price ID. ```bash curl -X POST https://api2.easydmarc.com/v1/partners/subscriptions/assign \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -d '{"organizationId":"","priceId":""}' ``` -------------------------------- ### Get DKIM Records Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/get-dkim-records-by-selectors-with-domain.api.mdx Fetches DKIM records for a specified domain and selector. ```APIDOC ## GET /dkim-records ### Description Retrieves DKIM records for a given domain and selector. This endpoint is useful for verifying DKIM configurations and troubleshooting email authentication issues. ### Method GET ### Endpoint /dkim-records ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name for which to retrieve DKIM records. - **selector** (string) - Required - The DKIM selector to filter the records. ### Response #### Success Response (200) - **rootDomain** (string) - The root domain name. - **dkimRecords** (array) - An array of DKIM record objects. - **raw** (string) - Raw DKIM record string. - **object** (object) - Parsed DKIM record object. - **terms** (array) - An array of DKIM record terms. - **type** (string) - Enum: "v", "g", "h", "k", "n", "p", "s", "t" - The type of the DKIM term. - **tag** (string) - The tag of the DKIM term. - **value** (string) - The value of the DKIM term. - **domain** (string) - Domain name for the DKIM record. - **isWildcard** (boolean) - Indicates if the record is a wildcard. - **type** (string) - Enum: "cname", "txt" - The type of the DKIM record. - **selector** (string) - The selector for the DKIM record. - **domain** (string) - Domain name for the DKIM record. - **validation** (object) - DKIM Record validation messages. - **errors** (array) - General validation error messages for DKIM. - **key** (string) - Key of the error message. - **args** (object) - Arguments for the error message. - **warnings** (array) - General validation warning messages for DKIM. - **key** (string) - Key of the warning message. - **args** (object) - Arguments for the warning message. - **info** (array) - General information messages for DKIM. - **key** (string) - Key of the info message. - **args** (object) - Arguments for the info message. - **queryStatus** (string) - Enum: "SUCCESS", "NODATA", "NOTFOUND", "TIMEOUT", "ERROR", "SERVFAIL", "NXDOMAIN" - The status of the DKIM TXT record lookup. - **timestamp** (number) - The timestamp of the DKIM record lookup. #### Response Example ```json { "rootDomain": "example.com", "dkimRecords": [ { "raw": "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx...", "object": { "terms": [ { "type": "v", "tag": "DKIM1", "value": "" }, { "type": "k", "tag": "rsa", "value": "" }, { "type": "p", "tag": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx...", "value": "" } ], "domain": "selector1._domainkey.example.com", "isWildcard": false, "type": "txt", "selector": "selector1" }, "domain": "example.com", "validation": { "errors": [], "warnings": [], "info": [] }, "queryStatus": "SUCCESS", "timestamp": 1704067200000 } ] } ``` ``` -------------------------------- ### Authenticate with OAuth 2.0 Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/get-started/1-getting-started.mdx Obtain an access token using client credentials and use it in subsequent requests. ```bash curl -L --post302 \ --request POST 'https://api2.easydmarc.com/auth/token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'client_id=YOUR_CLIENT_ID' \ --data-urlencode 'client_secret=YOUR_CLIENT_SECRET' \ --data-urlencode 'grant_type=client_credentials' ``` ```bash curl --request GET 'https://api2.easydmarc.com/health' \ --header "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### GET /failure-reports/aggregates Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/get-failure-reports-aggregates.api.mdx Retrieves aggregated statistics and dimensional breakdowns for failure reports. ```APIDOC ## GET /failure-reports/aggregates ### Description Returns aggregated statistics and dimensional breakdowns for DMARC failure reports. ### Method GET ### Endpoint /failure-reports/aggregates ### Response #### Success Response (200) - **dimensions** (array) - Aggregated data organized by requested dimensions - **summary** (object) - Summary statistics for the aggregated data #### Response Example { "dimensions": [ { "dimension": "reporter", "buckets": [ {"key": "reporter1.com", "count": 150}, {"key": "reporter2.com", "count": 89}, {"key": "reporter3.com", "count": 45} ] } ], "summary": { "totalReports": 284, "uniqueDomains": 5, "uniqueReporters": 12, "dateRange": { "from": "2024-01-01T00:00:00Z", "to": "2024-01-31T23:59:59Z" } } } ``` -------------------------------- ### Upgrade/downgrade plan Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/update-subscription-price.api.mdx Creates a new subscription with a new Plan/Price. The current active subscription is cancelled and replaced with the new one. ```APIDOC ## POST /v1/partners/subscriptions/{subscriptionId} ### Description Creates a new subscription with a new Plan/Price. The current active subscription is cancelled and replaced with the new one. ### Method POST ### Endpoint /v1/partners/subscriptions/{subscriptionId} ### Parameters #### Path Parameters - **subscriptionId** (string) - Required - Subscription ID #### Request Body - **planId** (string) - Required - The ID of the new plan to subscribe to. - **priceId** (string) - Required - The ID of the new price for the plan. ### Request Example ```json { "planId": "plan_abcde", "priceId": "price_fghij" } ``` ### Response #### Success Response (200) - **subscriptionId** (string) - The ID of the newly created subscription. - **status** (string) - The status of the new subscription (e.g., 'active'). #### Response Example ```json { "subscriptionId": "sub_klmno", "status": "active" } ``` ``` -------------------------------- ### GET /v1/domains Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/get-domains.api.mdx Retrieves a paginated list of domains belonging to a specific organization. ```APIDOC ## GET /v1/domains ### Description Retrieves a list of domains associated with the specified organization. Supports pagination via page and pageSize parameters. ### Method GET ### Endpoint /v1/domains ### Parameters #### Query Parameters - **organizationId** (string) - Required - The ID of the organization owning the resources. - **page** (integer) - Optional - Page number for pagination (default: 1). - **pageSize** (integer) - Optional - Number of items per page (default: 20, max: 100). ``` -------------------------------- ### GET /domain-groups/{id} Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/get-domain-group-by-id.api.mdx Retrieves details for a specific domain group by its ID. ```APIDOC ## GET /domain-groups/{id} ### Description Retrieves details for a specific domain group, including its ID, name, and associated domains. ### Method GET ### Endpoint `/domain-groups/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the domain group. ### Response #### Success Response (200) - **id** (string) - Unique ID of the domain group. - **name** (string) - Domain group name. - **domains** (array[string]) - List of Domains assigned to the Domain Group. #### Response Example ```json { "id": "dmngrp_68267f052750d56713945475", "name": "group1", "domains": [ "domain1.com", "domain2.com", "linnea.net", "anderson.biz" ] } ``` #### Error Response (403) - Description: Forbidden access. #### Error Response (404) - Description: The requested resource was not found. - **statusCode** (string) - Request status code (e.g., "404"). - **error** (string) - Error code or type identifier (e.g., "ResourceNotFound"). - **traceId** (string) - Request identifier for tracking and debugging. - **timestamp** (string) - Timestamp in ISO format. - **details** (object) - Additional context-specific error details. #### Error Response Example (404) ```json { "statusCode": "404", "error": "ResourceNotFound", "traceId": "048ddaa9-0273-4aa9-9a26-5b1e28e2bbc0", "timestamp": "2025-05-16T15:35:48.863Z", "details": { "message": "Organization Not Found", "error": "Not Found" } } ``` #### Error Response (422) - Description: The server understands the content type but cannot process the data. E.g. the organization with the provided `organization_id` doesn't exist. - **statusCode** (string) - Request status code (e.g., "422"). - **error** (string) - Error code or type identifier (e.g., "UnprocessableEntity"). - **traceId** (string) - Request identifier for tracking and debugging. - **timestamp** (string) - Timestamp in ISO format. - **details** (object) - Additional context-specific error details. #### Error Response Example (422) ```json { "statusCode": "422", "error": "UnprocessableEntity", "traceId": "abc-123-xyz-789", "timestamp": "2025-10-14T13:30:00.000Z", "details": { "message": "Unprocessable Entity", "property": "id" } } ``` ``` -------------------------------- ### Create Webhook for Domain Events Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/get-started/3-basic-operations.mdx Register a webhook to receive asynchronous events, such as 'domain.verified'. Save the webhook object ID and secret for signature verification. ```bash curl -X POST "https://api2.easydmarc.com/v1/webhooks" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "name": "Domain Events", "ownerId": "{PARTNER_ID}", "url": "https://your-app.example.com/webhooks/easydmarc", "events": ["domain.verified"] }' ``` -------------------------------- ### Quick Start: Fetch DMARC Record Source: https://github.com/easydmarc/public-api-docs/blob/main/README.md Use this cURL command to quickly query a DMARC record for a specified domain. Ensure you replace YOUR_API_KEY with your actual API key. ```bash curl -X GET "https://api.easydmarc.com/v1.0/dns/dmarc?domain=example.com" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### GET /api/v1/dns/ns Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/dns-lookup-for-ns.api.mdx Retrieves Name Server (NS) records for a given domain. ```APIDOC ## GET /api/v1/dns/ns ### Description Retrieves the Name Server (NS) records for a specified domain, including raw records, parsed information, validation status, and query details. ### Method GET ### Endpoint /api/v1/dns/ns ### Parameters #### Query Parameters - **domain** (string) - Required - The domain name for which to retrieve NS records. ### Response #### Success Response (200) - **domain** (string) - The domain name of the NS record. - **raw** (array[string]) - The raw NS records. - **object** (object) - The parsed NS record. - **validation** (object) - The validation of the NS record. - **errors** (array[object]) - The validation messages for the DNS record. - **key** (string) - The key of the validation message. - **message** (string) - The description of the validation. - **warnings** (array[object]) - The warning messages for the DNS record. - **key** (string) - The key of the validation message. - **message** (string) - The description of the validation. - **info** (array[object]) - The info messages for the DNS record. - **key** (string) - The key of the validation message. - **message** (string) - The description of the validation. - **queryStatus** (string) - The status of the NS record. - **timestamp** (number) - The timestamp of the NS record lookup. #### Response Example ```json { "domain": "example.com", "raw": [ "jessica.ns.cloudflare.com", "john.ns.cloudflare.com" ], "object": {}, "validation": { "errors": [], "warnings": [], "info": [] }, "queryStatus": "SUCCESS", "timestamp": 1704067200000 } ``` #### Error Responses - **400** - Bad Request - **404** - Not Found - **422** - Unprocessable Entity ``` -------------------------------- ### GET /v1/dns-lookup/cname Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/dns-lookup-for-cname.api.mdx Retrieves DNS information for a CNAME record of a specified domain. ```APIDOC ## GET /v1/dns-lookup/cname ### Description Performs a DNS lookup for a CNAME record of a given domain. ### Method GET ### Endpoint /v1/dns-lookup/cname ### Parameters #### Query Parameters - **maxAgeMs** (number) - Optional - The maximum age of the cache in milliseconds. Set to 0 to fetch DNS, or -1 to retrieve from cache. - **domain** (string) - Required - The domain name to look up. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **domain** (string) - The domain name of the CNAME record. - **raw** (string) - The raw CNAME record. - **object** (object) - The parsed CNAME record. - **validation** (object) - The validation of the CNAME record. Contains 'key' and 'message' fields. - **queryStatus** (string) - The status of the DNS record lookup. Possible values: SUCCESS, NODATA, NOTFOUND, TIMEOUT, ERROR, SERVFAIL, NXDOMAIN. - **timestamp** (number) - The timestamp of the CNAME record lookup. #### Response Example ```json { "domain": "example.com", "raw": "target.example.com.", "object": {}, "validation": { "key": "some_key", "message": "some_message" }, "queryStatus": "SUCCESS", "timestamp": 1704067200000 } ``` #### Error Responses - **400** - Bad Request - **404** - Not Found - **422** - Unprocessable Entity ``` -------------------------------- ### POST /v1/dns-lookup/mx/batch Source: https://github.com/easydmarc/public-api-docs/blob/main/docs/public-api/dns-lookup-batch-mx.api.mdx Submit a list of domains to retrieve their MX records. You can specify a maximum cache age in milliseconds or choose to fetch directly from DNS. ```APIDOC ## POST /v1/dns-lookup/mx/batch ### Description Performs a batch DNS lookup for MX records for a list of domains. ### Method POST ### Endpoint /v1/dns-lookup/mx/batch ### Parameters #### Request Body - **maxAgeMs** (number) - Optional - The maximum age of the cache in milliseconds. Use 0 to fetch DNS directly, or -1 to fetch from cache. - **domains** (array[string]) - Required - A list of domain names to look up. - **skipAddresses** (boolean) - Optional - Whether to skip retrieving IP addresses associated with MX records. ### Request Example ```json { "maxAgeMs": 5000, "domains": ["example.com", "example.org"], "skipAddresses": true } ``` ### Response #### Success Response (200) - **domain** (string) - The domain name. - **mxRecords** (array) - A list of MX records for the domain. - **priority** (number) - The priority of the MX record. - **exchange** (string) - The hostname of the mail server. - **addresses** (array[string]) - The IP addresses of the mail server (if not skipped). #### Response Example ```json { "domain": "example.com", "mxRecords": [ { "priority": 10, "exchange": "mail.example.com", "addresses": ["192.168.1.1"] } ] } ``` ```