Update Audience
URL
To update an existing audience segment, use /audience/:id
.
PATCH - https://{{nmpUrl}}/audience/:id
Body
Field | Type | Required | Description |
---|---|---|---|
name | String | ✅ | Name of the audience for your campaign. |
tagRule | Object | ✅ | Tag 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. |
tags | Array | ✅ | Tag(s) associated with the digital passports youwish tot target. |
uniqueOwner | Boolean | ✅ | true : One message is sent per wallet even if your customer owns several digital passports. |
custodialWallet | String | ❌ | Custodial or non-custodial wallet.yes : Send to custodial wallet only.no : Send to non-custodial wallet only.all : Both types of wallet. |
isWalletActiveSinceNumberOfDays | Number | ❌ | A period in days during which activity was observed on the user's wallet. |
countries | Array | ❌ | Define 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 Code | Success | Description |
---|---|---|
200 | true | The 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 Code | Success | Description |
---|---|---|
404 | false | The ID may be wrong or the audience does not exist. |
400 | false | The audience format is incorrect. |
{
"error": "audience not found"
}
{
"errors": [
{
"value": "660ffa248b242638ac6ccac3za",
"msg": "audienceId must be a mongoId",
"param": "audienceId",
"location": "params"
}
]
}
Updated about 2 months ago