Upload avatar image with API

So in order to change the avatar via the api you will need to make 2 api requests.

POST {{base_url}}/uploads.json
form-data:
  api_key: {{api_key}}
  api_username: {{api_username}}
  type: avatar
  user_id: 1
  files[]: file

The problem I found is that this just returns { "success": "OK" } and doesn’t return the upload_id?

Then you need to make a request with the upload_id:

PUT {{base_url}}/users/{{api_username}}/preferences/avatar/pick
form-data:
  api_key: {{api_key}}
  api_username: {{api_username}}
  upload_id: 2
  type: uploaded
2 Likes