---
title: Get authenticated context
description: Returns the authenticated principal and organization context.
product: general
token_estimate: 1022
---
# Get authenticated context

> 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`.

## Get authenticated context

**GET** `/v1/context`

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

**Servers:**
- United States: `https://developer-api.amplitude.com/v1/context`
- Europe: `https://developer-api.eu.amplitude.com/v1/context`

Get authenticated context

Returns the authenticated principal and organization context.

## Authorizations

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

## Response (application/json)

**200** — Successful response.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| data | object | Yes | — | — |
| data.object | string | Yes | — | — |
| data.principal | object | Yes | — | — |
| data.principal.object | string | Yes | — | — |
| data.principal.login_id | string | Yes | — | — |
| data.principal.org_id | string | Yes | — | — |
| data.principal.org_name | string | No | — | Constraints: nullable |
| data.principal.auth_type | string | Yes | — | Allowed values: oauth, pat, service_account, api_key |
| data.principal.scopes | string[] | Yes | — | — |
| data.org | object | Yes | — | — |
| data.org.id | string | Yes | — | — |
| data.org.object | string | Yes | — | — |
| data.org.name | string | Yes | — | Constraints: nullable |

```json
{
  "data": {
    "object": "context",
    "principal": {
      "object": "principal",
      "login_id": "string",
      "org_id": "string",
      "org_name": "string",
      "auth_type": "oauth",
      "scopes": [
        "string"
      ]
    },
    "org": {
      "id": "string",
      "object": "org",
      "name": "string"
    }
  }
}
```

**401**

**403**

**500**

## Code samples

### cURL

```bash
curl -X GET "https://developer-api.amplitude.com/v1/context" \
  -H "Content-Type: application/json" \
  -H "Authorization: YOUR_API_KEY"
```

### Python

```python
import requests

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

### JavaScript

```javascript
const response = await fetch("https://developer-api.amplitude.com/v1/context", {
  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/context");
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/context", 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/context"))
      .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/context")
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
```

