---
title: Retrieve a project API key
description: Provides the API key for a project. A project ID is required when the organization has more than one project.
product: general
lang: en
last_updated: 2026-10-29
token_estimate: 2712
---
# Retrieve a project API key

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Retrieve a project API key

**GET** `/v1/projects/api-key`

Full URL: `https://developer-api.amplitude.com/v1/projects/api-key`

**Servers:**
- Production (US): `https://developer-api.amplitude.com/v1/projects/api-key`
- Production (EU): `https://developer-api.eu.amplitude.com/v1/projects/api-key`

Retrieve a project API key

Provides the API key for a project. A project ID is required when the
organization has more than one project.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| Authorization | string | Yes | — | http |

## Query parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| project_id (query) | string | No | 12345 | The project ID. Required when the organization has more than one project. Constraints: pattern: ^[1-9][0-9]*$ |

## Response (application/json)

**200** — The project API key alongside the project name and ID.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| data | object | Yes | — | A project API key and the project it belongs to. |
| data.object | string | Yes | — | Resource type. |
| data.project_id | string | Yes | 12345 | Amplitude project identifier. Constraints: pattern: ^[1-9][0-9]*$ |
| data.project_name | string | Yes | Example Project | Project name, or null when no name is available. Constraints: nullable |
| data.api_key | string | Yes | example-project-api-key | The project API key. Constraints: min length: 1 |

```json
{
  "data": {
    "object": "project_api_key",
    "project_id": "12345",
    "project_name": "Example Project",
    "api_key": "example-project-api-key"
  }
}
```

**400** — The query is invalid, or a project ID is required because the organization
has more than one project.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://developer-api.amplitude.com/problems/project-selection-required",
  "title": "The query is invalid, or a project ID is required because the organization\nhas more than one project.\n",
  "status": 400,
  "detail": "Supply project_id to select a project.",
  "error_code": "project_selection_required",
  "retryable": false
}
```

**401**

**403** — Permission to retrieve the project API key is denied, or the endpoint is
unavailable.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://developer-api.amplitude.com/problems/project-key-access-denied",
  "title": "Permission to retrieve the project API key is denied, or the endpoint is\nunavailable.\n",
  "status": 403,
  "detail": "Access to the project API key is denied.",
  "error_code": "project_key_access_denied",
  "retryable": false
}
```

**404** — The project does not exist in the authenticated organization or is not
accessible to the caller (`project_not_found`).


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://developer-api.amplitude.com/problems/project-not-found",
  "title": "The project does not exist in the authenticated organization or is not\naccessible to the caller (`project_not_found`).\n",
  "status": 404,
  "detail": "Project not found.",
  "error_code": "project_not_found",
  "retryable": false
}
```

**422** — API key retrieval is not supported for this project. For example,
portfolio views and warehouse-native projects do not support this
operation.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://developer-api.amplitude.com/problems/project-api-key-not-available",
  "title": "API key retrieval is not supported for this project. For example,\nportfolio views and warehouse-native projects do not support this\noperation.\n",
  "status": 422,
  "detail": "API key retrieval is not available for this project.",
  "error_code": "project_api_key_not_available",
  "retryable": false
}
```

**429**

**500**

**502** — The project API key could not be retrieved (`upstream_error`). Retry later.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://developer-api.amplitude.com/problems/upstream-error",
  "title": "The project API key could not be retrieved (`upstream_error`). Retry later.\n",
  "status": 502,
  "detail": "Unable to retrieve the project API key. Retry later.",
  "error_code": "upstream_error",
  "retryable": true
}
```

**503** — The project API key is missing or unusable. Ask an administrator of your
organization to review the project's API key settings.

If the endpoint is temporarily unavailable, retry later.


| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| type | string | Yes | — | Constraints: format: uri |
| title | string | Yes | — | — |
| status | integer | Yes | — | Constraints: min: 400, max: 599 |
| detail | string | No | — | Constraints: nullable |
| instance | string | No | — | Constraints: format: uri, nullable |
| error_code | string | Yes | — | — |
| retryable | boolean | Yes | — | — |
| retry_after_seconds | integer | No | — | Constraints: nullable, min: 0 |
| validation_errors | object[] | No | — | Constraints: nullable |

```json
{
  "type": "https://developer-api.amplitude.com/problems/project-api-key-unavailable",
  "title": "The project API key is missing or unusable. Ask an administrator of your\norganization to review the project's API key settings.\n\nIf the endpoint is temporarily unavailable, retry later.\n",
  "status": 503,
  "detail": "The project API key is missing or unusable. Ask an administrator of your organization to review the project's API key settings.",
  "error_code": "project_api_key_unavailable",
  "retryable": false
}
```

## Code samples

### cURL

```bash
curl -X GET "https://developer-api.amplitude.com/v1/projects/api-key?project_id=12345" \
  -H "Content-Type: application/json" \
  -H "Authorization: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://developer-api.amplitude.com/v1/projects/api-key?project_id=12345",
    headers={
        "Content-Type": "application/json",
        "Authorization": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://developer-api.amplitude.com/v1/projects/api-key?project_id=12345", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://developer-api.amplitude.com/v1/projects/api-key?project_id=12345");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "Authorization: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("GET", "https://developer-api.amplitude.com/v1/projects/api-key?project_id=12345", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://developer-api.amplitude.com/v1/projects/api-key?project_id=12345"))
      .method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://developer-api.amplitude.com/v1/projects/api-key?project_id=12345")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

