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

# Update audience and update audience customers



## OpenAPI

````yaml openapi/audience-v1.json PUT /v1/audiences/{audienceId}
openapi: 3.0.4
info:
  title: Audience.Api
  version: v1
servers:
  - url: https://{host}/audience
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - Bearer: []
paths:
  /v1/audiences/{audienceId}:
    put:
      tags:
        - Audiences
      summary: Update audience and update audience customers
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAudienceService2ServiceRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/UpdateAudienceService2ServiceRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/UpdateAudienceService2ServiceRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/UpsertAudienceResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/UpsertAudienceResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/UpsertAudienceResponse'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/WebServiceError'
            application/json:
              schema:
                $ref: '#/components/schemas/WebServiceError'
            text/json:
              schema:
                $ref: '#/components/schemas/WebServiceError'
components:
  schemas:
    UpdateAudienceService2ServiceRequest:
      required:
        - authorName
        - name
      type: object
      properties:
        name:
          maxLength: 255
          minLength: 0
          type: string
          description: The name of the audience. It should be unique.
        description:
          type: string
          description: Full description of the audience. Optional.
          nullable: true
        destinations:
          type: array
          items:
            type: string
          description: >-
            Collection of destinations the audience is applicable for (can be
            used in)

            It is the list of products which should have access to the audience.
          nullable: true
        state:
          $ref: '#/components/schemas/AudienceState'
        membersToAddUrl:
          type: string
          description: Link on the file which contains the list of the customers to add.
          nullable: true
        membersToAdd:
          type: array
          items:
            type: string
          description: |-
            The list of customers to add to the audience.
            Max length of member identifier is 64 symbols.
          nullable: true
        isPrivate:
          type: boolean
          description: If true - the audience can be used only by the author.
        source:
          maxLength: 255
          minLength: 0
          type: string
          description: >-
            Creation source of the audience (the list is defined in appsettings
            and infrastructure config)
          nullable: true
        metadata:
          type: object
          additionalProperties: {}
          description: Represents dynamic key-value pairs for storing audience properties.
          nullable: true
        membersToRemove:
          type: array
          items:
            type: string
          description: |-
            The list of customers to remove out from the audience.
            Max length of member identifier is 64 symbols.
          nullable: true
        membersReplaceAll:
          type: boolean
          description: |-
            If true - all members will be replaced by the new list of members.
            If MembersToAddUrl is provided - this flag must be `True`.
        authorName:
          maxLength: 64
          minLength: 0
          type: string
          description: Name of the user who updates the audience.
      additionalProperties: false
    UpsertAudienceResponse:
      type: object
      properties:
        audienceId:
          type: string
          nullable: true
        audienceExecutionId:
          type: string
          nullable: true
        audienceName:
          type: string
          nullable: true
      additionalProperties: false
    WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
    AudienceState:
      enum:
        - Draft
        - Published
        - Archived
      type: string
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````