Adds an existing contact to a manual audience.
Authorization
authorization AuthorizationBearer <token>
In: header
Path Parameters
audience_id*string
The audience ID to add the contact to.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
id*string
The ID of the contact to add. The contact must belong to the same account as the audience.
Response Body
application/json
application/json
import Surge from '@surgeapi/node';
const client = new Surge({
apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
});
const contact = await client.audiences.addContact('aud_01j9a43avnfqzbjfch6pygv1td', {
id: 'ctc_01j9dy8mdzfn3r0e8x1tbdrdrf',
});
console.log(contact.id);{
"email": "dom@toretto.family",
"first_name": "Dominic",
"id": "ctc_01j9dy8mdzfn3r0e8x1tbdrdrf",
"last_name": "Toretto",
"metadata": {
"car": "1970 Dodge Charger R/T"
},
"phone_number": "+18015551234"
}{
"error": {
"message": "The requested resource could not be found.",
"type": "not_found"
}
}