---
updatedAt: 2026-05-27T08:02:52.000Z
agentTools:
  siteIndex: https://developer.eagleeye.com/llms.txt
  projectIndex: https://developer.eagleeye.com/eagleeye-developer/llms.txt
---

# Replace Audience (BETA)

This method allows the calling application to replace the contents of an Audience by Id.

# OpenAPI definition

```json
{
  "x-explorer-enabled": false,
  "openapi": "3.0.3",
  "servers": [
    {
      "url": "https://resources.uk.eagleeye.com",
      "description": "UK Production."
    },
    {
      "url": "https://resources.us.eagleeye.com",
      "description": "US Production."
    },
    {
      "url": "https://resources.us2.eagleeye.com",
      "description": "US2 Production."
    },
    {
      "url": "https://resources.au.eagleeye.com",
      "description": "AU Production."
    },
    {
      "url": "https://resources.sandbox.uk.eagleeye.com",
      "description": "UK Sandbox."
    }
  ],
  "info": {
    "version": "1.67.0",
    "title": "Resource API",
    "description": "# These APIs are used for integration with the Eagle Eye AIR platform when interacting with resources."
  },
  "tags": [
    {
      "name": "Audiences",
      "description": "These APIs are used for managing the Audiences in the AIR platform."
    }
  ],
  "paths": {
    "/audiences/{audienceId}": {
      "put": {
        "tags": [
          "Audiences"
        ],
        "operationId": "putAudiences",
        "summary": "Replace Audience (BETA)",
        "description": "This method allows the calling application to replace the contents of an Audience by Id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/audienceIdParam"
          },
          {
            "$ref": "#/components/parameters/eesAuthenticationClientId"
          },
          {
            "$ref": "#/components/parameters/eesAuthenticationRequestHash"
          },
          {
            "$ref": "#/components/parameters/httpAcceptEncoding"
          },
          {
            "$ref": "#/components/parameters/eesMessageId"
          },
          {
            "$ref": "#/components/parameters/eesMessageRetry"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/postAudiencesPayload"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/audiencesPayload"
          },
          "400": {
            "$ref": "#/components/responses/badRequest"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/notFound"
          },
          "405": {
            "$ref": "#/components/responses/methodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/tooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/serverError"
          },
          "501": {
            "$ref": "#/components/responses/notImplemented"
          },
          "502": {
            "$ref": "#/components/responses/badGateway"
          },
          "503": {
            "$ref": "#/components/responses/serviceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/gatewayTimeout"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "eesAuthenticationClientId": {
        "name": "X-EES-AUTH-CLIENT-ID",
        "in": "header",
        "description": "Client ID, This will be provided by EES and is unique to the company calling the API.",
        "required": true,
        "schema": {
          "type": "string",
          "format": "string"
        }
      },
      "eesAuthenticationRequestHash": {
        "name": "X-EES-AUTH-HASH",
        "in": "header",
        "description": "Request Security Hash, calculated using SHA-256 function from concatenated full Request URI Path with Query String(s), Payload and Client Secret.",
        "required": true,
        "schema": {
          "type": "string",
          "format": "string"
        }
      },
      "eesMessageId": {
        "name": "X-EES-TRANSACTION-ID",
        "in": "header",
        "description": "Unique Reference for the API transaction within the calling company.",
        "required": false,
        "schema": {
          "type": "string",
          "format": "string"
        }
      },
      "eesMessageRetry": {
        "name": "X-EES-RETRY",
        "in": "header",
        "description": "This flag denotes the number of attempts that have been made for this request.",
        "required": false,
        "schema": {
          "type": "string",
          "format": "string"
        }
      },
      "httpAcceptEncoding": {
        "name": "Accept-Encoding",
        "in": "header",
        "required": false,
        "description": "This request HTTP header advertises which content encoding (usually a compression algorithm) the calling application is able to understand. The server selects one of the proposals, use it and informs the client of its choice with the Content-Encoding response header. Currently supported `gzip` and `deflate`, if request header not present no compression will be used.\n",
        "schema": {
          "type": "string",
          "enum": [
            "",
            "gzip",
            "deflate",
            "gzip,deflate"
          ],
          "default": ""
        }
      },
      "audienceIdParam": {
        "name": "audienceId",
        "in": "path",
        "description": "The EES AIR Audience ID.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "504113"
        }
      }
    },
    "requestBodies": {
      "postAudiencesPayload": {
        "description": "JSON payload.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/audiencesEntity"
                },
                {
                  "type": "object"
                },
                {
                  "required": [
                    "name",
                    "reference"
                  ]
                }
              ]
            }
          }
        }
      }
    },
    "schemas": {
      "error400Entity": {
        "type": "object",
        "required": [
          "errorCode",
          "errorMessage"
        ],
        "properties": {
          "errorCode": {
            "type": "string",
            "format": "string",
            "description": "Error Code",
            "example": "ISF",
            "enum": [
              "ICE",
              "IR",
              "ISF",
              "U",
              "ELE"
            ]
          },
          "errorMessage": {
            "type": "string",
            "format": "string",
            "description": "Human Friendly Error Message"
          }
        },
        "x-enum": [
          {
            "errorCode": "ICE",
            "errorMessage": "Internal Configuration Error"
          },
          {
            "errorCode": "IR",
            "errorMessage": "Invalid Request Data"
          },
          {
            "errorCode": "ISF",
            "errorMessage": "Invalid Schema format"
          },
          {
            "errorCode": "U",
            "errorMessage": "Unknown error has occurred"
          },
          {
            "errorCode": "ELE",
            "errorMessage": "Error when loading Monolog logger"
          }
        ]
      },
      "error401Entity": {
        "type": "object",
        "required": [
          "errorCode",
          "errorMessage"
        ],
        "properties": {
          "errorCode": {
            "type": "string",
            "format": "string",
            "description": "Error Code",
            "example": "UN",
            "enum": [
              "UN",
              "CCE",
              "CRN",
              "CUE"
            ]
          },
          "errorMessage": {
            "type": "string",
            "format": "string",
            "description": "Human Friendly Error Message"
          }
        },
        "x-enum": [
          {
            "errorCode": "UN",
            "errorMessage": "Unauthenticated - Check the AUTH headers and the hash is formed correctly"
          },
          {
            "errorCode": "CCE",
            "errorMessage": "Campaign Create Exception"
          },
          {
            "errorCode": "CRN",
            "errorMessage": "Campaign Reference Not Unique"
          },
          {
            "errorCode": "CUE",
            "errorMessage": "Campaign Update Exception"
          }
        ]
      },
      "error403Entity": {
        "type": "object",
        "required": [
          "errorCode",
          "errorMessage"
        ],
        "properties": {
          "errorCode": {
            "type": "string",
            "format": "string",
            "description": "Error Code",
            "example": "P",
            "enum": [
              "P",
              "IPR"
            ]
          },
          "errorMessage": {
            "type": "string",
            "format": "string",
            "description": "Human Friendly Error Message"
          }
        },
        "x-enum": [
          {
            "errorCode": "P",
            "errorMessage": "Caller unit hasn't privileges to access this unit"
          },
          {
            "errorCode": "IPR",
            "errorMessage": "IP Address Rejected"
          }
        ]
      },
      "error404Entity": {
        "type": "object",
        "required": [
          "errorCode",
          "errorMessage"
        ],
        "properties": {
          "errorCode": {
            "type": "string",
            "format": "string",
            "description": "Error Code",
            "example": "CNF",
            "enum": [
              "CNF",
              "ONF"
            ]
          },
          "errorMessage": {
            "type": "string",
            "format": "string",
            "description": "Human Friendly Error Message"
          }
        },
        "x-enum": [
          {
            "errorCode": "CNF",
            "errorMessage": "Campaign Not Found"
          },
          {
            "errorCode": "ONF",
            "errorMessage": "Offers not found"
          }
        ]
      },
      "error405Entity": {
        "type": "object",
        "required": [
          "errorCode",
          "errorMessage"
        ],
        "properties": {
          "errorCode": {
            "type": "string",
            "format": "string",
            "description": "Error Code",
            "example": "MNA",
            "enum": [
              "MNA"
            ]
          },
          "errorMessage": {
            "type": "string",
            "format": "string",
            "description": "Human Friendly Error Message"
          }
        },
        "x-enum": [
          {
            "errorCode": "MNA",
            "errorMessage": "Method not allowed"
          }
        ]
      },
      "defaultErrorEntity": {
        "type": "object",
        "required": [
          "errorCode",
          "errorMessage"
        ],
        "properties": {
          "errorCode": {
            "type": "string",
            "format": "string",
            "description": "EES AIR Error Code",
            "example": "MPA",
            "enum": [
              "NF",
              "IR",
              "U",
              "AF",
              "CE",
              "IPR",
              "MNA",
              "MPA",
              "P",
              "AA",
              "IP",
              "IH",
              "RF"
            ]
          },
          "errorMessage": {
            "type": "string",
            "format": "string",
            "description": "Human Friendly Error Message",
            "example": "Missing Mandatory Request Parameter: `parameterName`"
          },
          "details": {
            "type": "object",
            "description": "This optional object might contain an additional details regarding this error"
          }
        },
        "x-enum": [
          {
            "errorCode": "NF",
            "errorMessage": "Not Found"
          },
          {
            "errorCode": "IR",
            "errorMessage": "Invalid Request"
          },
          {
            "errorCode": "U",
            "errorMessage": "Unknown Error"
          },
          {
            "errorCode": "AF",
            "errorMessage": "Authorisation Failed"
          },
          {
            "errorCode": "CE",
            "errorMessage": "Configuration Error"
          },
          {
            "errorCode": "IPR",
            "errorMessage": "IP Address Rejected"
          },
          {
            "errorCode": "MNA",
            "errorMessage": "Method Not Allowed"
          },
          {
            "errorCode": "MPA",
            "errorMessage": "Missing Parameter"
          },
          {
            "errorCode": "P",
            "errorMessage": "Privileges"
          },
          {
            "errorCode": "AA",
            "errorMessage": "Invalid Access to API Method"
          },
          {
            "errorCode": "IP",
            "errorMessage": "Invalid Parameter"
          },
          {
            "errorCode": "IH",
            "errorMessage": "Invalid Header set"
          },
          {
            "errorCode": "RF",
            "errorMessage": "Rollback Failure"
          }
        ]
      },
      "audiencesEntity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the Audience automatically generated and unique within Eagle Eye AIR.",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "description": "The name of the Audience.",
            "nullable": false
          },
          "reference": {
            "type": "string",
            "description": "The reference of the Audience.",
            "nullable": false
          },
          "dateCreated": {
            "type": "string",
            "format": "date-time",
            "description": "The date-time when the Audience was added to the AIR platform.",
            "readOnly": true
          },
          "lastUpdated": {
            "type": "string",
            "format": "date-time",
            "description": "The date-time when the Audience was last updated on in the AIR platform.",
            "readOnly": true
          },
          "startDate": {
            "type": "string",
            "format": "date-time",
            "description": "The start date of the Audience.",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "format": "date-time",
            "description": "The end date of the Audience.",
            "nullable": true
          }
        }
      }
    },
    "responses": {
      "badRequest": {
        "description": "Bad Request.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/error400Entity"
                }
              ],
              "example": {
                "errorCode": "IR",
                "errorMessage": "Invalid Request Data"
              }
            }
          }
        }
      },
      "unauthorized": {
        "description": "Unauthorized.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/error401Entity"
                }
              ],
              "example": {
                "errorCode": "UN",
                "errorMessage": "Unauthenticated - Check the AUTH headers and the hash is formed correctly"
              }
            }
          }
        }
      },
      "forbidden": {
        "description": "Forbidden.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/error403Entity"
                }
              ],
              "example": {
                "errorCode": "P",
                "errorMessage": "Caller unit hasn't privileges to access this unit"
              }
            }
          }
        }
      },
      "notFound": {
        "description": "Not Found.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/error404Entity"
                }
              ],
              "example": {
                "errorCode": "CNF",
                "errorMessage": "Campaign Not Found"
              }
            }
          }
        }
      },
      "methodNotAllowed": {
        "description": "Method Not Allowed.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/error405Entity"
                }
              ],
              "example": {
                "errorCode": "MNA",
                "errorMessage": "Method not allowed"
              }
            }
          }
        }
      },
      "tooManyRequests": {
        "description": "Too Many Requests",
        "headers": {
          "Retry-after": {
            "description": "The number of seconds after which to retry the request",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "errorCode": {
                  "type": "string",
                  "description": "The error code",
                  "enum": [
                    "CE"
                  ]
                },
                "errorMessage": {
                  "type": "string",
                  "description": "The error message for this error",
                  "enum": [
                    "This request has been throttled. Please try again later."
                  ]
                }
              }
            }
          }
        }
      },
      "serverError": {
        "description": "Server Error",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/defaultErrorEntity"
                }
              ],
              "example": {
                "errorMessage": "Internal Server Error"
              }
            }
          }
        }
      },
      "notImplemented": {
        "description": "Not Implemented",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/defaultErrorEntity"
                }
              ],
              "example": {
                "errorMessage": "Not Implemented"
              }
            }
          }
        }
      },
      "badGateway": {
        "description": "Bad Gateway",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/defaultErrorEntity"
                }
              ],
              "example": {
                "errorMessage": "Bad Gateway"
              }
            }
          }
        }
      },
      "serviceUnavailable": {
        "description": "Service Unavailable",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/defaultErrorEntity"
                }
              ],
              "example": {
                "errorMessage": "Service Unavailable"
              }
            }
          }
        }
      },
      "gatewayTimeout": {
        "description": "Gateway Timeout",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/defaultErrorEntity"
                }
              ],
              "example": {
                "errorMessage": "Gateway Timeout"
              }
            }
          }
        }
      },
      "audiencesPayload": {
        "description": "The response of a successful Audiences request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/audiencesEntity"
            }
          }
        }
      }
    }
  }
}
```