unPLUGDevelopers

Members API

Update a member

PATCH/v1/members/{id}

PATCH/v1/members/me

Changes profile fields. Send only the fields you want to change. Fields you leave out stay as they are.

Permissions: {id}: secret key with members:write. me: member token.

Path parameters#

  • idstring (uuid)Required

Request body#

  • first_namestring
  • last_namestring
  • emailstring (email)
  • phonestring
    E.164. Secret key only.
  • phone_verifiedboolean
    Secret key only.
  • birthdaystring (date)
    Set once from the app; a secret key can correct it.
  • metadataobject
FieldSecret keyMember token
first_name, last_nameYesYes
emailYesYes
phone, phone_verifiedYesNo
birthdayYes, any time (to correct it)Once, while it is null
metadataYesYes

The app can't change the phone because the phone is how a guest's register visits find their member. Verify the new number on your server, then send it with the secret key and phone_verified: true. The same phone rules as create apply: a number another linked member has returns 409 phone_in_use.

metadata keys you send are set; keys you leave out stay. The 20-key limit counts the stored keys after the update.

Response fields#

Returns 200 with Member

  • idstring (uuid)
    unPLUG's id for the member. Store it next to your user record.
  • external_idstringNullable
    Your id for the guest, up to 128 characters. null for a guest who has only earned at the register and isn't linked to your login yet.
    Max Length 128
  • statusstring
    active. The member.deleted webhook carries deleted; after that, calls about the member return 410 member_deleted.
    One of active, deleted
  • first_namestringNullable
  • last_namestringNullable
  • emailstring (email)Nullable
    Saved in lowercase.
  • phonestringNullable
    E.164, for example +15125550142.
  • phone_verifiedboolean
    true when you confirmed the guest owns the number, for example with an SMS code. Only verified phones link to existing members.
  • birthdaystring (date)Nullable
    YYYY-MM-DD.
  • points_balanceinteger
    Points the member has now. Never below zero.
  • lifetime_pointsinteger
    All points ever earned, used for tiers. Spending doesn't lower it.
  • id and name of the current tier.
    Show attributesTierRef
    • idstring (uuid)
    • namestring
  • next_tierobjectNullable
    id, name and points_needed (lifetime points still to earn). null at the top tier.
    Show attributesHide attributes
    • idstring (uuid)
    • namestring
    • points_neededinteger
  • communication_preferencesobject
    Marketing consent: email_marketing, sms_marketing, push_marketing. See communication preferences.
    Show attributesHide attributes
    • email_marketingboolean
    • sms_marketingboolean
    • push_marketingboolean
  • metadataobject
    Your own string values. Up to 20 keys, 500 characters each. Don't put personal data here.
  • linked_existingboolean
    Only on create: true when an existing member was linked by verified phone.
  • enrolled_atstring (date-time)
    When the guest joined the program.
  • created_atstring (date-time)
  • updated_atstring (date-time)

Error descriptions#

400Bad request
invalid_param

A field has the wrong format, a member token tried to change phone, or a member token tried to change a birthday that is already set. param names the field.

404Not found
member_not_found

No member with this id.

409Conflict
phone_in_use

Another member with an external_id has this phone.

410Gone
member_deleted

The member was deleted.

Any endpoint can also return the common errors.