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

# Edit an audience

> Rewrites an active audience from a description of what should change.



## OpenAPI

````yaml /api/openapi.yaml patch /products/{product_id}/audiences/{audience_id}
openapi: 3.1.0
info:
  title: LocalAds API
  version: 1.0.0
  description: Public API for LocalAds customer integrations.
servers:
  - url: https://makelocalads.com/api/v1
security:
  - apiKey: []
paths:
  /products/{product_id}/audiences/{audience_id}:
    parameters:
      - $ref: '#/components/parameters/ProductId'
      - $ref: '#/components/parameters/AudienceId'
    patch:
      summary: Edit an audience
      description: Rewrites an active audience from a description of what should change.
      operationId: updateProductAudience
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudienceDescription'
            example:
              description: Focus on first-time parents in small apartments.
      responses:
        '200':
          description: The updated audience.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Audience'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    ProductId:
      name: product_id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    AudienceId:
      name: audience_id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    AudienceDescription:
      type: object
      additionalProperties: false
      required:
        - description
      properties:
        description:
          type: string
          minLength: 3
          maxLength: 2000
          description: Who the audience is, in your words.
    Audience:
      type: object
      description: A saved audience. Its `id` is what `audience_id` takes.
      required:
        - id
        - name
        - demographic
        - motivation
        - created_at
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        demographic:
          type:
            - string
            - 'null'
        motivation:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - detail
        - code
        - request_id
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        code:
          type: string
        request_id:
          type: string
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Forbidden:
      description: >-
        The API key lacks the required permission (`insufficient_permission`),
        the organization's plan does not include API access
        (`plan_upgrade_required`; Pro and Enterprise only), or the organization
        is suspended (`org_suspended`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    NotFound:
      description: Resource not found.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Unprocessable:
      description: >-
        A product rule, plan limit, or credit limit blocked the request: not
        enough credits (`insufficient_credits`), an API key's monthly credit
        budget (`key_budget_exceeded`), a request costing more than its
        `max_credits` (`credit_limit_exceeded`), a plan without the feature
        (`plan_required`), or a rule the app enforces too (`request_rejected`,
        with the reason in `detail`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    RateLimited:
      description: API key rate limit exceeded.
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: lads_...

````