title: Can I use the Slack API to set the profile picture?
body: <p>I am running a Slack team for a gaming community. My users all have avatars in the game and I am already using the Slack API to automatically set their Slack user name to their in-game name, so its easier for people to be recognized.</p>
  
  <p>In addition I would also like to automatically set their profile picture in Slack with their avatar picture from the game. However I could not figure out a way to do it, so my question is can it be done and if yes, how?</p>
  
  <p>My current starting point is the undocumented API method <code>users.profile.set</code> which allows me to set the profile of a user (see below for an example of a user profile). So far I've been able to modify:</p>
  
  <ul>
  <li>first_name</li>
  <li>last_name</li>
  <li>title</li>
  <li>phone</li>
  <li>skype</li>
  </ul>
  
  <p>The user profile also contains the URL to the profile picture, but I was so far not able to change it. I tried external URLs, and URLs of images already uploaded on Slack.</p>
  
  <p>Here is a <a href="https://github.com/ErikKalkoken/slackApiDoc/blob/master/users.profile.set.md" rel="noreferrer">link</a> to my documentation of the "undocumented" Slack API method <code>users.profile.set</code> with all options that I could figure out so far.</p>
  
  <p>Any help would be hugely appreciated.</p>
  
  <hr>
  
  <p><strong>Update November 2017</strong></p>
  
  <p>In the meantime Slack has added a new API method called <a href="https://api.slack.com/methods/users.setPhoto" rel="noreferrer"><code>users.setPhoto</code></a> for setting profile photos. However, this new method does not solve this question, because it only works for your own user (or more precisely the user you have an access token for, e.g. you not specify another <code>user ID</code>).</p>
  
  <p>I am looking for a way to change the profile pictures of all users on my Slack team by a Slack app / bot.</p>
  
  <hr>
  
  <p>Example of a user profile:</p>
  
  <pre><code>{
  id: "U12345678",
  team_id: "T12345678",
  name: "erik.kalkoken",
  deleted: false,
  status: null,
  color: "9f69e7",
  real_name: "Erik Kalkoken",
  tz: "America/Chicago",
  tz_label: "Central Daylight Time",
  tz_offset: 3600,
  profile: {
  avatar_hash: "XXX",
  first_name: "Erik",
  last_name: "Kalkoken",
  title: "",
  phone: "",
  skype: "",
  image_24: "https://avatars.slack-edge.com/2016-03-19/XXX_24.jpg",
  image_32: "https://avatars.slack-edge.com/2016-03-19/XXX_32.jpg",
  image_48: "https://avatars.slack-edge.com/2016-03-19/XXX_48.jpg",
  image_72: "https://avatars.slack-edge.com/2016-03-19/XXX_72.jpg",
  image_192: "https://avatars.slack-edge.com/2016-03-19/XXX_192.jpg",
  image_512: "https://avatars.slack-edge.com/2016-03-19/XXX_512.jpg",
  image_1024: "https://avatars.slack-edge.com/2016-03-19/XXX_512.jpg",
  image_original: "https://avatars.slack-edge.com/2016-03-19/XXX_original.jpg",
  real_name: "Erik Kalkoken",
  real_name_normalized: "Erik Kalkoken",
  email: "test@email.com"
  },
  is_admin: false,
  is_owner: false,
  is_primary_owner: false,
  is_restricted: false,
  is_ultra_restricted: false,
  is_bot: false,
  has_2fa: false
  }
  </code></pre>