docs: Update openapi.json to match actual API outputs

This commit is contained in:
Dries Augustyns
2025-12-17 08:01:17 +01:00
parent 409d1b83eb
commit dc9b88dedb
+103 -162
View File
@@ -456,19 +456,29 @@
"emails": {
"type": "array",
"items": {
"type": "object",
"properties": {
"contact": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"to": {
"email": {
"type": "string"
}
}
},
"status": {
"type": "string"
"email": {
"type": "string",
"description": "Email record ID"
}
}
}
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}
@@ -561,26 +571,16 @@
"type": "object",
"properties": {
"contact": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
}
}
"type": "string",
"description": "Contact ID"
},
"event": {
"type": "object",
"properties": {
"id": {
"type": "string"
"type": "string",
"description": "Event ID"
},
"event": {
"type": "string"
}
}
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}
@@ -599,9 +599,6 @@
"description": "Get a paginated list of contacts with cursor-based pagination",
"operationId": "listContacts",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
},
{
"$ref": "#/components/parameters/Limit"
},
@@ -633,29 +630,23 @@
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"data": {
"type": "object",
"properties": {
"items": {
"contacts": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Contact"
}
},
"nextCursor": {
"cursor": {
"type": "string",
"nullable": true
"nullable": true,
"description": "Cursor for next page"
},
"hasMore": {
"type": "boolean"
},
"total": {
"type": "integer"
}
}
"type": "integer",
"description": "Total count (only included on first page)"
}
}
}
@@ -669,11 +660,6 @@
"summary": "Create or update contact",
"description": "Create a new contact or update existing (upsert by email)",
"operationId": "createContact",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
}
],
"requestBody": {
"required": true,
"content": {
@@ -710,22 +696,64 @@
},
"responses": {
"200": {
"description": "Contact created/updated",
"description": "Contact updated",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/Contact"
},
{
"type": "object",
"properties": {
"success": {
"_meta": {
"type": "object",
"properties": {
"isNew": {
"type": "boolean"
},
"data": {
"isUpdate": {
"type": "boolean"
}
}
}
}
}
]
}
}
}
},
"201": {
"description": "Contact created",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/Contact"
},
{
"type": "object",
"properties": {
"_meta": {
"type": "object",
"properties": {
"isNew": {
"type": "boolean"
},
"isUpdate": {
"type": "boolean"
}
}
}
}
}
]
}
}
}
}
}
}
@@ -737,9 +765,6 @@
"description": "Get a single contact by ID",
"operationId": "getContact",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
},
{
"name": "id",
"in": "path",
@@ -755,18 +780,10 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"data": {
"$ref": "#/components/schemas/Contact"
}
}
}
}
}
},
"404": {
"description": "Contact not found"
@@ -779,9 +796,6 @@
"description": "Update an existing contact",
"operationId": "updateContact",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
},
{
"name": "id",
"in": "path",
@@ -816,20 +830,12 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"data": {
"$ref": "#/components/schemas/Contact"
}
}
}
}
}
}
}
},
"delete": {
"tags": ["Contacts"],
@@ -837,9 +843,6 @@
"description": "Permanently delete a contact",
"operationId": "deleteContact",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
},
{
"name": "id",
"in": "path",
@@ -850,28 +853,11 @@
}
],
"responses": {
"200": {
"description": "Contact deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
"204": {
"description": "Contact deleted successfully (no content returned)"
},
"data": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
"404": {
"description": "Contact not found"
}
}
}
@@ -883,9 +869,6 @@
"description": "Get a paginated list of email templates",
"operationId": "listTemplates",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
},
{
"$ref": "#/components/parameters/Limit"
},
@@ -916,19 +899,23 @@
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"data": {
"type": "object",
"properties": {
"items": {
"templates": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Template"
}
}
}
},
"total": {
"type": "integer"
},
"page": {
"type": "integer"
},
"pageSize": {
"type": "integer"
},
"totalPages": {
"type": "integer"
}
}
}
@@ -942,11 +929,6 @@
"summary": "Create template",
"description": "Create a new email template",
"operationId": "createTemplate",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
}
],
"requestBody": {
"required": true,
"content": {
@@ -974,17 +956,11 @@
}
},
"responses": {
"200": {
"201": {
"description": "Template created",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"data": {
"$ref": "#/components/schemas/Template"
}
}
@@ -992,8 +968,6 @@
}
}
}
}
}
},
"/campaigns": {
"get": {
@@ -1002,9 +976,6 @@
"description": "Get a paginated list of email campaigns",
"operationId": "listCampaigns",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
},
{
"$ref": "#/components/parameters/Limit"
},
@@ -1028,19 +999,23 @@
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"data": {
"type": "object",
"properties": {
"items": {
"campaigns": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Campaign"
}
}
}
},
"page": {
"type": "integer"
},
"pageSize": {
"type": "integer"
},
"total": {
"type": "integer"
},
"totalPages": {
"type": "integer"
}
}
}
@@ -1054,11 +1029,6 @@
"summary": "Create campaign",
"description": "Create a new email campaign",
"operationId": "createCampaign",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
}
],
"requestBody": {
"required": true,
"content": {
@@ -1144,9 +1114,6 @@
"description": "Send a campaign immediately or schedule for future delivery",
"operationId": "sendCampaign",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
},
{
"name": "id",
"in": "path",
@@ -1186,23 +1153,12 @@
"summary": "List segments",
"description": "Get all audience segments",
"operationId": "listSegments",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
}
],
"responses": {
"200": {
"description": "List of segments",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Segment"
@@ -1212,19 +1168,12 @@
}
}
}
}
}
},
"post": {
"tags": ["Segments"],
"summary": "Create segment",
"description": "Create a new audience segment",
"operationId": "createSegment",
"parameters": [
{
"$ref": "#/components/parameters/ProjectId"
}
],
"requestBody": {
"required": true,
"content": {
@@ -1264,17 +1213,11 @@
}
},
"responses": {
"200": {
"201": {
"description": "Segment created",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"data": {
"$ref": "#/components/schemas/Segment"
}
}
@@ -1283,8 +1226,6 @@
}
}
}
}
}
},
"tags": [
{