---
title: Retrieves security.txt
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/typescript)

[Security TXT](https://developers.cloudflare.com/api/typescript/resources/security_txt)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Retrieves security.txt

client.securityTXT.get(SecurityTXTGetParams {zone\_id } params, RequestOptionsoptions?): [SecurityTXTGetResponse](<https://developers.cloudflare.com/api/typescript/resources/security_txt#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)>) {acknowledgments, canonical, contact, 6 more }

GET/zones/{zone\_id}/security-center/securitytxt

Retrieves the current security.txt file configuration for a zone, used for security vulnerability reporting.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Zone Settings Write``Zone Settings Read`

##### ParametersExpand Collapse

<details>

<summary>

params: SecurityTXTGetParams {zone\_id }

</summary>

zone\_id: string

Identifier.

maxLength32

<a href="#(resource)%20security_txt%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20security_txt%20%3E%20(method)%20get%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

SecurityTXTGetResponse {acknowledgments, canonical, contact, 6 more }

</summary>

acknowledgments?: Array&lt;string&gt;

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20acknowledgments">Link to this property</a>

canonical?: Array&lt;string&gt;

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20canonical">Link to this property</a>

contact?: Array&lt;string&gt;

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20contact">Link to this property</a>

enabled?: boolean

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

encryption?: Array&lt;string&gt;

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20encryption">Link to this property</a>

expires?: string

formatdate-time

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20expires">Link to this property</a>

hiring?: Array&lt;string&gt;

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20hiring">Link to this property</a>

policy?: Array&lt;string&gt;

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20policy">Link to this property</a>

preferred\_languages?: string

<a href="#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)%20%3E%20(property)%20preferred_languages">Link to this property</a>

</details>

[Link to this property](<#(resource)%20security_txt%20%3E%20(model)%20security_txt_get_response%20%3E%20(schema)>)

### Retrieves security.txt

TypeScript

HTTPTypeScriptPythonGoTerraform

```
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);
```

200 example

```
{
  "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"
  }
}
```

##### Returns Examples

200 example

```
{
  "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"
  }
}
```