Contacts

Opt a contact in

POST/contacts/{phone}/opt-inScope contacts:write

Sets the contact's consent to opted_in.

An opt-out is final here: a contact who opted out cannot be opted back in over the API. They have to opt in again themselves, for example by messaging you.

Path parameters

  • phonestringrequired

    The contact's phone number with country code. Anything other than digits is ignored, so +91 98765 43210 works.

Errors

StatusCodeWhen
400BAD_REQUESTThe contact has opted out.
404NOT_FOUNDNo contact with that number.

Plus the errors any endpoint can return, such as a missing key or scope. See Errors.

# macOS, Linux or Git Bash, with WAMAFY_API_KEY set. The quoting does not work in Windows cmd or PowerShell.
curl -X POST "https://api.wamafy.com/api/v1/public/contacts/919876543210/opt-in" \
  -H "Authorization: Bearer $WAMAFY_API_KEY"
Response 200
{
  "success": true,
  "data": {
    "id": "9d3f6b2a-4e1c-4a8b-9f0d-2c7e5a1b3d64",
    "phone": "919876543210",
    "name": "Priya Sharma",
    "firstName": "Priya",
    "lastName": "Sharma",
    "company": "Acme Retail",
    "language": "en",
    "email": "priya@example.com",
    "tags": [
      "vip"
    ],
    "status": "active",
    "consentStatus": "opted_in",
    "source": "api",
    "customFields": {
      "city": "Mumbai"
    },
    "createdAt": "2026-09-02T08:15:00.000Z",
    "updatedAt": "2026-10-07T10:00:00.000Z"
  }
}

Base URL https://api.wamafy.com/api/v1/public

    Opt a contact in - Wamafy API