> ## Documentation Index
> Fetch the complete documentation index at: https://docs.velt.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get API Keys

Use this API to retrieve a list of API keys for a workspace.

<Info>
  This endpoint uses **workspace-level auth**: pass `x-velt-workspace-id` and `x-velt-auth-token` (from the Create Workspace response) as headers.
</Info>

# Endpoint

`POST https://api.velt.dev/v2/workspace/apikeys/get`

# Headers

<ParamField header="x-velt-workspace-id" type="string" required>
  Your Workspace ID.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object">
  <Expandable title="properties">
    <ParamField body="apiKeys" type="string[]">
      Filter results to specific API key IDs.
    </ParamField>

    <ParamField body="pageSize" type="number">
      Number of results per page. Max `100`. Defaults to `100`.
    </ParamField>

    <ParamField body="pageToken" type="string">
      Pagination token from a previous response to fetch the next page.
    </ParamField>
  </Expandable>
</ParamField>

# Example Request

```JSON theme={null}
{
  "data": {
    "pageSize": 50
  }
}
```

# Example Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "API keys retrieved successfully.",
    "data": [
      {
        "id": "velt_api_key_1",
        "apiKeyName": "Production Key",
        "type": "production"
      },
      {
        "id": "velt_api_key_2",
        "apiKeyName": "Testing Key",
        "type": "testing"
      }
    ],
    "nextPageToken": "eyJsYXN0SWQiOiJ2ZWx0X2FwaV9rZXlfMiJ9"
  }
}
```

<Note>
  If there are more results, the response includes a `nextPageToken` string. Pass this value as `pageToken` in your next request to fetch the next page. When no `nextPageToken` is returned, you have reached the last page.
</Note>

#### Failure Response

```JSON theme={null}
{
  "error": {
    "status": "PERMISSION_DENIED",
    "message": "Invalid workspace credentials."
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "API keys retrieved successfully.",
      "data": [
        {
          "id": "velt_api_key_1",
          "apiKeyName": "Production Key",
          "type": "production"
        },
        {
          "id": "velt_api_key_2",
          "apiKeyName": "Testing Key",
          "type": "testing"
        }
      ],
      "nextPageToken": "eyJsYXN0SWQiOiJ2ZWx0X2FwaV9rZXlfMiJ9"
    }
  }
  ```
</ResponseExample>
