> ## 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.

# Rename an audience or change who it selects

> Changes an audience's `name`, its `conditions`, or both, keeping what is not sent, as the app's audience page saves it. A campaign using it sends to the new selection from its next run, so new `conditions` on an audience a published campaign uses also need `campaigns:publish` (a 403 names the campaigns); a rename does not. Returns the audience with how many contacts it selects now. 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.



## OpenAPI

````yaml /api/statisfy-api.openapi.json patch /v1/campaigns/audiences/{audience_id}
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/{audience_id}:
    patch:
      tags:
        - campaigns
      summary: Rename an audience or change who it selects
      description: >-
        Changes an audience's `name`, its `conditions`, or both, keeping what is
        not sent, as the app's audience page saves it. A campaign using it sends
        to the new selection from its next run, so new `conditions` on an
        audience a published campaign uses also need `campaigns:publish` (a 403
        names the campaigns); a rename does not. Returns the audience with how
        many contacts it selects now. 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.
      operationId: campaigns_update_audience
      parameters:
        - description: The audience's id, from GET /v1/campaigns/audiences
          in: path
          name: audience_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                conditions:
                  anyOf:
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  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. Left out: kept
                  title: Conditions
                name:
                  anyOf:
                    - maxLength: 255
                      minLength: 1
                      type: string
                    - type: 'null'
                  default: null
                  description: 'A new name. Left out: kept'
                  title: Name
              type: object
        required: false
      responses:
        '200':
          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.