* Add self host setup * Improve blunders * Move to bull mq * More changes * Add example code for sending test emails
394 lines
12 KiB
JSON
394 lines
12 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"version": "1.0.0",
|
|
"title": "Unsend API"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "https://test.ossapps.dev/api"
|
|
}
|
|
],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"Bearer": {
|
|
"type": "http",
|
|
"scheme": "bearer"
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"parameters": {}
|
|
},
|
|
"paths": {
|
|
"/v1/domains": {
|
|
"get": {
|
|
"responses": {
|
|
"200": {
|
|
"description": "Retrieve the user",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"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"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"teamId",
|
|
"status",
|
|
"publicKey",
|
|
"createdAt",
|
|
"updatedAt"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/emails/{emailId}": {
|
|
"get": {
|
|
"parameters": [
|
|
{
|
|
"schema": {
|
|
"type": "string",
|
|
"minLength": 3,
|
|
"example": "cuiwqdj74rygf74"
|
|
},
|
|
"required": true,
|
|
"name": "emailId",
|
|
"in": "path"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Retrieve the user",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"teamId": {
|
|
"type": "number"
|
|
},
|
|
"to": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"replyTo": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"cc": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"bcc": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"from": {
|
|
"type": "string"
|
|
},
|
|
"subject": {
|
|
"type": "string"
|
|
},
|
|
"html": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"text": {
|
|
"type": "string",
|
|
"nullable": true
|
|
},
|
|
"createdAt": {
|
|
"type": "string"
|
|
},
|
|
"updatedAt": {
|
|
"type": "string"
|
|
},
|
|
"emailEvents": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"emailId": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "string",
|
|
"enum": [
|
|
"QUEUED",
|
|
"SENT",
|
|
"OPENED",
|
|
"CLICKED",
|
|
"BOUNCED",
|
|
"COMPLAINED",
|
|
"DELIVERED",
|
|
"REJECTED",
|
|
"RENDERING_FAILURE",
|
|
"DELIVERY_DELAYED"
|
|
]
|
|
},
|
|
"createdAt": {
|
|
"type": "string"
|
|
},
|
|
"data": {
|
|
"nullable": true
|
|
}
|
|
},
|
|
"required": [
|
|
"emailId",
|
|
"status",
|
|
"createdAt"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"teamId",
|
|
"to",
|
|
"from",
|
|
"subject",
|
|
"html",
|
|
"text",
|
|
"createdAt",
|
|
"updatedAt",
|
|
"emailEvents"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/v1/emails": {
|
|
"post": {
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"to": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"format": "email"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"format": "email"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"from": {
|
|
"type": "string",
|
|
"format": "email"
|
|
},
|
|
"subject": {
|
|
"type": "string"
|
|
},
|
|
"replyTo": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"format": "email"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"format": "email"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"cc": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"format": "email"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"format": "email"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"bcc": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"format": "email"
|
|
},
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"format": "email"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"text": {
|
|
"type": "string"
|
|
},
|
|
"html": {
|
|
"type": "string"
|
|
},
|
|
"attachments": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"filename": {
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"filename",
|
|
"content"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"to",
|
|
"from",
|
|
"subject"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Retrieve the user",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"emailId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |