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

[Skip to content](#_top)

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

[Security TXT](https://developers.cloudflare.com/api/go/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(ctx, query) (\*[SecurityTXTGetResponse](<https://developers.cloudflare.com/api/go/resources/security_txt#(resource)%20security_txt%20%3E%20(model)%20SecurityTXTGetResponse%20%3E%20(schema)>), error)

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>

query SecurityTXTGetParams

</summary>

ZoneID param.Field\[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>

type SecurityTXTGetResponse struct{…}

</summary>

Acknowledgments \[]stringOptional

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

Canonical \[]stringOptional

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

Contact \[]stringOptional

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

Enabled boolOptional

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

Encryption \[]stringOptional

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

Expires TimeOptional

formatdate-time

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

Hiring \[]stringOptional

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

Policy \[]stringOptional

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

PreferredLanguages stringOptional

<a href="#(resource)%20security_txt%20%3E%20(model)%20SecurityTXTGetResponse%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)%20SecurityTXTGetResponse%20%3E%20(schema)>)

### Retrieves security.txt

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/security_txt"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  securityTXT, err := client.SecurityTXT.Get(context.TODO(), security_txt.SecurityTXTGetParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
  }
}
```