VA-003 Utilize Vault CLI and API Practice Question
An application needs to read a secret using the Vault API after authenticating with an AppRole RoleID and SecretID. The application has already obtained a Vault token. Which API endpoint should be called to read a secret at 'secret/data/myapp' with the token?
⚠ Common exam trap
HashiCorp often tests the distinction between KV v1 and KV v2 API paths, specifically that KV v2 requires '/data/' in the path to read secrets, while KV v1 uses a flat path without '/data/'.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
GET /v1/secret/data/myapp
After authentication, the application already has a Vault token and needs to read a secret from the KV v2 secrets engine. The correct API endpoint for reading a secret from the KV v2 engine is GET /v1/secret/data/myapp, where 'secret' is the mount path and 'data' is the sub-path for KV v2 operations. The token is passed in the X-Vault-Token header, not in the URL.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
GET /v1/secret/metadata/myapp
Why it's wrong here
GET /v1/secret/metadata/myapp returns metadata about the KV v2 secret, such as version history and custom metadata, not the secret payload itself. It is the right endpoint when the task is to inspect versions or metadata rather than retrieve the stored values.
- ✗
POST /v1/auth/approle/login
Why it's wrong here
POST /v1/auth/approle/login exchanges a RoleID and SecretID for a token; the stem states a token is already held. Calling it again re-authenticates rather than reading data. It is correct when the application still needs to obtain its initial Vault token via AppRole.
- ✗
GET /v1/secret/myapp
Why it's wrong here
GET /v1/secret/myapp omits the KV v2 data path segment, so it addresses the wrong route and returns no secret. It is correct against a KV v1 secrets engine, where the mount path is followed directly by the secret name.
- ✓
GET /v1/secret/data/myapp
Why this is correct
KV v2 secrets are read through the data/ segment of the mount path, so the token-bearing GET request must target /v1/secret/data/myapp. Omitting data/ hits the metadata endpoint instead, satisfying the stem's requirement to read the secret value.
Go deeper
Related to this question
About these practice questions
Courseiva writes every VA-003 question from scratch — 366 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This VA-003 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the VA-003 exam.