Skip to content

Contacts

The Contact object represents an individual contact in your Go-Mailer account. The API gives you programmatic access to create and update the contacts in your account.

  • POST /contacts

Synchronize a contact

Creates or updates a contact in your account. If the email address isn't in use yet, a new contact is created; otherwise the existing contact is updated.

POSThttps://api.go-mailer.com/v1/contacts

Request body

Synchronize contact request body
ParameterTypeRequiredDescription
emailstringRequired

The contact's email address.

firstnamestringOptional

The contact's first name.

lastnamestringOptional

The contact's last name.

genderstringOptional

The contact's gender. Allowed values: male | female.

date_of_birthstringOptional

The contact's date of birth, in the format mm-dd-YYYY.

phone_numberstringOptional

The contact's mobile number. If you want to use SMS marketing, include the country code, e.g. +234 123 456 7890.

addressobjectOptional

The contact's home address.

address.streetstringOptional

The street part of the address.

address.statestringOptional

The state part of the address.

address.countrystringOptional

The country code part of the address, e.g. NG.

extra_dataobjectOptional

key => value pairs of custom information you want to store on the contact. Useful for attribution.

Sample request

POST /v1/contacts
const response = await fetch("https://api.go-mailer.com/v1/contacts", {
  method: "POST",
  headers: {
    Authorization: "Bearer <API_KEY>"
  },
  body: JSON.stringify({
    email: "johndoe@example.com",
    firstname: "John",
    lastname: "Doe",
    gender: "male",
    address: {
      country: "USA",
      state: "Oyo",
      street: "Sample street",
    }
  })
});