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