> ## Documentation Index
> Fetch the complete documentation index at: https://help.commbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create New Audiences

> This API creates a new Audience and returns an Audience ID.

Request uses multipart/form-data and includes a CSV or Excel file uploaded from your local machine.
The file must include a column named `phone1` with full country-code phone numbers (e.g., 442079832100).

#### Body Parameters (multipart/form-data)
- `name` **(required)**: The name for the new audience (Example: name=NE_USA-above50)
- `audience_file` **(required)**: A CSV or Excel file with customers data. Use `@` followed by the local file path (Example: audience_file=@/Users/john/downloads/audience.csv)



## OpenAPI

````json POST /audiences
{
  "openapi": "3.0.3",
  "info": {
    "title": "CommBox API",
    "x-logo": {
      "url": "https://www.commbox.io/logo/commbox_logo_large.png"
    },
    "version": "2.07",
    "termsOfService": "https://www.commbox.io/end-user-license-agreement-eula/",
    "contact": {
      "name": "commbox",
      "url": "https://www.commbox.io",
      "email": "contactus@commbox.io"
    }
  },
  "servers": [
    {
      "url": "https://api.commbox.io/",
      "description": "Production server"
    }
  ],
  "paths": {
    "/audiences": {
      "post": {
        "tags": [
          "Audiences"
        ],
        "summary": "Create New Audiences",
        "description": "This API creates a new Audience and returns an Audience ID.\n\nRequest uses multipart/form-data and includes a CSV or Excel file uploaded from your local machine.\nThe file must include a column named `phone1` with full country-code phone numbers (e.g., 442079832100).\n\n#### Body Parameters (multipart/form-data)\n- `name` **(required)**: The name for the new audience (Example: name=NE_USA-above50)\n- `audience_file` **(required)**: A CSV or Excel file with customers data. Use `@` followed by the local file path (Example: audience_file=@/Users/john/downloads/audience.csv)\n\n",
        "operationId": "Post_Audiences",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "audience_file"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name for the new audience",
                    "example": "name=NE_USA-above50"
                  },
                  "audience_file": {
                    "type": "string",
                    "format": "binary",
                    "description": "URL of the CSV or Excel file with customers' data",
                    "example": "audience_file=@/path/to/audience.csv"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Audience created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 201
                    },
                    "description": {
                      "type": "string",
                      "example": "Audience created"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The new Audience ID",
                          "example": "312345"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Missing required fields, invalid file format, or missing phone1 column",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 400
                    },
                    "description": {
                      "type": "string",
                      "example": "Bad Request"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  },
                  "required": [
                    "status",
                    "description"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing Bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 401
                    },
                    "description": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  },
                  "required": [
                    "status",
                    "description"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Too many requests have been made in a short period of time (Throttling)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 429
                    },
                    "description": {
                      "type": "string",
                      "example": "Too Many Requests – Rate limit exceeded"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  },
                  "required": [
                    "status",
                    "description"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 500
                    },
                    "description": {
                      "type": "string",
                      "example": "Server Error"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  },
                  "required": [
                    "status",
                    "description"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
````

