feat: v1/campaign public api endpoint (#335)

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
Dave Stockley
2026-01-10 22:37:57 +00:00
committed by GitHub
parent bba9e937bb
commit 68d951c55a
5 changed files with 398 additions and 160 deletions
@@ -0,0 +1,3 @@
---
openapi: get /v1/campaigns
---
+106
View File
@@ -1358,6 +1358,112 @@
}
},
"/v1/campaigns": {
"get": {
"parameters": [
{
"schema": { "type": "string", "example": "1" },
"required": false,
"name": "page",
"in": "query",
"description": "Page number for pagination (default: 1)"
},
{
"schema": {
"type": "string",
"enum": [
"DRAFT",
"SCHEDULED",
"SENDING",
"PAUSED",
"SENT",
"CANCELLED"
],
"example": "DRAFT"
},
"required": false,
"name": "status",
"in": "query",
"description": "Filter campaigns by status"
},
{
"schema": { "type": "string", "example": "newsletter" },
"required": false,
"name": "search",
"in": "query",
"description": "Search campaigns by name or subject"
}
],
"responses": {
"200": {
"description": "Get list of campaigns",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"campaigns": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"from": { "type": "string" },
"subject": { "type": "string" },
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
},
"status": {
"type": "string",
"enum": [
"DRAFT",
"SCHEDULED",
"SENDING",
"PAUSED",
"SENT",
"CANCELLED"
]
},
"scheduledAt": {
"type": "string",
"nullable": true,
"format": "date-time"
},
"total": { "type": "integer" },
"sent": { "type": "integer" },
"delivered": { "type": "integer" },
"unsubscribed": { "type": "integer" }
},
"required": [
"id",
"name",
"from",
"subject",
"createdAt",
"updatedAt",
"status",
"scheduledAt",
"total",
"sent",
"delivered",
"unsubscribed"
]
}
},
"totalPage": { "type": "integer" }
},
"required": ["campaigns", "totalPage"]
}
}
}
}
}
},
"post": {
"requestBody": {
"required": true,
+161 -160
View File
@@ -1,162 +1,163 @@
{
"$schema": "https://mintlify.com/docs.json",
"theme": "maple",
"name": "useSend",
"colors": {
"primary": "#21453D",
"light": "#E6FAF5",
"dark": "#21453D"
},
"background": {
"color": {
"light": "#F5F5F5",
"dark": "#181825"
}
},
"fonts": {
"family": "IBM Plex Mono"
},
"favicon": "/favicon.svg",
"navigation": {
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Getting Started",
"pages": [
"introduction",
"get-started/nodejs",
"get-started/python",
"get-started/local",
"get-started/smtp"
]
},
{
"group": "Self Hosting",
"pages": ["self-hosting/overview", "self-hosting/railway"]
},
{
"group": "Guides",
"pages": ["guides/use-with-react-email"]
},
{
"group": "Community SDKs",
"pages": ["community-sdk/python", "community-sdk/go"]
}
]
},
{
"tab": "API Reference",
"groups": [
{
"group": "API Reference",
"pages": ["api-reference/introduction"]
},
{
"group": "Emails",
"pages": [
"api-reference/emails/get-email",
"api-reference/emails/list-emails",
"api-reference/emails/send-email",
"api-reference/emails/batch-email",
"api-reference/emails/update-schedule",
"api-reference/emails/cancel-schedule"
]
},
{
"group": "Contacts",
"pages": [
"api-reference/contacts/get-contact",
"api-reference/contacts/get-contacts",
"api-reference/contacts/create-contact",
"api-reference/contacts/update-contact",
"api-reference/contacts/upsert-contact",
"api-reference/contacts/delete-contact"
]
},
{
"group": "Domains",
"pages": [
"api-reference/domains/get-domain",
"api-reference/domains/list-domains",
"api-reference/domains/create-domain",
"api-reference/domains/verify-domain",
"api-reference/domains/delete-domain"
]
},
{
"group": "Campaigns",
"pages": [
"api-reference/campaigns/create-campaign",
"api-reference/campaigns/get-campaign",
"api-reference/campaigns/schedule-campaign",
"api-reference/campaigns/pause-campaign",
"api-reference/campaigns/resume-campaign"
]
}
]
},
{
"tab": "Changelog",
"groups": [
{
"group": "Updates",
"pages": ["changelog"]
}
]
}
],
"global": {
"anchors": [
{
"anchor": "GitHub",
"href": "https://github.com/usesend/usesend",
"icon": "github"
},
{
"anchor": "Community",
"href": "https://discord.gg/BU8n8pJv8S",
"icon": "discord"
}
]
}
},
"logo": {
"light": "/logo/logo-wordmark.svg",
"dark": "/logo/logo-wordmark-dark.svg"
},
"api": {
"playground": {
"display": "interactive"
},
"mdx": {
"server": "https://mintlify.com/api",
"auth": {
"method": "bearer"
}
}
},
"navbar": {
"links": [
{
"label": "Support",
"href": "mailto:hey@usesend.com"
}
],
"primary": {
"type": "button",
"label": "Dashboard",
"href": "https://app.usesend.com"
}
},
"footer": {
"socials": {
"x": "https://x.com/useSend_com",
"github": "https://github.com/usesend"
}
},
"contextual": {
"options": ["copy", "view", "chatgpt", "claude", "perplexity"]
}
"$schema": "https://mintlify.com/docs.json",
"theme": "maple",
"name": "useSend",
"colors": {
"primary": "#21453D",
"light": "#E6FAF5",
"dark": "#21453D"
},
"background": {
"color": {
"light": "#F5F5F5",
"dark": "#181825"
}
},
"fonts": {
"family": "IBM Plex Mono"
},
"favicon": "/favicon.svg",
"navigation": {
"tabs": [
{
"tab": "Documentation",
"groups": [
{
"group": "Getting Started",
"pages": [
"introduction",
"get-started/nodejs",
"get-started/python",
"get-started/local",
"get-started/smtp"
]
},
{
"group": "Self Hosting",
"pages": ["self-hosting/overview", "self-hosting/railway"]
},
{
"group": "Guides",
"pages": ["guides/use-with-react-email"]
},
{
"group": "Community SDKs",
"pages": ["community-sdk/python", "community-sdk/go"]
}
]
},
{
"tab": "API Reference",
"groups": [
{
"group": "API Reference",
"pages": ["api-reference/introduction"]
},
{
"group": "Emails",
"pages": [
"api-reference/emails/get-email",
"api-reference/emails/list-emails",
"api-reference/emails/send-email",
"api-reference/emails/batch-email",
"api-reference/emails/update-schedule",
"api-reference/emails/cancel-schedule"
]
},
{
"group": "Contacts",
"pages": [
"api-reference/contacts/get-contact",
"api-reference/contacts/get-contacts",
"api-reference/contacts/create-contact",
"api-reference/contacts/update-contact",
"api-reference/contacts/upsert-contact",
"api-reference/contacts/delete-contact"
]
},
{
"group": "Domains",
"pages": [
"api-reference/domains/get-domain",
"api-reference/domains/list-domains",
"api-reference/domains/create-domain",
"api-reference/domains/verify-domain",
"api-reference/domains/delete-domain"
]
},
{
"group": "Campaigns",
"pages": [
"api-reference/campaigns/create-campaign",
"api-reference/campaigns/get-campaigns",
"api-reference/campaigns/get-campaign",
"api-reference/campaigns/schedule-campaign",
"api-reference/campaigns/pause-campaign",
"api-reference/campaigns/resume-campaign"
]
}
]
},
{
"tab": "Changelog",
"groups": [
{
"group": "Updates",
"pages": ["changelog"]
}
]
}
],
"global": {
"anchors": [
{
"anchor": "GitHub",
"href": "https://github.com/usesend/usesend",
"icon": "github"
},
{
"anchor": "Community",
"href": "https://discord.gg/BU8n8pJv8S",
"icon": "discord"
}
]
}
},
"logo": {
"light": "/logo/logo-wordmark.svg",
"dark": "/logo/logo-wordmark-dark.svg"
},
"api": {
"playground": {
"display": "interactive"
},
"mdx": {
"server": "https://mintlify.com/api",
"auth": {
"method": "bearer"
}
}
},
"navbar": {
"links": [
{
"label": "Support",
"href": "mailto:hey@usesend.com"
}
],
"primary": {
"type": "button",
"label": "Dashboard",
"href": "https://app.usesend.com"
}
},
"footer": {
"socials": {
"x": "https://x.com/useSend_com",
"github": "https://github.com/usesend"
}
},
"contextual": {
"options": ["copy", "view", "chatgpt", "claude", "perplexity"]
}
}