Create an API key
const url = 'https://api.duta.indra.sh/v1/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","permission":"full_access","scope":"send","domain_id":"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/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "permission": "full_access", "scope": "send", "domain_id": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Defaults to sending_access. full_access can also manage domains, keys and webhooks
The same as permission, under Duta’s original spelling
Not supported yet. Sending it is refused
Responses
Section titled “ Responses ”Success
object
ISO 8601
The key. Shown once and never again
The same as token
Example
{ "permission": "full_access", "scope": "send"}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"}