Save a contact

POST/api/v1/mailbox/address-book/contacts
Requires amailbox token— it acts as one mailbox holder, not as the organization.

Needs at least a name, an address or a number.

Errors

Status When
401 No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login.
403 The account has a temporary password: until POST /security/password succeeds, every other call answers this with error_code: password_change_required.
400 Give the contact a name, an address or a number.
409 That address book cannot be written to.

Parameters

NameInTypeDescription
bookquerystring

Request body

  • full_namestring or null

    The name to show.

  • first_namestring or null

    Given name.

  • last_namestring or null

    Family name.

  • emailsarray<object>

    Addresses: each an address and optional type (work, home).

    • addressstringrequired
    • typestring or null
  • phonesarray<object>

    Numbers: each a number and optional type.

    • numberstringrequired
    • typestring or null
  • organizationstring or null

    Company.

  • titlestring or null

    Job title.

  • addressstring or null

    Postal address.

  • notestring or null

    Notes.

  • birthdaystring or null

    YYYY-MM-DD.

Request

POST/api/v1/mailbox/address-book/contacts
curl -X POST 'https://courier.mailyte.com/api/v1/mailbox/address-book/contacts' \
  -H 'Authorization: Bearer MAILBOX_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "full_name": "Tunde Bello",
    "emails": [
      {
        "address": "tunde@example.com",
        "type": "work"
      }
    ],
    "phones": [
      {
        "number": "+234 803 000 0000",
        "type": "mobile"
      }
    ],
    "organization": "Example Ltd"
  }'

Response

Success.

  • dataobject
    • idstring
    • etagstring
200application/json
{
  "type": "success",
  "msg": "Contact saved successfully",
  "data": {
    "id": "5d41402a.vcf",
    "etag": "\"c0ffee\""
  }
}

Returned inside the standard envelope.

Errors

StatusWhen
400`Give the contact a name, an address or a number`.
401No token, or the session expired or was signed out. Sign in again with `POST /mailbox-auth/login`.
403The account has a temporary password: until `POST /security/password` succeeds, every other call answers this with `error_code: password_change_required`.
409`That address book cannot be written to`.
422Validation Error

Every status, with what causes it and what to do, is on the error reference.