Skip to the page

Remove contact from audience

Takes a contact out of one audience. The contact stays in the workspace and in their other audiences.

opensend.audiences.leave(id, input)
Needs the scopeaudiences:writeFrom a terminalopensend audiences leave

Input

id goes first, on its own, and the rest in one object. One object that holds id works too.

  • idstringRequired

    The id of the audience. Up to 64 characters.

  • contactstringRequired

    The id of the contact, or their address. Up to 120 characters.

Returns

The call resolves to the answer, already parsed. A call the API refuses throws OpenSendError with the code and the message of the answer. SDK lists the errors of the client itself.

  • object"contact"

    Always contact.

  • idstring

    The id of the contact.

  • emailstring

    The address of the contact. A workspace holds an address once.

  • firstNamestring

    The first name of the contact. Empty when it is not known.

  • lastNamestring

    The last name of the contact. Empty when it is not known.

  • statusstring

    subscribed while the contact gets broadcasts, unsubscribed after they leave.

    One ofsubscribedunsubscribed

  • unsubscribedAtstring | null

    When the contact unsubscribed, or null.

  • propertiesRecord<string, string | number | boolean>

    Values of your own on the contact, by name. Automations can test them, and broadcasts and automations fill {{name}} slots with them.

  • audienceIdsstring[]

    The ids of the audiences the contact is in.

  • topicsRecord<string, string>

    What the contact chose for a topic, by the id of the topic: opt_in or opt_out. A topic that is not here follows its own default.

  • createdAtstring

    When the contact was added.