Skip to content

Generate API Access Token for Sandbox

Generate an API access token for a sandbox Vault. Tokens are preserved upon refreshing a sandbox. Learn more about generating access tokens and how they are retained when managing sandboxes.

POSThttps://{vaultDNS}/api/{version}/objects/sandbox/{sandbox_name}/users/me/api_access_token__sys
NameDescription
AuthorizationThe Vault sessionId or Bearer {access_token}. If you do not have any existing access tokens, you must use another method to authenticate to Vault API and obtain a valid session ID.
Content-Typeapplication/x-www-form-urlencoded or application/json
Acceptapplication/json
NameDescription
sandbox_nameThe name of the sandbox Vault to create the access token for. This is the name which appears on the My Vaults page.
NameDescription
name__v
required
The name or description of the access token.
expiry_date__v
optional
The expiration date of the access token, in YYYY-MM-DDTHH:MM:SSZ format. Dates and times are in UTC. If the time is not specified, it will default to before midnight (23:59:59) in the user's timezone on the specified date. The maximum expiration period may vary based on the user's security profile. If allowed by the user's security profile, this parameter can be omitted to indicate the access token never expires.
curl -X POST -H "Authorization: {AUTH_VALUE}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "name__v=IntegrationKey" \
-d "expiry_date__sys=2025-12-31T12:00:00:00.000Z" \
https://myvault.veevavault.com/api/v26.2/objects/sandbox/VeePharmSandbox/users/me/api_access_token__sys
{
    "responseStatus": "SUCCESS",
    "data": {
        "id": "0PI00000000C003",
        "token__sys": "veeva-vault-B5A79ABC..."
    }
}

On SUCCESS, this request returns the id for the access token as well as its value (token__sys). The access token's value is only visible upon creation and should be stored safely. If lost, you cannot recover this value and must generate a new access token for the specified sandbox Vault.