# missing or unknown auth code

**URL:** <https://community.hubspot.com/t/missing-or-unknown-auth-code/81805>\
**Category:** APIs & Integrations\
**Tags:** timeline-and-extensions-apis\
**Created:** [May 23, 2023, 3:01pm UTC](https://community.hubspot.com/t/missing-or-unknown-auth-code/81805 "2023-05-23T15:01:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPetras](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@JPetras](https://community.hubspot.com/u/JPetras)\
**Post date:** [May 23, 2023, 3:01pm UTC](https://community.hubspot.com/t/missing-or-unknown-auth-code/81805/1 "2023-05-23T15:01:26Z")

</div>

Unfortunately again “generic post” with “missing or unknown auth code” message

Parameters are

grant\_type=authorization\_code

client\_id=925f1e4d-6b12-4051-9bda-XXXXX

client\_secret=ef196987-2318-4993-a2e5-XXXXX

code=336edf0e-b80a-4065-abee-XXXXX

redirect\_uri=[https://www.kXXXXX](https://www.kXXXXX)

the code is what I got after app authorisation

I can see the app is installed on the client’s portal - so the code is correct. But for every post request I get  
{“status”:“BAD\_AUTH\_CODE”,“message”:“missing or unknown auth code”,“correlationId”:“db861fc3-6340-4a87-a8a5-f88b5545eea8”}

Any idea? I tried removing and adding again the app, the same error

---

<div class="post-metadata">

**Author:** ![JPetras](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@JPetras](https://community.hubspot.com/u/JPetras)\
**Post date:** [May 23, 2023, 3:20pm UTC](https://community.hubspot.com/t/missing-or-unknown-auth-code/81805/2 "2023-05-23T15:20:36Z")

</div>

Just an update on the issue. So I removed the app and reinstalled it again.

I ran a post via postman and it was successful, I got the token and the app is now visible in my HubSport’s instance

but as soon as I tried to rerun the same request I got again the same error message

{

“status”: “BAD\_AUTH\_CODE”,

“message”: “missing or unknown auth code”,

“correlationId”: “efe92aee-d1c9-408e-b85e-51fbcecd7837”

}

---

<div class="post-metadata">

**Author:** ![JPetras](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@JPetras](https://community.hubspot.com/u/JPetras)\
**Post date:** [May 24, 2023, 10:11am UTC](https://community.hubspot.com/t/missing-or-unknown-auth-code/81805/3 "2023-05-24T10:11:46Z")

</div>

To reply me and hopefully help someone else 🙂

[https://api.hubapi.com/oauth/v1/token](https://api.hubapi.com/oauth/v1/token) with grant\_type=authorization\_code you can run only once, if you try again you will get the error message above

The whole point of running this is to get the refresh token, that is the token you need to save and use for getting the authorisation token in future
