# API is throwing 404 errors

**URL:** <https://meta.discourse.org/t/api-is-throwing-404-errors/335647>\
**Category:** Product Support\
**Created:** [November 11, 2024, 7:17pm UTC](https://meta.discourse.org/t/api-is-throwing-404-errors/335647 "2024-11-11T19:17:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [November 11, 2024, 7:33pm UTC](https://meta.discourse.org/t/api-is-throwing-404-errors/335647/2 "2024-11-11T19:33:42Z")

</div>

Your example works as-is modulo the expected parameters against our test site:

```plaintext
○ → curl -i -X PUT "https://try.discourse.org/admin/users/41/suspend.json" \
  -H "Api-Key: swordfish" \
  -H "Api-Username: michael" \
  -H "Content-Type: application/json" \
  -d '{"suspend_until": "2024-12-31", "reason": "Violation of community guidelines"}'

HTTP/2 200 
server: nginx
date: Mon, 11 Nov 2024 19:27:44 GMT
content-type: application/json; charset=utf-8
vary: Accept-Encoding
x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
x-discourse-username: michael
x-discourse-route: users/suspend
cache-control: no-cache, no-store
x-request-id: fe9c5ddc-b11a-45ba-ab41-9403eb53f255
cdck-proxy-id: app-router-tiehunter03.sea1
strict-transport-security: max-age=31536000
cdck-proxy-id: app-balancer-tieinterceptor1b.sea1

{
  "suspension": {
    "suspend_reason": "Violation of community guidelines",
    "full_suspend_reason": "Violation of community guidelines",
    "suspended_till": "2024-12-31T00:00:00.000Z",
    "suspended_at": "2024-11-11T19:27:44.927Z",
    "suspended_by": {
      "id": 85,
      "username": "michael",
      "name": "Michael Brown",
      "avatar_template": "/user_avatar/try.discourse.org/michael/{size}/639_2.png"
    }
  }
}

```

- validate the API key  
does Discourse show a valid user authentication (`x-discourse-username`) when making a simple GET with that key?
- validate the user ID  
it _really_ exists, right? it’ll 404 if it doesn’t
- are you behind Cloudflare?  
it can mess with parameters

---

_[View the full topic](https://meta.discourse.org/t/api-is-throwing-404-errors/335647)._
