Invalid path for a versioned K/V secrets engine

Hi there. I’m sure I’m being a muppet but I’m having a problem listing secrets from the API. I can perform other sys path based functions but I cannot for the life of me resolve the secret path.

Using the same token it returns results if I run via the CLI:

vault kv list secret
Keys

foo/

Via API with his call:

curl --header X-Vault-Token:“REDACTED” --request LIST https://vault.url:8200/v1/secret

I get ‘Invalid path for a versioned K/V secrets engine’.

Sorry for the newbie question

This should help you:

Ahh. I saw that post and tried it. No joy. The metadata actually has to go after the secret. So the URL would be http://127.0.0.1:8200/v1/kv-test/metadata. It is indeed in the docs for v2.

Thanks!

3 Likes