**Source URL:** https://limited.veevavault.dev/sitevault/vault-api/api-reference/26.2/sandbox-vaults/generate-api-access-token-for-sandbox.md

# 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](/vault-api/explanation/api-access-tokens/#Generating_Access_Tokens) and how they are [retained when managing sandboxes](/vault-api/explanation/api-access-tokens/#Access_Token_Retention).

<Endpoint path="https://{vaultDNS}/api/{version}/objects/sandbox/{sandbox_name}/users/me/api_access_token__sys" method="POST"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Authorization` | The Vault `sessionId` or `Bearer {access_token}`. If you do not have any existing access tokens, you must use another method to [authenticate](/vault-api/api-reference/26.2/authentication) to Vault API and obtain a valid session ID. |
| `Content-Type` | `application/x-www-form-urlencoded` or `application/json` |
| `Accept` | `application/json` |
</FieldTable>

## URI Path Parameters {#uri-path-parameters}

<FieldTable>
| Name | Description |
| --- | --- |
| `sandbox_name` | The name of the sandbox Vault to create the access token for. This is the name which appears on the *My Vaults* page. |
</FieldTable>

## Body Parameters {#body-parameters}

<FieldTable>
| Name | Description |
| --- | --- |
| `name__v` | The name or description of the access token. |
| `expiry_date__v` | 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. |
</FieldTable>

## Request {#request}

<CodeExample title="">
```
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

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
    "responseStatus": "SUCCESS",
    "data": {
        "id": "0PI00000000C003",
        "token__sys": "veeva-vault-B5A79ABC..."
    }
}

```
</CodeExample>

## Response Details {#response-details}

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.



---

**Previous:** [Delete Sandbox](/sitevault/vault-api/api-reference/26.2/sandbox-vaults/delete-sandbox)  
**Next:** [Sandbox Snapshots](/sitevault/vault-api/api-reference/26.2/sandbox-vaults/sandbox-snapshots)