Create/edit

  • PATCH
  • /workspaces
  • /:workspace
  • /domains
  • /:domain_id
  • /records
  • /:record_name
  • /:type

Create or update record

Request

REQUIRED SCOPES
ZONE_WRITE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspace

Example: "my-company"

domain_idrequiredstring
The ID of the domain

Example: "4krmDRPw"

record_namerequiredstring
The full record name with domain

Example: "api.example.com"

typerequiredstring enum
The record type
Allowed enum:
SOA,
NS,
A,
AAAA,
CNAME,
CAA,
SPF,
MX,
TXT,
SRV,
NAPTR

Example: "A"

POST PARAMETERS
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
valuesrequiredstring[]
New values to set for the DNS record
ttlrequiredinteger
New TTL value for the DNS record in seconds
routingstring enum
Routing strategy: 'simple' (uses only values field) or 'geolocation' (uses country/continent fields, values field is used as default/fallback)
Allowed enum:
simple,
geolocation
countryobject
Country-specific routing values (only used when routing is 'geolocation'). Keys are ISO 3166-1 alpha-2 country codes
continentobject
Continent-specific routing values (only used when routing is 'geolocation'). Available values: Africa, Antarctica, Asia, Europe, NorthAmerica, Oceania, SouthAmerica

Response

RESPONSE BODY
typestring enum
The record type
Allowed enum:
SOA,
NS,
A,
AAAA,
CNAME,
CAA,
SPF,
MX,
TXT,
SRV,
NAPTR
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
namestring
The record name (subdomain or @ for root)
valuesstring[]
ttlinteger
Time To Live in seconds for the DNS record
routingstring
Routing strategy for the record (simple or geolocation)
countryobject
Country-specific routing configuration for geolocation records (only used when routing is 'geolocation')
continentobject
Continent-specific routing configuration for geolocation records (only used when routing is 'geolocation')

Last modified on Jan 26, 2026

Examples

Example: Upsert A Record

curl -X PATCH "https://api.buddy.works/workspaces/:workspace/domains/:domain_id/records/:record_name/:type" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "values": [ "192.168.1.100", "192.168.1.101" ], "ttl": 300, "routing": "simple" }'
EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/my-company/domains/4krmDRPw/records/example.com./A", "html_url": "https://app.buddy.works/my-company/-/domain/4krmDRPw", "name": "@", "type": "A", "values": [ "192.168.1.100", "192.168.1.101" ], "ttl": 300, "routing": "simple" }
STATUS
200 Record updated successfully

Example: Upsert CNAME Record

curl -X PATCH "https://api.buddy.works/workspaces/:workspace/domains/:domain_id/records/:record_name/:type" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "values": [ "target.example.com." ], "ttl": 3600, "routing": "simple" }'
EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/my-company/domains/4krmDRPw/records/blog.example.com./CNAME", "html_url": "https://app.buddy.works/my-company/-/domain/4krmDRPw", "name": "blog", "type": "CNAME", "values": [ "target.example.com." ], "ttl": 3600, "routing": "simple" }
STATUS
200 Record updated successfully

Example: Upsert Geolocation Record

curl -X PATCH "https://api.buddy.works/workspaces/:workspace/domains/:domain_id/records/:record_name/:type" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "values": [ "192.168.1.100" ], "ttl": 300, "routing": "geolocation", "country": { "US": [ "192.168.1.101", "192.168.1.102" ], "DE": [ "192.168.1.103", "192.168.1.104" ], "JP": [ "192.168.1.105" ] }, "continent": { "Europe": [ "192.168.1.110", "192.168.1.111" ], "NorthAmerica": [ "192.168.1.112", "192.168.1.113" ], "Asia": [ "192.168.1.114" ] } }'
EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/my-company/domains/4krmDRPw/records/api.example.com./A", "html_url": "https://app.buddy.works/my-company/-/domain/4krmDRPw", "name": "api", "type": "A", "values": [ "192.168.1.100" ], "ttl": 300, "routing": "geolocation", "country": { "US": [ "192.168.1.101", "192.168.1.102" ], "DE": [ "192.168.1.103", "192.168.1.104" ], "JP": [ "192.168.1.105" ] }, "continent": { "Europe": [ "192.168.1.110", "192.168.1.111" ], "NorthAmerica": [ "192.168.1.112", "192.168.1.113" ], "Asia": [ "192.168.1.114" ] } }
STATUS
200 Record updated successfully