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

# Create an audience

> Creates an audience (201), as the app's New Audience page does: a `name` and the `conditions` that pick its contacts. The conditions are run first; returns the audience with how many contacts it selects. A name you already use is a 409. Every audience is the workspace's, as in the app. Its owner, an admin, or someone it is shared with for editing changes it; its owner or an admin deletes it. A person's key acts as that person, an org key as the member who created it. Use its id as a campaign's `audience_id`.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/campaigns/audiences
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/campaigns/audiences:
    post:
      tags:
        - campaigns
      summary: Create an audience
      description: >-
        Creates an audience (201), as the app's New Audience page does: a `name`
        and the `conditions` that pick its contacts. The conditions are run
        first; returns the audience with how many contacts it selects. A name
        you already use is a 409. Every audience is the workspace's, as in the
        app. Its owner, an admin, or someone it is shared with for editing
        changes it; its owner or an admin deletes it. A person's key acts as
        that person, an org key as the member who created it. Use its id as a
        campaign's `audience_id`.
      operationId: campaigns_create_audience
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                conditions:
                  additionalProperties: true
                  description: >-
                    Who the audience selects: a filter tree in the app's own
                    format, as GET /v1/views/{view_id} shows an audience's
                    conditions (read one, change it, send it back). A condition
                    names a contact field (or a related account's) with an
                    operator and a value; a group combines conditions with
                    and/or; {} is every contact, as the app's All People
                    audience is. It is checked before it is saved: a tree the
                    app cannot read, a field the object doesn't have, or an
                    empty group is a 422
                  title: Conditions
                  type: object
                name:
                  description: Unique among your audiences
                  maxLength: 255
                  minLength: 1
                  title: Name
                  type: string
              required:
                - name
                - conditions
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudienceDetail'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    AudienceDetail:
      properties:
        conditions:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Who it selects, in the app's own filter format
          title: Conditions
        contacts:
          anyOf:
            - type: integer
            - type: 'null'
          description: How many contacts it selects now; null when it was not counted
          title: Contacts
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
        shared:
          description: Shared with the whole workspace (every audience the app makes is)
          title: Shared
          type: boolean
      required:
        - id
        - name
        - shared
        - conditions
      title: AudienceDetail
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.