# Update user

You can update a specific user. You can also set up any custom attribute of your choice. Custom attributes have to be created in the User.com app before sending them within requests.

PUT /users/:id/

Attributes Type Required Description
custom_id string no The unique identifier for the user which is provided by the client.
id integer no A unique identifier for the user which is given by User.com automatically.
company_custom_id string no A unique identifier for the company which is provided by the client.
custom_attr string no An example value of your custom attribute.
email string no A user email address.
first_name string no A first name for a user (the maximum number of characters is 40).
last_name string no A last name for a user (the maximum number of characters is 40).
tags list(strings) no A list of tag names.

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
 curl -X PUT -H "Authorization: Token <your_64_char_api_key>"
     -H "Accept: */*; version=2" -H "Content-Type: application/json" -d '{
  "email": "john@example.org",
  "gravatar_url": "https://randomuser.me/api/portraits/men/51.jpg",
  "tags": ["updated", "verified"]
}' "https://<your_app_subdomain>.user.com/api/public/users/:id/"

# Response

{
  "chat_id": "Chat ID is deprecated and will be removed in future",
  "twitter_url": null,
  "last_contacted": null,
  "timezone": null,
  "updated_at": "2017-06-14T07:29:06.976662Z",
  "companies": [
    {
      "id": 14,
      "name": "Company name",
      "member_since": "2018-06-14T08:49:56.515083Z"
    }
  ],
  "google_url": null,
  "lists": [],
  "status": "visitor",
  "resolution": null,
  "phone_number": null,
  "gravatar_url": "https://randomuser.me/api/portraits/men/51.jpg",
  "os_type": null,
  "facebook_url": null,
  "name": "Jane Doe",
  "page_views": 0,
  "tags": [
    {
      "name": "tag",
      "id": 1441
    }
  ],
  "linkedin_url": null,
  "browser": null,
  "last_seen": "2017-06-14T11:06:08.182761Z",
  "id": 19678376,
  "first_seen": null,
  "last_ip": null,
  "score": 0,
  "unsubscribed": false,
  "region": null,
  "attributes": [
    {
      "value": true,
      "name": "Example attr",
      "name_std": "example_attr",
      "id": 1109
    },
    {
      "value": "attribute value",
      "name": "My string attr",
      "name_std": "my_string_attr",
      "id": 2429
    }
  ],
  "created_at": "2017-06-07T09:41:13.466897Z",
  "gender": "unknown",
  "key": "g3FaYocCy0U6",
  "notifications": true,
  "country": null,
  "email": "updated@email.com",
  "browser_language": null,
  "city": null 
}