feat: expose domain dns records via api (#259)

This commit is contained in:
KM Koushik
2025-09-27 09:40:14 +10:00
committed by GitHub
parent 014199201b
commit 76fdad6c81
25 changed files with 2066 additions and 551 deletions
@@ -1,3 +1,3 @@
---
openapi: get /v1/domains
---
openapi: get /v1/domains/{id}
---
@@ -0,0 +1,3 @@
---
openapi: get /v1/domains
---
+370 -31
View File
@@ -24,7 +24,7 @@
"get": {
"responses": {
"200": {
"description": "Retrieve the user",
"description": "Retrieve domains accessible by the API key",
"content": {
"application/json": {
"schema": {
@@ -101,6 +101,73 @@
"subdomain": {
"type": "string",
"nullable": true
},
"verificationError": {
"type": "string",
"nullable": true
},
"lastCheckedTime": {
"type": "string",
"nullable": true
},
"dnsRecords": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"MX",
"TXT"
],
"description": "DNS record type",
"example": "TXT"
},
"name": {
"type": "string",
"description": "DNS record name",
"example": "mail"
},
"value": {
"type": "string",
"description": "DNS record value",
"example": "v=spf1 include:amazonses.com ~all"
},
"ttl": {
"type": "string",
"description": "DNS record TTL",
"example": "Auto"
},
"priority": {
"type": "string",
"nullable": true,
"description": "DNS record priority",
"example": "10"
},
"status": {
"type": "string",
"enum": [
"NOT_STARTED",
"PENDING",
"SUCCESS",
"FAILED",
"TEMPORARY_FAILURE"
]
},
"recommended": {
"type": "boolean",
"description": "Whether the record is recommended"
}
},
"required": [
"type",
"name",
"value",
"ttl",
"status"
]
}
}
},
"required": [
@@ -110,7 +177,8 @@
"status",
"publicKey",
"createdAt",
"updatedAt"
"updatedAt",
"dnsRecords"
]
}
}
@@ -219,6 +287,73 @@
"subdomain": {
"type": "string",
"nullable": true
},
"verificationError": {
"type": "string",
"nullable": true
},
"lastCheckedTime": {
"type": "string",
"nullable": true
},
"dnsRecords": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"MX",
"TXT"
],
"description": "DNS record type",
"example": "TXT"
},
"name": {
"type": "string",
"description": "DNS record name",
"example": "mail"
},
"value": {
"type": "string",
"description": "DNS record value",
"example": "v=spf1 include:amazonses.com ~all"
},
"ttl": {
"type": "string",
"description": "DNS record TTL",
"example": "Auto"
},
"priority": {
"type": "string",
"nullable": true,
"description": "DNS record priority",
"example": "10"
},
"status": {
"type": "string",
"enum": [
"NOT_STARTED",
"PENDING",
"SUCCESS",
"FAILED",
"TEMPORARY_FAILURE"
]
},
"recommended": {
"type": "boolean",
"description": "Whether the record is recommended"
}
},
"required": [
"type",
"name",
"value",
"ttl",
"status"
]
}
}
},
"required": [
@@ -228,7 +363,8 @@
"status",
"publicKey",
"createdAt",
"updatedAt"
"updatedAt",
"dnsRecords"
]
}
}
@@ -253,7 +389,7 @@
],
"responses": {
"200": {
"description": "Create a new domain",
"description": "Verify domain",
"content": {
"application/json": {
"schema": {
@@ -269,6 +405,219 @@
}
}
}
},
"403": {
"description": "Forbidden - API key doesn't have access to this domain",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
},
"404": {
"description": "Domain not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
},
"required": [
"error"
]
}
}
}
}
}
}
},
"/v1/domains/{id}": {
"get": {
"parameters": [
{
"schema": {
"type": "number",
"nullable": true,
"example": 1
},
"required": false,
"name": "id",
"in": "path"
}
],
"responses": {
"200": {
"description": "Retrieve the domain",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "The ID of the domain",
"example": 1
},
"name": {
"type": "string",
"description": "The name of the domain",
"example": "example.com"
},
"teamId": {
"type": "number",
"description": "The ID of the team",
"example": 1
},
"status": {
"type": "string",
"enum": [
"NOT_STARTED",
"PENDING",
"SUCCESS",
"FAILED",
"TEMPORARY_FAILURE"
]
},
"region": {
"type": "string",
"default": "us-east-1"
},
"clickTracking": {
"type": "boolean",
"default": false
},
"openTracking": {
"type": "boolean",
"default": false
},
"publicKey": {
"type": "string"
},
"dkimStatus": {
"type": "string",
"nullable": true
},
"spfDetails": {
"type": "string",
"nullable": true
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
},
"dmarcAdded": {
"type": "boolean",
"default": false
},
"isVerifying": {
"type": "boolean",
"default": false
},
"errorMessage": {
"type": "string",
"nullable": true
},
"subdomain": {
"type": "string",
"nullable": true
},
"verificationError": {
"type": "string",
"nullable": true
},
"lastCheckedTime": {
"type": "string",
"nullable": true
},
"dnsRecords": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"MX",
"TXT"
],
"description": "DNS record type",
"example": "TXT"
},
"name": {
"type": "string",
"description": "DNS record name",
"example": "mail"
},
"value": {
"type": "string",
"description": "DNS record value",
"example": "v=spf1 include:amazonses.com ~all"
},
"ttl": {
"type": "string",
"description": "DNS record TTL",
"example": "Auto"
},
"priority": {
"type": "string",
"nullable": true,
"description": "DNS record priority",
"example": "10"
},
"status": {
"type": "string",
"enum": [
"NOT_STARTED",
"PENDING",
"SUCCESS",
"FAILED",
"TEMPORARY_FAILURE"
]
},
"recommended": {
"type": "boolean",
"description": "Whether the record is recommended"
}
},
"required": [
"type",
"name",
"value",
"ttl",
"status"
]
}
}
},
"required": [
"id",
"name",
"teamId",
"status",
"publicKey",
"createdAt",
"updatedAt",
"dnsRecords"
]
}
}
}
}
}
}
@@ -396,7 +745,8 @@
"CLICKED",
"COMPLAINED",
"FAILED",
"CANCELLED"
"CANCELLED",
"SUPPRESSED"
]
},
"createdAt": {
@@ -659,7 +1009,8 @@
"CLICKED",
"COMPLAINED",
"FAILED",
"CANCELLED"
"CANCELLED",
"SUPPRESSED"
]
},
"scheduledAt": {
@@ -743,14 +1094,12 @@
"replyTo": {
"anyOf": [
{
"type": "string",
"format": "email"
"type": "string"
},
{
"type": "array",
"items": {
"type": "string",
"format": "email"
"type": "string"
}
}
]
@@ -758,14 +1107,12 @@
"cc": {
"anyOf": [
{
"type": "string",
"format": "email"
"type": "string"
},
{
"type": "array",
"items": {
"type": "string",
"format": "email"
"type": "string"
}
}
]
@@ -773,14 +1120,12 @@
"bcc": {
"anyOf": [
{
"type": "string",
"format": "email"
"type": "string"
},
{
"type": "array",
"items": {
"type": "string",
"format": "email"
"type": "string"
}
}
]
@@ -897,14 +1242,12 @@
"replyTo": {
"anyOf": [
{
"type": "string",
"format": "email"
"type": "string"
},
{
"type": "array",
"items": {
"type": "string",
"format": "email"
"type": "string"
}
}
]
@@ -912,14 +1255,12 @@
"cc": {
"anyOf": [
{
"type": "string",
"format": "email"
"type": "string"
},
{
"type": "array",
"items": {
"type": "string",
"format": "email"
"type": "string"
}
}
]
@@ -927,14 +1268,12 @@
"bcc": {
"anyOf": [
{
"type": "string",
"format": "email"
"type": "string"
},
{
"type": "array",
"items": {
"type": "string",
"format": "email"
"type": "string"
}
}
]
@@ -1479,4 +1818,4 @@
}
}
}
}
}
+23 -6
View File
@@ -34,15 +34,23 @@
},
{
"group": "Self Hosting",
"pages": ["self-hosting/overview", "self-hosting/railway"]
"pages": [
"self-hosting/overview",
"self-hosting/railway"
]
},
{
"group": "Guides",
"pages": ["guides/use-with-react-email"]
"pages": [
"guides/use-with-react-email"
]
},
{
"group": "Community SDKs",
"pages": ["community-sdk/python", "community-sdk/go"]
"pages": [
"community-sdk/python",
"community-sdk/go"
]
}
]
},
@@ -51,7 +59,9 @@
"groups": [
{
"group": "API Reference",
"pages": ["api-reference/introduction"]
"pages": [
"api-reference/introduction"
]
},
{
"group": "Emails",
@@ -79,6 +89,7 @@
"group": "Domains",
"pages": [
"api-reference/domains/get-domain",
"api-reference/domains/list-domains",
"api-reference/domains/create-domain",
"api-reference/domains/verify-domain"
]
@@ -136,6 +147,12 @@
}
},
"contextual": {
"options": ["copy", "view", "chatgpt", "claude", "perplexity"]
"options": [
"copy",
"view",
"chatgpt",
"claude",
"perplexity"
]
}
}
}