Skip to content
Navigation

Update a contact

Updates a contact. Takes the same body as Create a contact; number is required.

PUT
https://app.messageport.com.au/api/v2/contacts/{contact}

Authorization

  • basicAuth
    HTTP
    required

Path parameters

  • contact
    integer
    required

    Contact ID.

Request body JSON required

  • number
    string
    required

    Mobile number, ideally in E.164 format.

    maxLength: 20 · minLength: 5
  • firstname
    optional
    string
  • surname
    optional
    string
  • email
    optional
    string
    format: email
  • group
    optional
    string

    Add the contact to the group with this name. The group is created if it does not exist.

  • groups
    optional
    array of
    integer

    IDs of groups to add the contact to.

  • update_if_exists
    optional
    boolean

    Create only. If a contact with this number exists, update it instead of creating a new one.

  • metadata
    optional
    object

    Custom fields. These must be configured on your account first.

  • global
    optional
    boolean

    Save as a global contact shared across the account. Requires an account admin.

Returns

200

The updated contact.

JSON
  • data
    optional
    object
    • id
      optional
      integer
    • user
      optional
      integer

      ID of the user that owns the contact.

    • account
      optional
      integer

      Account ID. Only present on global contacts.

    • firstname
      optional
      string | null
    • surname
      optional
      string | null
    • email
      optional
      string | null
    • number
      optional
      string
    • metadata
      optional
      object | null
    • groups
      optional
      array of
      object
      • id
        optional
        integer
      • name
        optional
        string
    • notes
      optional
      array of
      object

      Notes on the contact. Only returned when getting or updating a single contact.

      • id
        optional
        integer
      • content
        optional
        string
      • created_at
        optional
        string
        format: date-time
      • updated_at
        optional
        string
        format: date-time
    • updated
      optional
      string
      format: date-time
    • created
      optional
      string
      format: date-time

401

Missing, malformed or invalid API credentials.
JSON
  • message
    string
    required

403

The resource exists but does not belong to you, or you lack permission.
JSON
  • message
    string
    required

404

The resource does not exist.
JSON
  • message
    string
    required

422

The request failed validation. errors lists the messages for each invalid field.
JSON
  • message
    optional
    string
  • errors
    optional
    map of
    array<string>

Type to search…

↑↓ navigate↵ selectEsc close