docs: fixes the bulk contact upload api docs and adds the email property (#6066)

Co-authored-by: Johannes <johannes@formbricks.com>
This commit is contained in:
Anshuman Pandey
2025-06-24 14:14:34 +05:30
committed by GitHub
parent 397643330a
commit 51b58be079
8 changed files with 93 additions and 10 deletions
@@ -6,13 +6,70 @@ import { ZodOpenApiOperationObject, ZodOpenApiPathsObject } from "zod-openapi";
const bulkContactEndpoint: ZodOpenApiOperationObject = {
operationId: "uploadBulkContacts",
summary: "Upload Bulk Contacts",
description: "Uploads contacts in bulk",
description:
"Uploads contacts in bulk. Each contact in the payload must have an 'email' attribute present in their attributes array. The email attribute is mandatory and must be a valid email format. Without a valid email, the contact will be skipped during processing.",
requestBody: {
required: true,
description: "The contacts to upload",
description:
"The contacts to upload. Each contact must include an 'email' attribute in their attributes array. The email is used as the unique identifier for the contact.",
content: {
"application/json": {
schema: ZContactBulkUploadRequest,
example: {
environmentId: "env_01h2xce9q8p3w4x5y6z7a8b9c0",
contacts: [
{
attributes: [
{
attributeKey: {
key: "email",
name: "Email Address",
},
value: "john.doe@example.com",
},
{
attributeKey: {
key: "firstName",
name: "First Name",
},
value: "John",
},
{
attributeKey: {
key: "lastName",
name: "Last Name",
},
value: "Doe",
},
],
},
{
attributes: [
{
attributeKey: {
key: "email",
name: "Email Address",
},
value: "jane.smith@example.com",
},
{
attributeKey: {
key: "firstName",
name: "First Name",
},
value: "Jane",
},
{
attributeKey: {
key: "lastName",
name: "Last Name",
},
value: "Smith",
},
],
},
],
},
},
},
},