Skip to content
Start here

Create TSIG

client.dns.zoneTransfers.tsigs.create(TSIGCreateParams { account_id, algo, name, secret } params, RequestOptionsoptions?): TSIG { id, algo, name, secret }
POST/accounts/{account_id}/secondary_dns/tsigs

Create TSIG.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

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

Example:X-Auth-Email: user@example.com

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

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Account Settings Write
ParametersExpand Collapse
params: TSIGCreateParams { account_id, algo, name, secret }
account_id: string

Path param

algo: string

Body param: TSIG algorithm.

name: string

Body param: TSIG key name.

secret: string

Body param: TSIG secret.

ReturnsExpand Collapse
TSIG { id, algo, name, secret }
id: string
algo: string

TSIG algorithm.

name: string

TSIG key name.

secret: string

TSIG secret.

Create TSIG

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const tsig = await client.dns.zoneTransfers.tsigs.create({
  account_id: '01a7362d577a6c3019a474fd6f485823',
  algo: 'hmac-sha512.',
  name: 'tsig.customer.cf.',
  secret:
    'caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c',
});

console.log(tsig.id);
{
  "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": {
    "id": "69cd1e104af3e6ed3cb344f263fd0d5a",
    "algo": "hmac-sha512.",
    "name": "tsig.customer.cf.",
    "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"
  }
}
Returns Examples
{
  "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": {
    "id": "69cd1e104af3e6ed3cb344f263fd0d5a",
    "algo": "hmac-sha512.",
    "name": "tsig.customer.cf.",
    "secret": "caf79a7804b04337c9c66ccd7bef9190a1e1679b5dd03d8aa10f7ad45e1a9dab92b417896c15d4d007c7c14194538d2a5d0feffdecc5a7f0e1c570cfa700837c"
  }
}