# I can't find documentation for the keycloak API

**URL:** <https://forum.keycloak.org/t/i-cant-find-documentation-for-the-keycloak-api/20604>\
**Category:** Getting advice\
**Tags:** documentation\
**Created:** [March 2, 2023, 1:32pm UTC](https://forum.keycloak.org/t/i-cant-find-documentation-for-the-keycloak-api/20604 "2023-03-02T13:32:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldofiore28](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/aldofiore28/32/7848_2.png) [@aldofiore28](https://forum.keycloak.org/u/aldofiore28)\
**Post date:** [March 2, 2023, 1:32pm UTC](https://forum.keycloak.org/t/i-cant-find-documentation-for-the-keycloak-api/20604/1 "2023-03-02T13:32:02Z")

</div>

I am working on something at work that already uses keycloak and I need to modify it, but I don’t seem to be able to find any documentation of the API. I am using the REST API, but something else.

The existing request is like this:  
Body:

```auto
{
        grant_type: "password",
        client_id: user.config,
        username: user.driverId,
        password: user.password,
}

```

URL: `${baseUrl}/realms/${config}/protocol/openid-connect/token`  
And passing `"Content-Type": "application/x-www-form-urlencoded"` as a header.

Where do I find documentation for this part? Is there any? How can I find out how to modify this request?

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [March 2, 2023, 2:17pm UTC](https://forum.keycloak.org/t/i-cant-find-documentation-for-the-keycloak-api/20604/2 "2023-03-02T14:17:04Z")

</div>

Documentation for the admin REST API is here:  
[https://www.keycloak.org/docs-api/21.0.1/rest-api/index.html](https://www.keycloak.org/docs-api/21.0.1/rest-api/index.html)

The token request you are trying to make needs those pairs as post parameters, not as a JSON body. E.g. with curl:

```bash
curl -i --request POST $host/realms/$realm/protocol/openid-connect/token \
--header "Accept: application/json" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data "grant_type=password&username=$user&password=$pass&client_id=$client"

```

---

<div class="post-metadata">

**Author:** ![aldofiore28](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/aldofiore28/32/7848_2.png) [@aldofiore28](https://forum.keycloak.org/u/aldofiore28)\
**Post date:** [March 2, 2023, 2:22pm UTC](https://forum.keycloak.org/t/i-cant-find-documentation-for-the-keycloak-api/20604/3 "2023-03-02T14:22:00Z")

</div>

Thank you for the reply!

One thing I don’t really understand from those documents is that the specific request you also posted here is nowhere in them, I can’t find it!

I need to change it to an OTP-based one, but I simply need docs that can direct me in the right direction!

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [March 2, 2023, 10:05pm UTC](https://forum.keycloak.org/t/i-cant-find-documentation-for-the-keycloak-api/20604/4 "2023-03-02T22:05:38Z")

</div>

Those endpoints are for Keycloak’s OpenID Connect implementation, not the API. You can find information on those endpoints here: [Securing Applications and Services Guide](https://www.keycloak.org/docs/latest/securing_apps/index.html#endpoints)
