# KSA v2: Generate an API key

Generate the API key that the KSA ZATCA API v2 requests use, with the access token you get when you sign in. This page documents API v2, a legacy version.

> **Legacy API v2**
>
> This page documents API v2, which is no longer developed. New integrations should use the current API: see [Unify](https://docs.complyance.io/api-reference/unify/) and [Saudi Arabia](https://docs.complyance.io/countries/sa/).

After you [sign in](https://docs.complyance.io/legacy/v2/ksa/signin/), generate your API key with a `GET` request to the API key generation endpoint. Send your access token in the `Authorization` header. The response contains your API key, which is valid for one year.

## Request parameters

| Parameter | Type | Description | Example |
| - | - | - | - |
| `Authorization` | string | The access token you received when you signed in. | `eyJhbGciOiJSUzI1NiJ9.example-access-token.signature` |
| `env` | string | The environment. | `sandbox` |

## Response parameters

| Parameter | Type | Description | Example |
| - | - | - | - |
| `message` | string | A description of the status of the request. | `API key created and linked to the specific API successfully!` |
| `apiKey` | string | The generated API key. | `EXAMPLEapiKEY00000000000000000000000000` |

## Next step

[Onboard your EGS](https://docs.complyance.io/legacy/v2/ksa/egs-onboarding/) with the API key.

Source: https://docs.complyance.io/legacy/v2/ksa/api-key-generation/
