# Vault HTTP API is not working for token lookup but working via CLI

**URL:** <https://discuss.hashicorp.com/t/vault-http-api-is-not-working-for-token-lookup-but-working-via-cli/17804>\
**Category:** Vault\
**Created:** [November 18, 2020, 8:57pm UTC](https://discuss.hashicorp.com/t/vault-http-api-is-not-working-for-token-lookup-but-working-via-cli/17804 "2020-11-18T20:57:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravitejb](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ravitejb/32/10297_2.png) [@ravitejb](https://discuss.hashicorp.com/u/ravitejb)\
**Post date:** [November 18, 2020, 8:57pm UTC](https://discuss.hashicorp.com/t/vault-http-api-is-not-working-for-token-lookup-but-working-via-cli/17804/1 "2020-11-18T20:57:36Z")

</div>

Hi All,

I’m running a 3 node vault cluster with version 1.4.3, when I create vault tokens I’m unable to lookup them using API, but I can look up them using the vault CLI.

### Not working:

curl -kv -H “X-Vault-Token: $VAULT\_TOKEN” -X POST [https://127.0.0.1:8200/v1/auth/token/lookup](https://127.0.0.1:8200/v1/auth/token/lookup)

Error Message:

```auto
{"errors":["1 error occurred:\n\t* permission denied\n\n"]}

```

### Working Scenario:

VAULT\_TOKEN= xxxx /opt/vault/vault/vault token lookup

I’m not sure what is going on here, This used to work fine previously, Just now having these issues when I deployed a new cluster with 1.4.3 version

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![Wolfsrudel](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wolfsrudel/32/28465_2.png) [@Wolfsrudel](https://discuss.hashicorp.com/u/Wolfsrudel)\
**Post date:** [November 18, 2020, 9:34pm UTC](https://discuss.hashicorp.com/t/vault-http-api-is-not-working-for-token-lookup-but-working-via-cli/17804/2 "2020-11-18T21:34:21Z")

</div>

Dump question: is your variable set in the first command? In the second command you set the variable `VAULT_TOKEN` to use it with the cli. The curl command just points to the usage, not the setting of the variable.

---

<div class="post-metadata">

**Author:** ![ravitejb](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ravitejb/32/10297_2.png) [@ravitejb](https://discuss.hashicorp.com/u/ravitejb)\
**Post date:** [November 18, 2020, 9:54pm UTC](https://discuss.hashicorp.com/t/vault-http-api-is-not-working-for-token-lookup-but-working-via-cli/17804/3 "2020-11-18T21:54:44Z")

</div>

Hi @Wolfsrudel  
No No I’m directly using the token, while posting the question I just replaced the token with that variable
