domain apis (#146)

* fix: create domain api

* add domain apis

* fix url

---------

Co-authored-by: harshsbhat <harsh121102@gmail.com>
This commit is contained in:
KM Koushik
2025-04-05 06:48:03 +11:00
committed by GitHub
parent 43600419cb
commit 70026cb11d
11 changed files with 415 additions and 12 deletions

View File

@@ -0,0 +1,3 @@
---
openapi: post /v1/domains
---

View File

@@ -0,0 +1,3 @@
---
openapi: put /v1/domains/{id}/verify
---

View File

@@ -85,6 +85,22 @@
},
"updatedAt": {
"type": "string"
},
"dmarcAdded": {
"type": "boolean",
"default": false
},
"isVerifying": {
"type": "boolean",
"default": false
},
"errorMessage": {
"type": "string",
"nullable": true
},
"subdomain": {
"type": "string",
"nullable": true
}
},
"required": [
@@ -102,6 +118,158 @@
}
}
}
},
"post": {
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"region": {
"type": "string"
}
},
"required": [
"name",
"region"
]
}
}
}
},
"responses": {
"200": {
"description": "Create a new 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
}
},
"required": [
"id",
"name",
"teamId",
"status",
"publicKey",
"createdAt",
"updatedAt"
]
}
}
}
}
}
}
},
"/v1/domains/{id}/verify": {
"put": {
"parameters": [
{
"schema": {
"type": "number",
"example": 1
},
"required": true,
"name": "id",
"in": "path"
}
],
"responses": {
"200": {
"description": "Create a new domain",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
]
}
}
}
}
}
}
},
"/v1/emails/{emailId}": {

View File

@@ -96,7 +96,9 @@
{
"group": "Domains",
"pages": [
"api-reference/domains/get-domain"
"api-reference/domains/get-domain",
"api-reference/domains/create-domain",
"api-reference/domains/verify-domain"
]
}
],