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

# Update Workspace Identity Audience



## OpenAPI

````yaml /openapi.json put /v1/environments/{environmentId}/workload-audiences/{audienceId}
openapi: 3.1.0
info:
  title: Replica API
  version: 2.0.0
  description: >-
    The Replica API allows you to programmatically manage cloud workspaces for
    AI agents. Use this API to manage environments (the org-scoped primitive
    workspaces are created from — including variables, files, skills, MCPs, warm
    hooks, start hooks, and warm pools), create and manage replicas, send
    messages, manage chats, stream events, read connected repositories and
    repository sets, and configure automations.
servers:
  - url: https://api.replicas.dev
    description: Production API
security:
  - apiKey: []
tags:
  - name: Workspace Identity
    description: >-
      Public OpenID Connect discovery and signing keys for verifying short-lived
      workspace identity tokens. Audiences are managed per environment under the
      Environments tag.
  - name: Environments
    description: >-
      Manage environments — the primitive that workspaces are created from.
      Variables, files, skills, MCPs, warm-hooks, and warm-pools are all scoped
      to an environment. Every organization has a singleton Global environment
      whose values apply to every workspace. Personal environments are scoped to
      the authenticated user and can be standalone or source-backed by a team
      environment.
  - name: Repository
    description: >-
      Read repositories and repository sets connected to your organization.
      Repositories are the underlying GitHub-connection layer; bind them to an
      environment to use them in workspaces.
  - name: Replica
    description: >-
      Manage replicas (workspaces) for AI agents. Workspace creation with `POST
      /v1/replica` accepts API keys and workspace engine-secret authentication.
      Other Replica operations also accept logged-in user JWTs from first-party
      clients.
  - name: Slack
    description: Attach Slack threads to Replicas workspaces
  - name: Automation
    description: >-
      Create and manage automations that trigger replicas on a schedule or in
      response to events
  - name: Media
    description: >-
      Read workspace media and obtain short-lived download or inline preview
      URLs
paths:
  /v1/environments/{environmentId}/workload-audiences/{audienceId}:
    put:
      tags:
        - Environments
      summary: Update Workspace Identity Audience
      operationId: updateWorkloadAudience
      parameters:
        - name: environmentId
          in: path
          required: true
          description: Environment UUID, or `global`.
          schema:
            type: string
        - name: audienceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkloadAudienceInput'
      responses:
        '200':
          description: Audience updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkloadAudienceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    WorkloadAudienceInput:
      type: object
      properties:
        name:
          type: string
        audience:
          type: string
        enabled:
          type: boolean
        is_default:
          type: boolean
      required:
        - name
        - audience
        - enabled
        - is_default
    WorkloadAudienceResponse:
      type: object
      properties:
        audience:
          $ref: '#/components/schemas/WorkloadAudience'
      required:
        - audience
    WorkloadAudience:
      type: object
      description: A registered audience for workspace identity tokens.
      properties:
        id:
          type: string
          format: uuid
        environment_id:
          type: string
          format: uuid
        name:
          type: string
        audience:
          type: string
          description: >-
            Exact `aud` value minted into tokens and verified by the receiving
            server.
        enabled:
          type: boolean
        is_default:
          type: boolean
          description: >-
            Default audience for REPLICAS_WORKSPACE_TOKEN. When no enabled
            registered audience is marked default, the reserved
            `replicas:workspace` audience is used.
      required:
        - id
        - environment_id
        - name
        - audience
        - enabled
        - is_default
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        details:
          type:
            - string
            - 'null'
          description: Additional error details
        code:
          type: string
          description: Machine-readable error code when available
      required:
        - error
  responses:
    BadRequest:
      description: Bad request - Missing or invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden - The authenticated account cannot access this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        Conflict - Resource already exists or operation conflicts with current
        state
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Obtain your API key from the Replicas dashboard
        under Organization → Settings → API Keys.

````