Skip to the page

Add contact

Adds one person to the workspace, and to the audiences you name. They are subscribed unless you say otherwise. An address that is already a contact is refused: add that contact to an audience instead.

opensend contacts create [flags]
Needs the scopeaudiences:write
Changes data

Flags

  • --emailstringRequired

    The address of the contact. A workspace holds an address once. Up to 120 characters.

  • --first-namestring

    The first name, used for {{first_name}} in broadcasts. Up to 120 characters.

  • --last-namestring

    The last name, used for {{last_name}} in broadcasts. Up to 120 characters.

  • --statusstring

    subscribed or unsubscribed. Without it the contact is subscribed.

    One ofsubscribedunsubscribed

  • --propertiesRecord<string, string | number | boolean>

    Values of your own, by name, such as { "plan": "pro" }: text, numbers and true or false. Up to 50. Default: {}.

  • --audience-idsstring[]

    The ids of the audiences to put the contact in. Without it, in none. Up to 50 items. Default: [].

  • --topicsRecord<string, string>

    What the contact chose for a topic, by the id of the topic: opt_in or opt_out. A topic left out follows its own default. Default: {}.

Returns

The command prints the answer: as JSON when its output goes to a file or another program, and as a table or a list of fields in a terminal. When the API refuses, the error goes to the error stream and the command ends with a code that names the failure. Output and scripts lists the codes.

  • 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.