# Delete user avatar by API

**URL:** https://meta.discourse.org/t/delete-user-avatar-by-api/154813
**Category:** Development
**Tags:** rest-api
**Created:** [June 14, 2020, 2:15pm UTC](https://meta.discourse.org/t/delete-user-avatar-by-api/154813 "2020-06-14T14:15:16Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [June 16, 2020, 9:16pm UTC](https://meta.discourse.org/t/delete-user-avatar-by-api/154813/10 "2020-06-16T21:16:39Z")

</div>

Here is some ruby code you can use that uses the discourse\_api gem so that you can use it as a reference. The sync\_sso endpoint is a bit different than other endpoints because you need to send it a [signed payload](https://meta.discourse.org/t/sync-sso-user-data-with-the-sync-sso-route/84398).

```plaintext
client = DiscourseApi::Client.new('host')
client.api_key = 'api_key'
client.api_username = 'api_username'
puts client.sync_sso(
  sso_secret: 'abcdefghij',
  username: '24db27218ed09205a5a0',
  name: '24db27218ed09205a5a0',
  email: '24db27218ed09205a5a076983bf241ab@example.com',
  external_id: '684',
  avatar_url: 'https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/codinghorror/240/110067_2.png',
)

```

---

_[View the full topic](https://meta.discourse.org/t/delete-user-avatar-by-api/154813)._
