{
  "openapi": "3.1.0",
  "info": {
    "title": "Sendara API",
    "description": "\n\nSendara provides a simple REST API for managing leads, sending messages, and performing platform lookups.\n## Authentication\n\nAll requests require an API key passed in the `x-api-key` header:\n\n```\nx-api-key: sendara_your_api_key_here\n```\n\n## What You Can Do\n\n**Lead Management** - Create, retrieve, update, and delete your contact leads\n\n**Send Messages** - Send text messages and media (images, videos, voice messages) to your leads\n\n**Platform Lookup** - Check which messaging platform (WhatsApp, SMS, or iMessage) a phone number is registered on before sending messages\n\n## Rate Limits\n\n- **100 requests per minute** per API key\n- Exceeding this limit returns a `429` status code\n- Wait time is indicated in the response\n\n## Response Format\n\nAll responses are in JSON format with a consistent structure:\n\n**Success Response:**\n```json\n{\n  \"success\": true,\n  \"data\": { ... },\n  \"message\": \"Operation completed successfully\"\n}\n```\n\n**Error Response:**\n```json\n{\n  \"success\": false,\n  \"error\": \"Description of what went wrong\"\n}\n```\n",
    "version": "1.0.1",
    "contact": {
      "name": "Sendara Support",
      "email": "support@sendara.io"
    },
    "x-logo": {
      "url": "https://sendara.io/logo.png"
    }
  },
  "x-scalar": {
    "hideClientButton": true
  },
  "servers": [
    {
      "url": "https://api.sendara.io",
      "description": "Production server"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Leads",
      "description": "Manage your contact leads"
    },
    {
      "name": "Messages",
      "description": "Send messages to your leads"
    },
    {
      "name": "Group Chats",
      "description": "Create and retrieve group chats, update names and icons, and add or remove participants. All groups are scoped to your account."
    },
    {
      "name": "Utilities",
      "description": "Check which messaging platform a phone number uses (WhatsApp, SMS, or iMessage) and look up the phone lines on your account"
    }
  ],
  "paths": {
    "/v1/get-lead": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "Get a lead",
        "description": "Retrieve a single lead by ID or phone number. You must provide either `lead_id` or `phone`.",
        "operationId": "getLead",
        "parameters": [
          {
            "name": "lead_id",
            "in": "query",
            "description": "The unique ID of the lead",
            "required": false,
            "schema": {
              "type": "integer",
              "example": 12345
            }
          },
          {
            "name": "phone",
            "in": "query",
            "description": "The phone number of the lead",
            "required": false,
            "schema": {
              "type": "string",
              "example": "+1234567890"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead found successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Lead"
                    }
                  }
                },
                "examples": {
                  "byLeadId": {
                    "summary": "Get lead by ID",
                    "value": {
                      "success": true,
                      "data": {
                        "id": 12345,
                        "first_name": "John",
                        "last_name": "Doe",
                        "phone": "+1234567890",
                        "email": "john.doe@example.com"
                      }
                    }
                  },
                  "byPhone": {
                    "summary": "Get lead by phone",
                    "value": {
                      "success": true,
                      "data": {
                        "id": 12345,
                        "first_name": "Jane",
                        "last_name": "Smith",
                        "phone": "+9876543210",
                        "email": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing required parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Missing parameter: lead_id or phone is required"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Lead not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Lead not found"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "We couldn't retrieve the lead information. Please check if lead id or phone no. is correct or Try again later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/add-lead": {
      "post": {
        "tags": [
          "Leads"
        ],
        "summary": "Add a new lead",
        "description": "Create a new lead in your contact list. Phone numbers must be unique per account.\n\n## Assignment\n\n- **Pass `assignee_id`** to optionally assign the lead to a user belonging to your account.\n- **Pass `line_id`** to pin the lead to a specific phone line.\n- If `line_id` is omitted and `assignee_id` is provided, the assignee's phone line is used when it has daily outbound capacity;\n- If neither is provided, the lead is created as long as at least one account phone line has capacity.\n\nUse [Get Phone Lines](#tag/utilities/get/v1/get-phone-lines) to list the lines on your account and their IDs.\n",
        "operationId": "addLead",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "first_name",
                  "last_name",
                  "phone"
                ],
                "properties": {
                  "first_name": {
                    "type": "string",
                    "description": "Lead's first name",
                    "example": "John"
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Lead's last name",
                    "example": "Doe"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Lead's phone number (must be unique)",
                    "example": "+1234567890"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Lead's email address (optional)",
                    "example": "john.doe@example.com"
                  },
                  "line_id": {
                    "type": "integer",
                    "description": "The phone line to assign this lead to (optional). Must be a line on your account — see [Get Phone Lines](#tag/utilities/get/v1/get-phone-lines). If omitted, any line with remaining daily outbound capacity is used.",
                    "example": 5
                  },
                  "assignee_id": {
                    "type": "integer",
                    "description": "The user to assign this lead to (optional). The user must belong to your account.",
                    "example": 123
                  }
                }
              },
              "examples": {
                "withEmail": {
                  "summary": "Add lead with email",
                  "value": {
                    "first_name": "John",
                    "last_name": "Doe",
                    "phone": "+1234567890",
                    "email": "john.doe@example.com",
                    "line_id": 5,
                    "assignee_id": 12
                  }
                },
                "withoutEmail": {
                  "summary": "Add lead without email",
                  "value": {
                    "first_name": "Jane",
                    "last_name": "Smith",
                    "phone": "+9876543210"
                  }
                },
                "withLineId": {
                  "summary": "Add lead on a specific phone line",
                  "value": {
                    "first_name": "Alex",
                    "last_name": "Turner",
                    "phone": "+1555000123",
                    "email": "alex.turner@example.com",
                    "line_id": 5
                  }
                },
                "withAssignee": {
                  "summary": "Add lead with an assignee",
                  "value": {
                    "first_name": "Sam",
                    "last_name": "Wilson",
                    "phone": "+1555000456",
                    "assignee_id": "550e8400-e29b-41d4-a716-446655440000"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Lead created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Lead"
                    },
                    "message": {
                      "type": "string",
                      "example": "Lead created successfully"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 12345,
                    "first_name": "John",
                    "last_name": "Doe",
                    "phone": "+1234567890",
                    "email": "john.doe@example.com"
                  },
                  "message": "Lead created successfully"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing required fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missingFields": {
                    "summary": "Missing required fields",
                    "value": {
                      "success": false,
                      "error": "Missing required fields: first_name, last_name, and phone are required"
                    }
                  },
                  "invalidPhone": {
                    "summary": "Invalid phone number",
                    "value": {
                      "success": false,
                      "error": "Invalid phone number"
                    }
                  },
                  "noPhoneLine": {
                    "summary": "No phone line configured",
                    "value": {
                      "success": false,
                      "error": "No phone line is configured for this account."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The requested phone line or assignee does not belong to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "phoneLineNotFound": {
                    "value": {
                      "success": false,
                      "error": "Phone line not found for this account."
                    }
                  },
                  "assigneeNotFound": {
                    "value": {
                      "success": false,
                      "error": "This user does not exist for this client."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Lead with this phone number already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Lead with this phone number already exists"
                }
              }
            }
          },
          "429": {
            "description": "Daily outbound limit reached, or API rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "dailyOutboundLimit": {
                    "summary": "Daily outbound limit reached on the requested line (or on every line, when `line_id` is omitted)",
                    "value": {
                      "success": false,
                      "error": "Daily outbound limit reached. Please try again once the limit is reset."
                    }
                  },
                  "rateLimit": {
                    "summary": "API rate limit exceeded",
                    "value": {
                      "success": false,
                      "error": "Rate limit reached. Please slow down your requests.",
                      "limit": 25,
                      "retryAfter": 60
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Failed to create lead. Please verify the input data and try again."
                }
              }
            }
          }
        }
      }
    },
    "/v1/update-lead": {
      "put": {
        "tags": [
          "Leads"
        ],
        "summary": "Update a lead",
        "description": "Update an existing lead's information. You can update one or more fields. Pass `line_id` to move the lead to a phone line belonging to your account.\n\n**Supported Methods:** PUT, PATCH, POST\n",
        "operationId": "updateLead",
        "parameters": [
          {
            "name": "lead_id",
            "in": "query",
            "description": "The unique ID of the lead to update",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 12345
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string",
                    "description": "Updated first name",
                    "example": "Jonathan"
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Updated last name",
                    "example": "Doe"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Updated phone number (must be unique)",
                    "example": "+1234567899"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Updated email address",
                    "example": "jonathan.doe@example.com"
                  },
                  "line_id": {
                    "type": "integer",
                    "description": "The phone line to assign this lead to (optional). The line must belong to your account.",
                    "example": 5
                  },
                  "assignee_id": {
                    "type": "integer",
                    "description": "The user to assign this lead to (optional). The user must belong to your account.",
                    "example": 123
                  }
                }
              },
              "examples": {
                "updateName": {
                  "summary": "Update name only",
                  "value": {
                    "first_name": "Jonathan",
                    "last_name": "Doe"
                  }
                },
                "updateEmail": {
                  "summary": "Update email only",
                  "value": {
                    "email": "new.email@example.com"
                  }
                },
                "updateMultiple": {
                  "summary": "Update multiple fields",
                  "value": {
                    "first_name": "Jonathan",
                    "email": "jonathan.doe@example.com",
                    "phone": "+1234567899"
                  }
                },
                "updateAssignee": {
                  "summary": "Update assignee only",
                  "value": {
                    "assignee_id": 123
                  }
                },
                "updatePhoneLine": {
                  "summary": "Update phone line only",
                  "value": {
                    "line_id": 5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Lead"
                    },
                    "message": {
                      "type": "string",
                      "example": "Lead updated successfully"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": 12345,
                    "first_name": "Jonathan",
                    "last_name": "Doe",
                    "phone": "+1234567899",
                    "email": "jonathan.doe@example.com"
                  },
                  "message": "Lead updated successfully"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missingLeadId": {
                    "summary": "Missing lead_id parameter",
                    "value": {
                      "success": false,
                      "error": "Missing parameter: lead_id is required"
                    }
                  },
                  "noFields": {
                    "summary": "No fields to update",
                    "value": {
                      "success": false,
                      "error": "No fields to update"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Lead, assignee, or phone line not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "leadNotFound": {
                    "value": {
                      "success": false,
                      "error": "Lead not found"
                    }
                  },
                  "assigneeNotFound": {
                    "value": {
                      "success": false,
                      "error": "This user does not exist for this client."
                    }
                  },
                  "phoneLineNotFound": {
                    "value": {
                      "success": false,
                      "error": "Phone line not found for this account."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Phone number already exists for another lead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Phone number already exists for another lead"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Failed to update lead. Please check if lead id is correct or Try again later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/delete-lead": {
      "delete": {
        "tags": [
          "Leads"
        ],
        "summary": "Delete a lead",
        "description": "Permanently delete a lead from your contact list. You must provide either `lead_id` or `phone`.",
        "operationId": "deleteLead",
        "parameters": [
          {
            "name": "lead_id",
            "in": "query",
            "description": "The unique ID of the lead to delete",
            "required": false,
            "schema": {
              "type": "integer",
              "example": 12345
            }
          },
          {
            "name": "phone",
            "in": "query",
            "description": "The phone number of the lead to delete",
            "required": false,
            "schema": {
              "type": "string",
              "example": "+1234567890"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Lead deleted successfully"
                    }
                  }
                },
                "examples": {
                  "byLeadId": {
                    "summary": "Delete by lead ID",
                    "value": {
                      "success": true,
                      "message": "Lead deleted successfully"
                    }
                  },
                  "byPhone": {
                    "summary": "Delete by phone",
                    "value": {
                      "success": true,
                      "message": "Lead deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing required parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Missing parameter: lead_id or phone is required"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Lead not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Lead not found"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Failed to delete lead. Please check if lead id or phone no. is correct or Try again later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/send-message": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Send a message",
        "description": "Send a message to a lead. You can send text messages or media (images, videos, voice messages(for whatsapp, only mp3 and for sms and imessage only .wav attachments are supported).\n\n**Supported Message Types:**\n- `text` - Plain text message\n- `image` - Image file (provide URL)\n- `video` - Video file (provide URL)\n- `voice_message` - Voice recording (provide URL, .mp3 for whatsapp and .wav for sms/imessage)\n- `attachment` - Other file types (provide URL)\n\nFor media messages, provide a publicly accessible URL in the `content` field.\n",
        "operationId": "sendMessage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message_type",
                  "content"
                ],
                "properties": {
                  "lead_id": {
                    "type": "integer",
                    "description": "The lead ID to send message to (provide either lead_id or phone)",
                    "example": 12345
                  },
                  "phone": {
                    "type": "string",
                    "description": "The phone number to send message to. Pass exactly one of `phone`, `lead_id`, or `group_chat_id`.",
                    "example": "+1234567890"
                  },
                  "group_chat_id": {
                    "type": "integer",
                    "description": "The group chat ID belonging to your account. Pass group_chat_id` if you want to send a message in a group chat.",
                    "example": 123
                  },
                  "message_type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "image",
                      "video",
                      "voice_message",
                      "attachment"
                    ],
                    "description": "Type of message to send",
                    "example": "text"
                  },
                  "content": {
                    "type": "string",
                    "description": "For text messages, the message text. For media, provide a publicly accessible URL.",
                    "example": "Hello! How can I help you today?"
                  }
                }
              },
              "examples": {
                "textMessage": {
                  "summary": "Send text message",
                  "value": {
                    "lead_id": 12345,
                    "message_type": "text",
                    "content": "Hello! How can I help you today?"
                  }
                },
                "imageMessage": {
                  "summary": "Send image",
                  "value": {
                    "phone": "+1234567890",
                    "message_type": "image",
                    "content": "https://example.com/image.jpg"
                  }
                },
                "voiceMessage": {
                  "summary": "Send voice message",
                  "value": {
                    "lead_id": 12345,
                    "message_type": "voice_message",
                    "content": "https://example.com/voice.mp3"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Lead ID",
                          "example": 12345
                        },
                        "phone": {
                          "type": "string",
                          "description": "Lead's phone number",
                          "example": "+1234567890"
                        },
                        "message_type": {
                          "type": "string",
                          "description": "Type of message sent",
                          "example": "text"
                        },
                        "content": {
                          "type": "string",
                          "description": "Message content",
                          "example": "Hello! How can I help you today?"
                        },
                        "sent_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Timestamp when message was sent",
                          "example": "2025-01-15T10:30:00Z"
                        }
                      }
                    },
                    "message": {
                      "type": "string",
                      "example": "Message sent successfully"
                    }
                  }
                },
                "examples": {
                  "textSuccess": {
                    "summary": "Text message sent",
                    "value": {
                      "success": true,
                      "data": {
                        "id": 12345,
                        "phone": "+1234567890",
                        "message_type": "text",
                        "content": "Hello! How can I help you today?",
                        "sent_at": "2025-01-15T10:30:00Z"
                      },
                      "message": "Message sent successfully"
                    }
                  },
                  "imageSuccess": {
                    "summary": "Image message sent",
                    "value": {
                      "success": true,
                      "data": {
                        "id": 12345,
                        "phone": "+1234567890",
                        "message_type": "image",
                        "content": "https://example.com/image.jpg",
                        "sent_at": "2025-01-15T10:30:00Z"
                      },
                      "message": "Message sent successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missingFields": {
                    "summary": "Missing required fields",
                    "value": {
                      "success": false,
                      "error": "Missing required fields: message_type and content"
                    }
                  },
                  "missingRecipient": {
                    "summary": "Missing phone or lead_id",
                    "value": {
                      "success": false,
                      "error": "Missing required field: phone or lead_id"
                    }
                  },
                  "invalidType": {
                    "summary": "Invalid message type",
                    "value": {
                      "success": false,
                      "error": "Invalid message_type. Must be one of: text, image, video, voice_message, attachment"
                    }
                  },
                  "invalidMedia": {
                    "summary": "Invalid media URL",
                    "value": {
                      "success": false,
                      "error": "Invalid media URL format"
                    }
                  },
                  "invalidJson": {
                    "summary": "Invalid JSON body",
                    "value": {
                      "success": false,
                      "error": "Body must be in JSON format"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Lead not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Lead not found"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "sendError": {
                    "summary": "Failed to send",
                    "value": {
                      "success": false,
                      "error": "Failed to send message. Check input fields or Try later."
                    }
                  },
                  "mediaError": {
                    "summary": "Media processing failed",
                    "value": {
                      "success": false,
                      "error": "Failed to process media",
                      "detail": "Could not download media from URL"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/create-group-chat": {
      "post": {
        "tags": [
          "Group Chats"
        ],
        "summary": "Create a group chat",
        "description": "Create a group with 2–31 unique participant phone numbers and an initial outgoing text message. Every participant is checked: if any number uses SMS, the group uses SMS; otherwise it uses iMessage. `name`, `participants`, and `text` are required. If `line_id` is omitted, an active line belonging to your account is selected. The optional icon must be PNG or JPG/JPEG. The response returns the original supplied icon URL.",
        "operationId": "createGroupChat",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "A non-empty group name.",
                    "example": "Team Chat"
                  },
                  "participants": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 31,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "description": "One phone number with an area code. International numbers should include the country code.",
                      "example": "+12125550102"
                    }
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The initial text message to send.",
                    "example": "Hello everyone!"
                  },
                  "line_id": {
                    "type": "integer",
                    "description": "Optional active phone line ID belonging to your account.",
                    "example": 7
                  },
                  "icon_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "An HTTP or HTTPS URL to a PNG, JPG, or JPEG image. The image is uploaded to group_icons.",
                    "example": "https://example.com/icon.png"
                  }
                },
                "required": [
                  "name",
                  "participants",
                  "text"
                ]
              },
              "example": {
                "name": "Team Chat",
                "participants": [
                  "+12125550100",
                  "+12125550101"
                ],
                "text": "Hello everyone!"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/GroupChat"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "group_chat_id": 123,
                    "created_at": "2026-09-06T10:00:00Z",
                    "line_id": 7,
                    "name": "Team Chat",
                    "icon": null,
                    "status": "new",
                    "participants": [
                      "+12125550100",
                      "+12125550101"
                    ],
                    "platform": "iMessage"
                  },
                  "message": "Group chat created successfully"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or group restriction.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Invalid request."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "The request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Please try again later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/get-group-chats": {
      "get": {
        "tags": [
          "Group Chats"
        ],
        "summary": "Get group chats",
        "description": "Return all group chats belonging to your account. Pass `group_chat_id` to return a single group object instead of an array. An empty list returns `[]`; an unknown group ID returns 404. Returned icon URLs are signed for one hour.",
        "operationId": "getGroupChats",
        "parameters": [
          {
            "name": "group_chat_id",
            "in": "query",
            "required": false,
            "description": "The ID of a group chat belonging to your account.",
            "schema": {
              "type": "integer",
              "example": 123
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "oneOf": [
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GroupChat"
                          }
                        },
                        {
                          "$ref": "#/components/schemas/GroupChat"
                        }
                      ]
                    }
                  }
                },
                "examples": {
                  "allGroups": {
                    "summary": "All groups",
                    "value": {
                      "success": true,
                      "data": [
                        {
                          "group_chat_id": 123,
                          "created_at": "2026-09-06T10:00:00Z",
                          "line_id": 7,
                          "name": "Team Chat",
                          "icon": null,
                          "status": "new",
                          "participants": [
                            "+12125550100",
                            "+12125550101"
                          ],
                          "platform": "iMessage"
                        }
                      ]
                    }
                  },
                  "singleGroup": {
                    "summary": "One group",
                    "value": {
                      "success": true,
                      "data": {
                        "group_chat_id": 123,
                        "created_at": "2026-09-06T10:00:00Z",
                        "line_id": 7,
                        "name": "Team Chat",
                        "icon": null,
                        "status": "new",
                        "participants": [
                          "+12125550100",
                          "+12125550101"
                        ],
                        "platform": "iMessage"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or group restriction.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Invalid request."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The group does not exist or does not belong to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Group chat not found."
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "The request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Please try again later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/update-group-chat": {
      "patch": {
        "tags": [
          "Group Chats"
        ],
        "summary": "Update a group chat",
        "description": "Update `name`, `icon_url`, or both. Other fields are rejected and omitted fields stay unchanged. Pass `group_chat_id` in the query string. Icons must be PNG or JPG/JPEG. Returned icon URLs are signed for one hour.\n\n**Supported Methods:** PUT, PATCH, POST",
        "operationId": "updateGroupChat",
        "parameters": [
          {
            "name": "group_chat_id",
            "in": "query",
            "required": true,
            "description": "The ID of a group chat belonging to your account.",
            "schema": {
              "type": "integer",
              "example": 123
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "A non-empty group name.",
                    "example": "Team Chat"
                  },
                  "icon_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "An HTTP or HTTPS URL to a PNG, JPG, or JPEG image.",
                    "example": "https://example.com/icon.png"
                  }
                },
                "required": [],
                "minProperties": 1,
                "additionalProperties": false
              },
              "example": {
                "name": "Updated Team Chat"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/GroupChat"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "group_chat_id": 123,
                    "created_at": "2026-09-06T10:00:00Z",
                    "line_id": 7,
                    "name": "Updated Team Chat",
                    "icon": null,
                    "status": "new",
                    "participants": [
                      "+12125550100",
                      "+12125550101"
                    ],
                    "platform": "iMessage"
                  },
                  "message": "Group chat updated successfully"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or group restriction.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Invalid request."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The group does not exist or does not belong to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Group chat not found."
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "The request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Please try again later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/group-chat-add": {
      "post": {
        "tags": [
          "Group Chats"
        ],
        "summary": "Add a participant",
        "description": "Pass `group_chat_id` and one `participant` phone number string in the JSON body. Only one participant can be changed per request. Participants cannot be added or removed from SMS group chats. Only iMessage numbers can be added to iMessage groups. Duplicate participants are rejected, and no more than 31 participants are allowed.",
        "operationId": "groupChatAdd",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "group_chat_id": {
                    "type": "integer",
                    "example": 123
                  },
                  "participant": {
                    "type": "string",
                    "description": "Pass a phone number with country code.",
                    "example": "+12125550102"
                  }
                },
                "required": [
                  "group_chat_id",
                  "participant"
                ],
                "additionalProperties": false
              },
              "example": {
                "group_chat_id": 123,
                "participant": "+12125550102"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "group_chat_id": {
                          "type": "integer",
                          "example": 123
                        },
                        "participants": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "minItems": 2,
                          "maxItems": 31
                        },
                        "platform": {
                          "type": "string",
                          "enum": [
                            "SMS",
                            "iMessage"
                          ]
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "group_chat_id": 123,
                    "participants": [
                      "+12125550100",
                      "+12125550101",
                      "+12125550102"
                    ],
                    "platform": "iMessage"
                  },
                  "message": "Participant added successfully."
                }
              }
            }
          },
          "400": {
            "description": "SMS groups cannot be edited; participant or group size restrictions apply.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Participants can't be added or removed from SMS group chats."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The group does not exist or does not belong to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Group chat not found."
                }
              }
            }
          },
          "409": {
            "description": "The participant already belongs to the group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Participant is already in this group chat."
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "The request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Please try again later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/group-chat-remove": {
      "post": {
        "tags": [
          "Group Chats"
        ],
        "summary": "Remove a participant",
        "description": "Pass `group_chat_id` and one `participant` phone number string in the JSON body. Only one participant can be changed per request. Participants cannot be added or removed from SMS group chats. A participant can only be removed from an iMessage group with at least 3 participants, leaving at least 2. The participant must already belong to the group.",
        "operationId": "groupChatRemove",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "group_chat_id": {
                    "type": "integer",
                    "example": 123
                  },
                  "participant": {
                    "type": "string",
                    "description": "Pass a phone number with country code.",
                    "example": "+12125550102"
                  }
                },
                "required": [
                  "group_chat_id",
                  "participant"
                ],
                "additionalProperties": false
              },
              "example": {
                "group_chat_id": 123,
                "participant": "+12125550102"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "group_chat_id": {
                          "type": "integer",
                          "example": 123
                        },
                        "participants": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "minItems": 2,
                          "maxItems": 31
                        },
                        "platform": {
                          "type": "string",
                          "enum": [
                            "SMS",
                            "iMessage"
                          ]
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "group_chat_id": 123,
                    "participants": [
                      "+12125550100",
                      "+12125550101"
                    ],
                    "platform": "iMessage"
                  },
                  "message": "Participant removed successfully."
                }
              }
            }
          },
          "400": {
            "description": "SMS groups cannot be edited; participant or group size restrictions apply.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Participants can't be added or removed from SMS group chats."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The group was not found for your account, or the participant is not in the group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Group chat not found."
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "The request could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Please try again later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/platform-lookup": {
      "get": {
        "tags": [
          "Utilities"
        ],
        "summary": "Check messaging platform",
        "description": "Look up which messaging platform a phone number is registered on. Returns one of three values: **iMessage**, **WhatsApp**, or **SMS**.\n\n**Platform Priority (from highest to lowest):**\n1. **iMessage** - Checked first. If available, this is the preferred platform.\n2. **WhatsApp** - Checked second. If iMessage is not available but WhatsApp is, use this.\n3. **SMS** - The fallback option. Used when neither iMessage nor WhatsApp is available.\n",
        "operationId": "platformLookup",
        "parameters": [
          {
            "name": "phone",
            "in": "query",
            "description": "The phone number to look up",
            "required": true,
            "schema": {
              "type": "string",
              "example": "+1234567890"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Platform lookup successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "phone": {
                          "type": "string",
                          "description": "The normalized phone number",
                          "example": "+1234567890"
                        },
                        "platform": {
                          "type": "string",
                          "enum": [
                            "iMessage",
                            "WhatsApp",
                            "SMS"
                          ],
                          "description": "The messaging platform the phone number is registered on (ordered by priority)",
                          "example": "iMessage"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "imessage": {
                    "summary": "iMessage user (highest priority)",
                    "value": {
                      "success": true,
                      "data": {
                        "phone": "+1234567890",
                        "platform": "iMessage"
                      }
                    }
                  },
                  "whatsapp": {
                    "summary": "WhatsApp user (second priority)",
                    "value": {
                      "success": true,
                      "data": {
                        "phone": "+1987654321",
                        "platform": "WhatsApp"
                      }
                    }
                  },
                  "sms": {
                    "summary": "SMS only (fallback)",
                    "value": {
                      "success": true,
                      "data": {
                        "phone": "+9876543210",
                        "platform": "SMS"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missingPhone": {
                    "summary": "Missing phone parameter",
                    "value": {
                      "success": false,
                      "error": "Missing required parameter: phone"
                    }
                  },
                  "invalidPhone": {
                    "summary": "Invalid phone format",
                    "value": {
                      "success": false,
                      "error": "Invalid phone_number: 123"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "Failed to lookup platform. Check phone no. or Try later."
                }
              }
            }
          }
        }
      }
    },
    "/v1/get-phone-lines": {
      "get": {
        "tags": [
          "Utilities"
        ],
        "summary": "Get phone lines",
        "description": "List the phone lines on your account. Use the returned `id` values as the `line_id` when creating a lead with [Add a new lead](#tag/leads/post/v1/add-lead).\n\nPass `phone_number` to look up a single line, or omit it to return every line on the account.\n\n**Note:** this endpoint returns the array of phone lines directly, not wrapped in the usual `{ \"success\": ..., \"data\": ... }` envelope.\n",
        "operationId": "getPhoneLines",
        "parameters": [
          {
            "name": "phone_number",
            "in": "query",
            "description": "Return only the line matching this phone number. Omit to return all lines on the account.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "+1234567890"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Phone lines retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PhoneLine"
                  }
                },
                "examples": {
                  "allLines": {
                    "summary": "All phone lines on the account",
                    "value": [
                      {
                        "id": 5,
                        "phone_number": "+18408771955",
                        "daily_limit_used": 3,
                        "active": true
                      }
                    ]
                  },
                  "singleLine": {
                    "summary": "Lookup by phone number",
                    "value": [
                      {
                        "id": 5,
                        "phone_number": "+18408771955",
                        "daily_limit_used": 3,
                        "active": true
                      }
                    ]
                  },
                  "noLines": {
                    "summary": "No phone lines configured (no `phone_number` given)",
                    "value": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No line on this account matches the requested `phone_number`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "This phone line does not exist"
                    }
                  }
                },
                "example": {
                  "error": "This phone line does not exist"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Failed to lookup phone line. Please try again."
                    }
                  }
                },
                "example": {
                  "error": "Failed to lookup phone line. Please try again."
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your Sendara API key",
        "x-default": "sendara_1234567890abcdef"
      }
    },
    "schemas": {
      "Lead": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier for the lead",
            "example": 12345
          },
          "first_name": {
            "type": "string",
            "description": "Lead's first name",
            "example": "John"
          },
          "last_name": {
            "type": "string",
            "description": "Lead's last name",
            "example": "Doe"
          },
          "phone": {
            "type": "string",
            "description": "Lead's phone number",
            "example": "+1234567890"
          },
          "email": {
            "type": "string",
            "nullable": true,
            "format": "email",
            "description": "Lead's email address (optional)",
            "example": "john.doe@example.com"
          }
        },
        "required": [
          "id",
          "first_name",
          "last_name",
          "phone"
        ]
      },
      "PhoneLine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier for the phone line. Pass this as `line_id` when adding a lead.",
            "example": 5
          },
          "phone_number": {
            "type": "string",
            "description": "The phone number of the line",
            "example": "+18408771955"
          },
          "daily_limit_used": {
            "type": "integer",
            "description": "Number of outbound leads already assigned to this line today. Once it reaches the daily limit, the line stops accepting new leads until the limit resets.",
            "example": 3
          },
          "active": {
            "type": "boolean",
            "description": "Whether the line is currently active",
            "example": true
          }
        },
        "required": [
          "id",
          "phone_number"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string",
            "description": "Human-readable error message",
            "example": "Something went wrong"
          }
        },
        "required": [
          "success",
          "error"
        ]
      },
      "GroupChat": {
        "type": "object",
        "properties": {
          "group_chat_id": {
            "type": "integer",
            "example": 123
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "line_id": {
            "type": "integer",
            "example": 7
          },
          "name": {
            "type": "string"
          },
          "icon": {
            "type": [
              "string",
              "null"
            ],
            "description": "Original supplied icon URL on creation; a one-hour signed URL on retrieval or update. Null when no icon is set."
          },
          "status": {
            "type": "string",
            "example": "new"
          },
          "participants": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 2,
            "maxItems": 31
          },
          "platform": {
            "type": "string",
            "enum": [
              "SMS",
              "iMessage"
            ]
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Authentication failed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "missingKey": {
                "summary": "Missing API key",
                "value": {
                  "success": false,
                  "error": "Missing API key"
                }
              },
              "invalidKey": {
                "summary": "Invalid API key",
                "value": {
                  "success": false,
                  "error": "Invalid API key"
                }
              }
            }
          }
        }
      },
      "RateLimitExceeded": {
        "description": "Rate limit exceeded",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "example": false
                },
                "error": {
                  "type": "string",
                  "example": "Rate limit reached. Please slow down your requests."
                },
                "limit": {
                  "type": "integer",
                  "description": "Maximum requests allowed per minute",
                  "example": 25
                },
                "retryAfter": {
                  "type": "integer",
                  "description": "Seconds to wait before retrying",
                  "example": 60
                }
              }
            },
            "example": {
              "success": false,
              "error": "Rate limit reached. Please slow down your requests.",
              "limit": 25,
              "retryAfter": 60
            }
          }
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "API Endpoints",
      "tags": [
        "Leads",
        "Messages",
        "Group Chats",
        "Utilities"
      ]
    }
  ],
  "x-ext-urls": {}
}