Add a domain
const url = 'https://api.duta.indra.sh/v1/domains';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","domain":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.duta.indra.sh/v1/domains \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "domain": "example" }'Returns the two DNS records to publish. region is accepted and ignored: Duta sends from one region.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The domain to send from, such as example.com
The same as name, under Duta’s original spelling
Examplegenerated
{ "name": "example", "domain": "example"}Responses
Section titled “ Responses ”Success
object
object
ISO 8601
object
ISO 8601
ISO 8601
Example
{ "object": "domain", "status": "pending", "capabilities": { "sending": "enabled", "receiving": "disabled" }, "records": [ { "record": "DKIM", "type": "CNAME", "ttl": "Auto", "status": "verified", "group": "dkim" } ]}Missing or invalid API key
object
The Resend error name, so code that branches on it keeps working
Duta’s error code, finer grained than name
object
Find this request on the Logs screen
Example
{ "code": "unauthorized"}The key has sending access only
object
The Resend error name, so code that branches on it keeps working
Duta’s error code, finer grained than name
object
Find this request on the Logs screen
Example
{ "code": "unauthorized"}The request was refused. code says why
object
The Resend error name, so code that branches on it keeps working
Duta’s error code, finer grained than name
object
Find this request on the Logs screen
Example
{ "code": "unauthorized"}Rate limited. Retry after the Retry-After header
object
The Resend error name, so code that branches on it keeps working
Duta’s error code, finer grained than name
object
Find this request on the Logs screen
Example
{ "code": "unauthorized"}