---
agentTools:
  projectIndex: https://searchie.readme.io/llms.txt
---

# Create a new audience

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Searchie API Documentation",
    "description": "Searchie API Documentation",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://app.searchie.io/api/v2",
      "description": "API Server"
    }
  ],
  "paths": {
    "/audience": {
      "post": {
        "tags": [
          "Audience"
        ],
        "summary": "Create a new audience",
        "operationId": "5146039280dd0f5b6bec3bd057393b7b",
        "requestBody": {
          "description": "Audience data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "email"
                ],
                "properties": {
                  "is_create_or_update": {
                    "type": "boolean"
                  },
                  "tracking_id": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "meta": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "hubs": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "notify": {
                    "type": "boolean"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "remove_existing_tags": {
                    "type": "boolean"
                  },
                  "attributes": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "boolean",
                            "date",
                            "text",
                            "number",
                            "option",
                            "multiple"
                          ]
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audience created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AudienceResource"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "description": "Error message",
                      "type": "string"
                    },
                    "errors": {
                      "description": "Validation errors",
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AudienceResource": {
        "title": "Audience Resource",
        "required": [
          "id",
          "hash",
          "team_id",
          "phone",
          "email",
          "name",
          "created_at",
          "updated_at",
          "tags",
          "attributes"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "hash": {
            "type": "string"
          },
          "team_id": {
            "type": "integer"
          },
          "tracking_id": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "meta": {
            "type": "array",
            "items": {}
          },
          "billing_customer_id": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "is_onboard": {
            "type": "integer"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time"
          },
          "photo": {
            "type": "string"
          },
          "media": {
            "type": "array",
            "items": {}
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "attributes": {
            "type": "object"
          },
          "has_photo": {
            "type": "string"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiAuth": {
        "type": "apiKey",
        "description": "Login with email and password to get the authentication token",
        "name": "Authorization",
        "in": "header",
        "x-bearer-format": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "Audience"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 101,
      "1": 130,
      "2": 251,
      "3": 234,
      "4": 150,
      "5": 84,
      "6": 125,
      "7": 0,
      "8": 113,
      "9": 220,
      "10": 23,
      "11": 106
    }
  }
}
```