# Where should I put the API keys of discourse so that I can fetch the posts?

**URL:** https://meta.discourse.org/t/where-should-i-put-the-api-keys-of-discourse-so-that-i-can-fetch-the-posts/224177
**Category:** Development
**Tags:** rest-api
**Created:** [April 13, 2022, 3:08pm UTC](https://meta.discourse.org/t/where-should-i-put-the-api-keys-of-discourse-so-that-i-can-fetch-the-posts/224177 "2022-04-13T15:08:27Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [April 13, 2022, 3:12pm UTC](https://meta.discourse.org/t/where-should-i-put-the-api-keys-of-discourse-so-that-i-can-fetch-the-posts/224177/2 "2022-04-13T15:12:16Z")

</div>

I’m not sure how you are making your api requests (which tool or programming language), but the api key and username go in the http header.

Here is a curl example from the [Discourse REST API Documentation](https://meta.discourse.org/t/discourse-api-documentation/22706)

```plaintext
curl -X POST "http://127.0.0.1:3000/categories" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \
-H "Api-Username: discourse1" \
-F "name=89853c20-4409-e91a-a8ea-f6cdff96aaaa" \
-F "color=49d9e9" \
-F "text_color=f0fcfd"

```

---

_[View the full topic](https://meta.discourse.org/t/where-should-i-put-the-api-keys-of-discourse-so-that-i-can-fetch-the-posts/224177)._
