Update Audience

URL

To update an existing audience segment, use /audience/:id.

PATCH - https://{{nmpUrl}}/audience/:id

Body

FieldTypeRequiredDescription
nameStringName of the audience for your campaign.
tagRuleObjectTag rules that define if your audience must own all mentioned tags or at least one.
or: The owner must have a digital passport with at least one defined tag.
and: The owner must have a digital passport that includes all specified tags.
tagsArrayTag(s) associated with the digital passports youwish tot target.
uniqueOwnerBooleantrue: One message is sent per wallet even if your customer owns several digital passports.
custodialWalletStringCustodial or non-custodial wallet.
yes: Send to custodial wallet only.
no: Send to non-custodial wallet only.
all: Both types of wallet.
isWalletActiveSinceNumberOfDaysNumberA period in days during which activity was observed on the user's wallet.
countriesArrayDefine the target country.
String with values separated by a pipe
Example: France|Spain...
⚠️ Countries are case-sensitive.
{
    "name": "Brand A Campaign",
    "tagRule": "all",
    "uniqueOwner": true
}

Return Payload

Status CodeSuccessDescription
200trueThe audience has been updated.
{
    "_id": "660ffa248b242638ac6ccac5",
    "name": "Audience test",
    "tagRule": "all",
    "uniqueOwner": true,
    "createdAt": "2024-04-05T13:18:28.777Z",
    "updatedAt": "2024-04-05T13:27:52.838Z",
    "__v": 0
}

Errors

Status CodeSuccessDescription
404falseThe ID may be wrong or the audience does not exist.
400falseThe audience format is incorrect.
{
    "error": "audience not found"
}
{
    "errors": [
        {
            "value": "660ffa248b242638ac6ccac3za",
            "msg": "audienceId must be a mongoId",
            "param": "audienceId",
            "location": "params"
        }
    ]
}