# POST - Create a TXT or SPF record in a Zone ## Purpose This API adds a TXT or SPF record to a specified DNS zone. TXT records store arbitrary text data for a domain, often used for email security policies (SPF, DKIM, DMARC) and domain verification. It enables adding various text-based records for documentation, ownership proof, and key validation and simplifies bulk updates for TXT/SPF records across multiple zones. This API streamlines TXT/SPF record management, ensuring improved email security, domain verification, and custom DNS configurations. ## Request URL **Method: POST** https://{appconsole_IP}:{9443}/api/dns/zone/{zone_pk}/SPT_TXT/ ## Request Headers The following headers must be included in the API request for successful authentication and data submission: **Authorization:** DDI Central's OAuth implementation uses the Bearer authentication scheme. Hence, while making API calls, **access_token** obtained via the **OAuth 2.0 Client Credentials Grant** must be included in the **Authorization header** of API requests. This token verifies the client’s identity and ensures appropriate permissions for accessing resources. The Authorization header follows the format below: ``` headers = { "Authorization": "Bearer {bearer_tk}" } ``` **Content-Type:** Required in the header to indicate the media type of the resource being sent. It helps the server at the receiving end understand how to process the transmitted request body. The Content-Type header follows the format below: ``` headers = { "Content-Type": "application/json" } ``` ## Path Parameters ### zone_pk* (long) - Specifies the unique identifier of the DNS zone where the SPF or TXT record will be added. - Example: `5867`. ## Request Body ### domain_name* (string) - The subdomain or domain where the TXT record will be applied. - Example: `"txt119.hellotest109.com."`. ### domain_ttl* (integer) - Time-to-live (TTL) value in seconds, determining how long the record is cached. - Example: `86400` (1 day). ### zone_name* (string) - The DNS zone where the TXT/SPF record will be added. - Example: `"hellotest109.com."`. ### cluster_name* (string) - Name of the cluster managing this DNS zone. - Example: `"wincluster-zoho"`. ### records* (array of strings) - List of TXT record values stored under the specified domain. - Example: - `["Hello 1", "Hello 2"]` ### record_type* (string) - Defines whether the record is a TXT or SPF type. - Accepted values: - **TXT** - Stores text-based information. - **SPF** - Specifically for Sender Policy Framework (SPF) email authentication. - Example: `"TXT"` **\*** - Mandatory parameter. ## Sample Request ```json { "domain_name":"txt119.hellotest109.com.", "domain_ttl":86400, "zone_name":"hellotest109.com.", "cluster_name":"wincluster-zoho", "records":[ "Hello 1", "Hello 2 " ], "record_type":"TXT" } ``` ## Sample Response ```json { "spf_txt_domain_id":10812, "zone_id":5867, "domain_name":"txt119.hellotest109.com.", "domain_ttl":86400, "record_type":"TXT", "records":[ "Hello 1", "Hello 2" ] } ```