Update a contact

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

Replaces the contact. Send the etag you read as a query parameter so a change made elsewhere is not lost.

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 No name, address or number.
412 This contact changed elsewhere. Reopen it and try again.

Parameters

NameInTypeDescription
card_idrequiredpathstring
etagquerystring
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

PUT/api/v1/mailbox/address-book/contacts/{card_id}
curl -X PUT 'https://courier.mailyte.com/api/v1/mailbox/address-book/contacts/01JBT8XQ2M9WYC3K4F6R7S8T9V' \
  -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

Successful Response

  • dataobject
    • idstring
    • etagstring

      The new etag.

200application/json
{
  "type": "success",
  "msg": "Contact saved successfully",
  "data": {
    "id": "5d41402a.vcf",
    "etag": "\"beef01\""
  }
}

Returned inside the standard envelope.

Errors

StatusWhen
400No name, address or 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`.
412`This contact changed elsewhere. Reopen it and try again.`
422Validation Error

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