# Security TXT ## Retrieves security.txt `client.securityTXT.get(SecurityTXTGetParamsparams, RequestOptionsoptions?): SecurityTXTGetResponse` **get** `/zones/{zone_id}/security-center/securitytxt` Retrieves the current security.txt file configuration for a zone, used for security vulnerability reporting. ### Parameters - `params: SecurityTXTGetParams` - `zone_id: string` Identifier. ### Returns - `SecurityTXTGetResponse` - `acknowledgments?: Array` - `canonical?: Array` - `contact?: Array` - `enabled?: boolean` - `encryption?: Array` - `expires?: string` - `hiring?: Array` - `policy?: Array` - `preferred_languages?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const securityTXT = await client.securityTXT.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); console.log(securityTXT.acknowledgments); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "acknowledgments": [ "https://example.com/hall-of-fame.html" ], "canonical": [ "https://www.example.com/.well-known/security.txt" ], "contact": [ "mailto:security@example.com", "tel:+1-201-555-0123", "https://example.com/security-contact.html" ], "enabled": true, "encryption": [ "https://example.com/pgp-key.txt", "dns:5d2d37ab76d47d36._openpgpkey.example.com?type=OPENPGPKEY", "openpgp4fpr:5f2de5521c63a801ab59ccb603d49de44b29100f" ], "expires": "2019-12-27T18:11:19.117Z", "hiring": [ "https://example.com/jobs.html" ], "policy": [ "https://example.com/disclosure-policy.html" ], "preferred_languages": "en, es, fr" } } ``` ## Updates security.txt `client.securityTXT.update(SecurityTXTUpdateParamsparams, RequestOptionsoptions?): SecurityTXTUpdateResponse` **put** `/zones/{zone_id}/security-center/securitytxt` Updates the security.txt file configuration for a zone, which provides security researchers with vulnerability reporting information. ### Parameters - `params: SecurityTXTUpdateParams` - `zone_id: string` Path param: Identifier. - `acknowledgments?: Array` Body param - `canonical?: Array` Body param - `contact?: Array` Body param - `enabled?: boolean` Body param - `encryption?: Array` Body param - `expires?: string` Body param - `hiring?: Array` Body param - `policy?: Array` Body param - `preferred_languages?: string` Body param ### Returns - `SecurityTXTUpdateResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const securityTXT = await client.securityTXT.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(securityTXT.errors); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` ## Deletes security.txt `client.securityTXT.delete(SecurityTXTDeleteParamsparams, RequestOptionsoptions?): SecurityTXTDeleteResponse` **delete** `/zones/{zone_id}/security-center/securitytxt` Removes the security.txt file configuration for a zone. The /.well-known/security.txt endpoint will no longer be served. ### Parameters - `params: SecurityTXTDeleteParams` - `zone_id: string` Identifier. ### Returns - `SecurityTXTDeleteResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const securityTXT = await client.securityTXT.delete({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(securityTXT.errors); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` ## Domain Types ### Security TXT Get Response - `SecurityTXTGetResponse` - `acknowledgments?: Array` - `canonical?: Array` - `contact?: Array` - `enabled?: boolean` - `encryption?: Array` - `expires?: string` - `hiring?: Array` - `policy?: Array` - `preferred_languages?: string` ### Security TXT Update Response - `SecurityTXTUpdateResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true` ### Security TXT Delete Response - `SecurityTXTDeleteResponse` - `errors: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `messages: Array` - `code: number` - `message: string` - `documentation_url?: string` - `source?: Source` - `pointer?: string` - `success: true` Whether the API call was successful. - `true`