People

This API allows you to access and update persons. See examples below.


GET /people/<person_slug>

Returns a person.

Parameter Description
site_slug Your Talkable Site ID. You can get this from your Talkable dashboard after you log in and create a site.
person_slug Person’s email or username


PUT /people/<person_slug>

Updates an existing person or creates one if it does not exist.

Parameter Description
site_slug Your Talkable Site ID. You can get this from your Talkable dashboard after you log in and create a site.
person_slug Person’s email
data

JSON object with one or more of following properties:

  • first_name
  • last_name
  • username
  • customer_id
  • person_custom_properties


POST /people/<person_slug>/unsubscribe

Unsubscribes a person from receiving emails.

Parameter Description
site_slug Your Talkable Site ID. You can get this from your Talkable dashboard after you log in and create a site.
person_slug Person’s email


POST /people/<person_slug>/anonymize

Anonymizes a person.

Parameter Description
site_slug Your Talkable Site ID. You can get this from your Talkable dashboard after you log in and create a site.
person_slug Person’s email


GET /people/<person_slug>/personal_data

Returns personal data.

Parameter Description
site_slug Your Talkable Site ID. You can get this from your Talkable dashboard after you log in and create a site.
person_slug Person’s email

Example

Find a person by email

GET https://www.talkable.com/api/v2/people/customer@example.com?site_slug=my-store

Sample response:

{
  "ok": true,
  "result": {
    "person": {
      "personal_claim_url": "http://share.mystore.com/by/customer@example.com",
      "events_count": 0,
      "first_name": "John",
      "last_name": "Smith",
      "email": "customer@example.com",
      "username": null,
      "subscribed_at": null,
      "unsubscribed_at": null,
      "sub_choice": false,
      "customer_id": "1"
    }
  }
}

Update person’s username

{
  "site_slug": "my-store",
  "data": {
    "username": "lizard_king"
  }
}
curl -H "Content-Type: application/json" \
     -X PUT \
     -u i9uil7nQgDjucCiTJu: \
     -d '{"site_slug":"my-store","data":{"username":"lizard_king"}}' \
     https://www.talkable.com/api/v2/people/customer@example.com

Sample response:

{
  "ok": true,
  "result": {
    "person": {
      "personal_claim_url": "http://share.mystore.com/by/lizard_king",
      "events_count": 0,
      "first_name": "John",
      "last_name": "Smith",
      "email": "customer@example.com",
      "username": "lizard_king",
      "subscribed_at": null,
      "unsubscribed_at": null,
      "sub_choice": false,
      "customer_id": "1"
    }
  }
}

Unsubscribe a person from receiving emails

{
  "site_slug": "my-store"
}
curl -H "Content-Type: application/json" \
     -X POST \
     -u i9uil7nQgDjucCiTJu: \
     -d '{"site_slug":"my-store"}' \
     https://www.talkable.com/api/v2/people/customer@example.com/unsubscribe

Sample response:

{
  "ok": true,
  "result": {
    "person": {
      "personal_claim_url": "http://share.mystore.com/by/customer@example.com",
      "events_count": 0,
      "first_name": "John",
      "last_name": "Smith",
      "email": "customer@example.com",
      "username": null,
      "subscribed_at": null,
      "unsubscribed_at": "2014-11-18T05:49:54.000-07:00",
      "sub_choice": false,
      "customer_id": "1"
    }
  }
}

Anonymize a person

{
  "site_slug": "my-store"
}
curl -H "Content-Type: application/json" \
     -X POST \
     -u i9uil7nQgDjucCiTJu: \
     -d '{"site_slug":"my-store"}' \
     https://www.talkable.com/api/v2/people/customer@example.com/anonymize

Sample response:

{
  "ok": true,
  "result": {
    "person": {
      "personal_claim_url": null,
      "events_count": 0,
      "first_name": null,
      "last_name": null,
      "email": "b19b4a80-3bb2-48f2-831a-6e180b4c6a7e@anonymized.email",
      "username": null,
      "subscribed_at": null,
      "unsubscribed_at": null,
      "sub_choice": false,
      "customer_id": null
    }
  }
}

Get personal information about a person

GET https://www.talkable.com/api/v2/people/customer@example.com/personal_data?site_slug=my-store

Sample response:

{
  "ok": true,
  "result": {
    "person": {
      "created_at": "2018-04-30T02:14:35.000-07:00",
      "customer_id": null,
      "email": "customer@example.com",
      "first_name": null,
      "last_name": null,
      "opted_in_at": null,
      "unsubscribed_at": null,
      "username": null,
      "origins": [
        {
          "type": "AffiliateMember",
          "created_at": "2018-04-30T02:14:35.000-07:00",
          "ip_address": "1.2.3.4",
          "order_number": "customer@example.com",
          "subtotal": 0.0
        }
      ]
    }
  }
}