{
  "openapi": "3.1.0",
  "info": {
    "title": "Sendmsg API",
    "version": "4.5",
    "description": "Manage subscribers and mailing lists, and send email and SMS campaigns.",
    "contact": {
      "email": "send.help@comstar.co.il"
    }
  },
  "servers": [
    {
      "url": "https://gconvertrest.sendmsg.co.il/api/Sendmsg"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiToken": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Token from POST /token. Valid for 12 hours."
      }
    }
  },
  "tags": [
    {
      "name": "Getting started",
      "description": "Obtain a token and confirm it works. Every other endpoint needs one."
    },
    {
      "name": "Subscribers",
      "description": "Add, update, inspect and change the status of the people you send to."
    },
    {
      "name": "Mailing lists",
      "description": "Create lists, read their members, and move subscribers in and out."
    },
    {
      "name": "Sending",
      "description": "Send email and SMS, either to subscribers you supply inline or to whole mailing lists. Messages can be composed inline, reused from history, or taken from a draft."
    },
    {
      "name": "Fields",
      "description": "Read and create the custom fields you can reference in message content."
    },
    {
      "name": "SMS sender verification",
      "description": "Verify ownership of a sender number before sending from it, and check your SMS balance."
    },
    {
      "name": "Reports",
      "description": "Message statistics and subscriber growth over time."
    }
  ],
  "paths": {
    "/token": {
      "post": {
        "operationId": "token",
        "summary": "Get a token",
        "description": "Exchange your account SiteID and API password for a bearer token. SiteID is your Sendmsg account number. The API password comes from the support team. Send the token as the Authorization header on every other call.\n\nThe token is valid for 12 hours. Renewing it well before expiry is recommended.\n\nAppend ?full=true to receive the token metadata, such as its timestamp and expiry date.",
        "tags": [
          "Getting started"
        ],
        "parameters": [],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Request a token",
                    "value": {
                      "Token": "34234-34234234-fsdgdfg-34r5t343f334f"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "Request a token",
                  "value": {
                    "siteID": 1687,
                    "password": "0123456789"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ping": {
      "post": {
        "operationId": "ping",
        "summary": "Test authentication",
        "description": "Confirms that your token is valid. Useful as a first call when wiring up an integration.",
        "tags": [
          "Getting started"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Ping",
                    "value": {
                      "isSuccess": true,
                      "msg": "hello user: 11111 test works! you are now validated.."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/AddUsersOnly": {
      "post": {
        "operationId": "addUsersOnly",
        "summary": "Add or update subscribers",
        "description": "Adds subscribers to your account, or updates them if they already exist. The body is an array of user objects.\n\nIf UserID and EmailAddress are both present and populated, the email wins.\n\nTo create a custom field before referencing it, use CreateField.\n\nThe blueprint also shows a wrapped { users: [...], Message: {...} } body for this endpoint, which contradicts the array body in its own request examples. The array form is documented here because that is what the request examples send.",
        "tags": [
          "Subscribers"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "by-email": {
                    "summary": "By email",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": 1,
                        "message": 0
                      }
                    }
                  },
                  "by-userid": {
                    "summary": "By UserID",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": 1,
                        "message": 0
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "By email",
                    "type": "object"
                  },
                  {
                    "title": "By UserID",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "by-email": {
                  "summary": "By email",
                  "value": [
                    {
                      "EmailAddress": "comstar@comstar.com",
                      "Cellphone": "0501234567",
                      "FirstName": "Client First Name",
                      "LastName": "Client Last Name",
                      "userSystemFields": [
                        {
                          "Key": "Custom Field Name In Sendmsg",
                          "Value": "Value"
                        }
                      ]
                    }
                  ]
                },
                "by-userid": {
                  "summary": "By UserID",
                  "value": [
                    {
                      "UserID": 19407,
                      "Cellphone": "0501234567",
                      "userSystemFields": [
                        {
                          "Key": "Custom Field Name In Sendmsg",
                          "Value": "Value"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/GetUserDetails": {
      "get": {
        "operationId": "getUserDetails",
        "summary": "Get subscriber details",
        "description": "Returns every stored detail for one subscriber.",
        "tags": [
          "Subscribers"
        ],
        "parameters": [
          {
            "name": "userID",
            "in": "query",
            "required": true,
            "description": "ID of the subscriber in your Sendmsg account.",
            "schema": {
              "type": "integer"
            },
            "example": "43998"
          }
        ],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Get details",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "user": {
                        "Cellphone": "0501234567",
                        "DeleteUser": false,
                        "EmailAddress": "comstar2@comstar2.com",
                        "IsUserSelfRemoved": false,
                        "UndeleteUserIfExists": false,
                        "UserID": 43998,
                        "UserSendFields": [
                          {
                            "Key": "Custom Field for this message",
                            "Value": "Value"
                          }
                        ],
                        "UserSystemFields": [
                          {
                            "Key": "Custom Field Name In Sendmsg",
                            "Value": "Value"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/GetSystemUsers": {
      "post": {
        "operationId": "getSystemUsers",
        "summary": "List users by request type",
        "description": "Returns the subscribers who unsubscribed, were deleted, or were flagged with a bad email address.\n\nrequestType accepts SelfRemUsers (unsubscribed), DelUsers (deleted), or wrongMails (flagged as a wrong address).",
        "tags": [
          "Subscribers"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "List users",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "users": [
                        {
                          "Cellphone": "0501234567",
                          "DeleteUser": false,
                          "EmailAddress": "comstar2@comstar2.com",
                          "IsUserSelfRemoved": false,
                          "UndeleteUserIfExists": false,
                          "UserID": 43998,
                          "UserSendFields": [],
                          "UserSystemFields": [
                            {
                              "Key": "Custom Field Name In Sendmsg",
                              "Value": "Value"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "List users",
                  "value": {
                    "requestType": "SelfRemUsers"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/ChangeUpdateStatus": {
      "post": {
        "operationId": "changeUpdateStatus",
        "summary": "Change a subscriber's send status",
        "description": "Changes the send status of one subscriber in your account.\n\nStatusEmail accepts Active, Inactive, AskedRemoval, or BadEmail.\n\nIf the subscriber is already set to AskedRemoval, updating their email status is restricted.\n\nThe blueprint documents no response for this endpoint.",
        "tags": [
          "Subscribers"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {}
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "By email",
                    "type": "object"
                  },
                  {
                    "title": "By UserID",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "by-email": {
                  "summary": "By email",
                  "value": {
                    "EmailAddress": "comstar@comstar.com",
                    "StatusEmail": "Active"
                  }
                },
                "by-userid": {
                  "summary": "By UserID",
                  "value": {
                    "UserID": "1773",
                    "StatusEmail": "Active"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/CreateMalingList": {
      "post": {
        "operationId": "createMailingList",
        "summary": "Create a mailing list",
        "description": "Creates a new, empty mailing list in your account.",
        "tags": [
          "Mailing lists"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Create list",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [],
                        "mailingLists": [
                          172595
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "Create list",
                  "value": {
                    "IsNewList": true,
                    "NewListName": "my new mailing list",
                    "NewListDescription": "this is the description of the mailing list"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/GetMailingListNames": {
      "post": {
        "operationId": "getMailingListNames",
        "summary": "List all mailing lists",
        "description": "Returns every mailing list in your account with its ID, name, description and subscriber counts. Takes no body.",
        "tags": [
          "Mailing lists"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "List all",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "listNames": [
                        {
                          "ActiveUserCount": 128,
                          "ExistingListID": 172595,
                          "IsNewList": false,
                          "NewListDescription": "List from Another Galaxy",
                          "NewListName": "Andromeda",
                          "UserCount": 140
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/GetMailingListByID": {
      "get": {
        "operationId": "getMailingListById",
        "summary": "Get a mailing list's subscribers",
        "description": "Returns the subscribers of one mailing list, filtered by type.\n\nThe blueprint documents no response for this endpoint.",
        "tags": [
          "Mailing lists"
        ],
        "parameters": [
          {
            "name": "listID",
            "in": "query",
            "required": true,
            "description": "ID of the mailing list in your Sendmsg account.",
            "schema": {
              "type": "integer"
            },
            "example": "172595"
          },
          {
            "name": "type",
            "in": "query",
            "required": true,
            "description": "Which subscribers to return. 0 = all (deleted, wrong, active, unsubscribed), 1 = deleted, 2 = unsubscribed, 3 = wrong emails, 4 = active.",
            "schema": {
              "type": "integer"
            },
            "example": "4"
          }
        ],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {}
              }
            }
          }
        }
      }
    },
    "/AddUsersToLists": {
      "post": {
        "operationId": "addUsersToLists",
        "summary": "Add subscribers to mailing lists",
        "description": "Adds existing subscribers to one or more existing mailing lists.",
        "tags": [
          "Mailing lists"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "by-email": {
                    "summary": "By email",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "mailingLists": [
                          5
                        ]
                      }
                    }
                  },
                  "by-userid": {
                    "summary": "By UserID",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          19407
                        ],
                        "mailingLists": [
                          5
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "By email",
                    "type": "object"
                  },
                  {
                    "title": "By UserID",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "by-email": {
                  "summary": "By email",
                  "value": {
                    "users": [
                      {
                        "EmailAddress": "comstar@comstar.com"
                      }
                    ],
                    "mailingLists": [
                      {
                        "ExistingListID": 5
                      }
                    ]
                  }
                },
                "by-userid": {
                  "summary": "By UserID",
                  "value": {
                    "users": [
                      {
                        "UserID": 19407
                      }
                    ],
                    "mailingLists": [
                      {
                        "ExistingListID": 5
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/TruncateMailingLists": {
      "post": {
        "operationId": "truncateMailingLists",
        "summary": "Empty mailing lists",
        "description": "Removes every subscriber from the given mailing lists. The body is a plain array of list IDs.",
        "tags": [
          "Mailing lists"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Empty lists",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": null
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "Empty lists",
                  "value": [
                    1,
                    2,
                    3,
                    4,
                    5
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/RemoveFromMailingLists/ManyToMany": {
      "post": {
        "operationId": "removeFromMailingLists",
        "summary": "Remove subscribers from mailing lists",
        "description": "Removes specific subscribers from specific mailing lists. Subscribers may be identified by UserID, EmailAddress or Cellphone.\n\nAdd only one mailing list per user. Any extra type is dismissed.\n\nWhere several identifiers are supplied, the API always prefers UserID and ignores the rest.",
        "tags": [
          "Mailing lists"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "by-userid": {
                    "summary": "By UserID",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": null
                    }
                  },
                  "by-email": {
                    "summary": "By email",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": null
                    }
                  },
                  "by-cellphone": {
                    "summary": "By cellphone",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": null
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "By UserID",
                    "type": "object"
                  },
                  {
                    "title": "By email",
                    "type": "object"
                  },
                  {
                    "title": "By cellphone",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "by-userid": {
                  "summary": "By UserID",
                  "value": {
                    "users": [
                      {
                        "UserID": "4"
                      },
                      {
                        "UserID": "3"
                      },
                      {
                        "UserID": "9"
                      }
                    ],
                    "mailingLists": [
                      {
                        "ExistingListID": 5
                      },
                      {
                        "ExistingListID": 7
                      },
                      {
                        "ExistingListID": 9
                      }
                    ]
                  }
                },
                "by-email": {
                  "summary": "By email",
                  "value": {
                    "users": [
                      {
                        "EmailAddress": "comstar@comstar.com"
                      }
                    ],
                    "mailingLists": [
                      {
                        "ExistingListID": 5
                      }
                    ]
                  }
                },
                "by-cellphone": {
                  "summary": "By cellphone",
                  "value": {
                    "users": [
                      {
                        "Cellphone": "0501234567"
                      }
                    ],
                    "mailingLists": [
                      {
                        "ExistingListID": 5
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/AddUsersAndSend": {
      "post": {
        "operationId": "addUsersAndSendEmail",
        "summary": "Add subscribers and send an email",
        "description": "Adds or updates subscribers and sends them an email in a single call. The message may be composed inline, or taken from a past send or a draft.\n\nSquare brackets in MessageContent name a field and are replaced at render time. Unmatched keys are removed.\n\nuserSendFields values are referenced as [|[yourKey]|] and apply to this message only.",
        "tags": [
          "Sending"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "new": {
                    "summary": "New message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  },
                  "past": {
                    "summary": "Past message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  },
                  "draft": {
                    "summary": "Draft message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "New message",
                    "type": "object"
                  },
                  {
                    "title": "Past message",
                    "type": "object"
                  },
                  {
                    "title": "Draft message",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "new": {
                  "summary": "New message",
                  "value": {
                    "users": [
                      {
                        "EmailAddress": "example@comstar.com",
                        "userSendFields": [
                          {
                            "Key": "companyName",
                            "Value": "comstar"
                          }
                        ]
                      }
                    ],
                    "Message": {
                      "MessageContent": "Your [|[companyName]|] Name",
                      "MessageSubject": "hello world",
                      "MessageInnerName": "inner name",
                      "SenderEmailAddress": "office@comstar.co.il",
                      "SenderName": "comstar",
                      "MessageBackColor": "black",
                      "MessageDirection": 2,
                      "AddFacebook": true,
                      "AddForward": true,
                      "AddShowMessage": true
                    }
                  }
                },
                "past": {
                  "summary": "Past message",
                  "value": {
                    "users": [
                      {
                        "EmailAddress": "comstar@comstar.com"
                      }
                    ],
                    "Message": {
                      "MessageID": 2050763
                    }
                  }
                },
                "draft": {
                  "summary": "Draft message",
                  "value": {
                    "users": [
                      {
                        "EmailAddress": "comstar@comstar.com"
                      }
                    ],
                    "Message": {
                      "UseDraftID": 2050763
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/AddUsersAndSendSMS": {
      "post": {
        "operationId": "addUsersAndSendSms",
        "summary": "Add subscribers and send an SMS",
        "description": "Adds or updates subscribers and sends them an SMS in a single call. This has its own path, separate from the email send.\n\nSenderPhone strips special characters and spaces, trims words over 11 characters, and accepts English letters only.",
        "tags": [
          "Sending"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "new": {
                    "summary": "New message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  },
                  "past": {
                    "summary": "Past message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  },
                  "draft": {
                    "summary": "Draft message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "New message",
                    "type": "object"
                  },
                  {
                    "title": "Past message",
                    "type": "object"
                  },
                  {
                    "title": "Draft message",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "new": {
                  "summary": "New message",
                  "value": {
                    "users": [
                      {
                        "EmailAddress": "comstar@comstar.com",
                        "Cellphone": "0501234567"
                      }
                    ],
                    "Message": {
                      "MessageContent": "Hello World",
                      "SenderPhone": "0500000000",
                      "MessageInnerName": "inner name",
                      "MessageType": 1,
                      "TypeSms": 1
                    }
                  }
                },
                "past": {
                  "summary": "Past message",
                  "value": {
                    "users": [
                      {
                        "Cellphone": "0501234567"
                      }
                    ],
                    "Message": {
                      "MessageID": 2050763
                    }
                  }
                },
                "draft": {
                  "summary": "Draft message",
                  "value": {
                    "users": [
                      {
                        "Cellphone": "0501234567"
                      }
                    ],
                    "Message": {
                      "UseDraftID": 2050763
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/SendEmailToMailingLists": {
      "post": {
        "operationId": "sendEmailToMailingLists",
        "summary": "Send an email to mailing lists",
        "description": "Sends a message to every subscriber of the given mailing lists, without adding anyone.\n\nMalingListIDs is an array of mailing list IDs. The spelling is the API's own.",
        "tags": [
          "Sending"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "new": {
                    "summary": "New message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  },
                  "past": {
                    "summary": "Past message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  },
                  "draft": {
                    "summary": "Draft message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "New message",
                    "type": "object"
                  },
                  {
                    "title": "Past message",
                    "type": "object"
                  },
                  {
                    "title": "Draft message",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "new": {
                  "summary": "New message",
                  "value": {
                    "Message": {
                      "MessageContent": "this is the content of the message",
                      "MessageSubject": "hello world",
                      "MessageInnerName": "inner name",
                      "SenderEmailAddress": "office@comstar.co.il",
                      "SenderName": "comstar",
                      "MessageBackColor": "black",
                      "MessageDirection": 2,
                      "AddFacebook": true,
                      "AddForward": true,
                      "AddShowMessage": true
                    },
                    "MalingListIDs": [
                      172595
                    ]
                  }
                },
                "past": {
                  "summary": "Past message",
                  "value": {
                    "Message": {
                      "MessageID": 2050763
                    },
                    "MalingListIDs": [
                      172595
                    ]
                  }
                },
                "draft": {
                  "summary": "Draft message",
                  "value": {
                    "Message": {
                      "UseDraftID": 2050763
                    },
                    "MalingListIDs": [
                      172595
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/SendSmsToMailingLists": {
      "post": {
        "operationId": "sendSmsToMailingLists",
        "summary": "Send an SMS to mailing lists",
        "description": "Sends an SMS to every subscriber of the given mailing lists. Unlike the other send pairs, this has its own path rather than sharing the email one.",
        "tags": [
          "Sending"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "new": {
                    "summary": "New message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  },
                  "past": {
                    "summary": "Past message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  },
                  "draft": {
                    "summary": "Draft message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "data": {
                        "users": [
                          43998
                        ],
                        "message": 2050763
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "New message",
                    "type": "object"
                  },
                  {
                    "title": "Past message",
                    "type": "object"
                  },
                  {
                    "title": "Draft message",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "new": {
                  "summary": "New message",
                  "value": {
                    "Message": {
                      "MessageContent": "Hello World",
                      "SenderPhone": "0500000000",
                      "MessageInnerName": "inner name",
                      "MessageType": 1,
                      "TypeSms": 1
                    },
                    "MalingListIDs": [
                      172595
                    ]
                  }
                },
                "past": {
                  "summary": "Past message",
                  "value": {
                    "Message": {
                      "MessageID": 2050763
                    },
                    "MalingListIDs": [
                      172595
                    ]
                  }
                },
                "draft": {
                  "summary": "Draft message",
                  "value": {
                    "Message": {
                      "UseDraftID": 2050763
                    },
                    "MalingListIDs": [
                      172595
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/CreateMessage": {
      "post": {
        "operationId": "createMessage",
        "summary": "Create a message",
        "description": "Creates a message in your account without sending it, and returns its ID. Supports scheduling a future send.\n\nPostponeSendTime schedules the send for a future date, for example 2030-02-25. It defaults to sending now.",
        "tags": [
          "Sending"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Create message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "newMessageID": 2052217
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "Create message",
                  "value": {
                    "MessageContent": "the content of the message",
                    "MessageSubject": "subject",
                    "MessageInnerName": "inner name",
                    "SenderEmailAddress": "comstar@comstar.co.il",
                    "MessageBackColor": "black",
                    "MessageDirection": 1,
                    "AddFacebook": true,
                    "AddForward": true,
                    "AddShowMessage": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "/DelMessage": {
      "get": {
        "operationId": "deleteMessage",
        "summary": "Delete a past message",
        "description": "Deletes a message from your send history.",
        "tags": [
          "Sending"
        ],
        "parameters": [
          {
            "name": "MsgID",
            "in": "query",
            "required": true,
            "description": "ID of the past message in your Sendmsg account.",
            "schema": {
              "type": "integer"
            },
            "example": "2052217"
          }
        ],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Delete message",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "newMessageID": 2052217
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/GetAllFields": {
      "post": {
        "operationId": "getAllFields",
        "summary": "List all fields",
        "description": "Returns every field in your account as key/value pairs. Built-in fields are keyed by name; custom fields are keyed by their numeric ID.",
        "tags": [
          "Fields"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "List fields",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "AllFields": {
                        "2": "שם משפחה",
                        "eMail": "email",
                        "cellPhone": "cell Phone"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/CreateField": {
      "post": {
        "operationId": "createField",
        "summary": "Create a field",
        "description": "Creates a new custom field in your account.\n\nFieldUserType accepts 1 (text), 2 (yes/no), 3 (dropdown), 4 (date), 7 (long text) or 8 (number).\n\nA dropdown field requires OptionToDDR listing its options.\n\nThe source table places the 'OptionToDDR is required' note on the Number row rather than the Dropdown row, which contradicts the worked example beneath it. The note belongs to Dropdown.",
        "tags": [
          "Fields"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "simple": {
                    "summary": "Text field",
                    "value": {
                      "FieldName": "Field Name",
                      "FieldType": 1
                    }
                  },
                  "dropdown": {
                    "summary": "Dropdown field",
                    "value": {
                      "FieldName": "Field Name",
                      "FieldType": 3
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "Text field",
                    "type": "object"
                  },
                  {
                    "title": "Dropdown field",
                    "type": "object"
                  }
                ]
              },
              "examples": {
                "simple": {
                  "summary": "Text field",
                  "value": {
                    "FieldUserName": "Field Name",
                    "FieldUserType": 1
                  }
                },
                "dropdown": {
                  "summary": "Dropdown field",
                  "value": {
                    "FieldUserName": "Field Name",
                    "FieldUserType": 3,
                    "OptionToDDR": [
                      "item 1",
                      "item 2",
                      "item 3"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/VerificationOfSenderNumberBySMS": {
      "post": {
        "operationId": "verificationBySms",
        "summary": "Request a verification code",
        "description": "Sends a verification code by SMS to the sender number you want to use. Add the number in panel.sendmsg.co.il before calling this.\n\nThe blueprint documents no response for this endpoint.",
        "tags": [
          "SMS sender verification"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {}
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "Request code",
                  "value": {
                    "SenderNumber": "0501231234"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/AuthenticateOfSenderNumberBySMS": {
      "post": {
        "operationId": "authenticateSenderNumber",
        "summary": "Confirm a verification code",
        "description": "Completes verification by submitting the code that was sent.\n\nThe blueprint documents no response for this endpoint.",
        "tags": [
          "SMS sender verification"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {}
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "Confirm code",
                  "value": {
                    "SenderNumber": "0501231234",
                    "Code": "111111"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/IsAllowedOfSenderNumberBySMS": {
      "post": {
        "operationId": "isAllowedSenderNumber",
        "summary": "Check whether a number is verified",
        "description": "Reports whether a sender number has completed verification.\n\nThe blueprint documents no response for this endpoint.",
        "tags": [
          "SMS sender verification"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {}
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "Check number",
                  "value": {
                    "SenderNumber": "0501231234"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/CheckingSmsBalances": {
      "get": {
        "operationId": "checkingSmsBalances",
        "summary": "Check SMS balance",
        "description": "Returns your remaining balance of short and long SMS messages.\n\nThe counts arrive inside ResultMessage as text rather than as separate fields.",
        "tags": [
          "SMS sender verification"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Check balance",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "SMS balances:\nShort amount = {num}\nLong amount = {num}",
                        "Tin": ""
                      },
                      "data": null
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/GetMsgFullStatistics": {
      "get": {
        "operationId": "getMsgFullStatistics",
        "summary": "Get message statistics",
        "description": "Returns the full statistics for one past message.\n\nThe blueprint's response body for this endpoint is empty. The response shape is undocumented at source and has not been invented here.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "messageID",
            "in": "query",
            "required": true,
            "description": "ID of the past message in your Sendmsg account.",
            "schema": {
              "type": "integer"
            },
            "example": "2050763"
          }
        ],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {}
              }
            }
          }
        }
      }
    },
    "/GetNumberOfJoinersToSystem": {
      "post": {
        "operationId": "getNumberOfJoiners",
        "summary": "Count subscribers by timeline",
        "description": "Returns how many subscribers joined within each of the date ranges you supply. The body is an array of ranges.\n\nRequest dates use a space separator; response dates come back in ISO form with a T.",
        "tags": [
          "Reports"
        ],
        "parameters": [],
        "security": [
          {
            "apiToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "default": {
                    "summary": "Count joiners",
                    "value": {
                      "success": true,
                      "res": true,
                      "result": {
                        "ResultID": 200,
                        "ResultMessage": "Passed OK",
                        "Tin": ""
                      },
                      "SendmsgJoinersDate": [
                        {
                          "From": "2023-07-22T18:03:33",
                          "Sum": 2,
                          "Until": "2023-08-11T18:03:33"
                        },
                        {
                          "From": "2023-07-02T18:03:34",
                          "Sum": 1,
                          "Until": "2023-07-22T18:03:34"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "examples": {
                "default": {
                  "summary": "Count joiners",
                  "value": [
                    {
                      "From": "2023-07-22 18:03:33",
                      "Until": "2023-08-11 18:03:33"
                    },
                    {
                      "From": "2023-07-02 18:03:34",
                      "Until": "2023-07-22 18:03:34"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}