---
title: Start a device authorization request
description: "RFC 8628 device authorization endpoint. Initiates the device flow and returns a device code, user code, and verification URIs for the user to approve out of…"
product: general
lang: en
last_updated: 2026-09-15
token_estimate: 1383
---
# Start a device authorization request

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

## Start a device authorization request

**POST** `/v1/auth/device-authorization`

Full URL: `https://developer-api.amplitude.com/v1/auth/device-authorization`

**Servers:**
- Production (US): `https://developer-api.amplitude.com/v1/auth/device-authorization`
- Production (EU): `https://developer-api.eu.amplitude.com/v1/auth/device-authorization`

Start a device authorization request

RFC 8628 device authorization endpoint. Initiates the device flow and returns a device_code, user_code, and verification URIs for the user to approve out of band, then poll the token endpoint. When `offline_access` is requested, `openid` is also required.

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| scope | string | No | — | Space-delimited OAuth scopes to request. When `offline_access` is requested, `openid` is also required. |

## Body (application/x-www-form-urlencoded)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| scope | string | No | — | Space-delimited OAuth scopes to request. When `offline_access` is requested, `openid` is also required. |

## Response (application/json)

**200** — Device authorization started.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| device_code | string | Yes | — | — |
| user_code | string | Yes | — | — |
| verification_uri | string | Yes | — | — |
| verification_uri_complete | string | No | — | — |
| expires_in | integer | Yes | — | — |
| interval | integer | No | — | — |

```json
{
  "device_code": "string",
  "user_code": "string",
  "verification_uri": "string",
  "verification_uri_complete": "string",
  "expires_in": 0,
  "interval": 0
}
```

**400** — Invalid request (RFC 6749 §5.2 OAuth error).

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| error | string | Yes | — | — |
| error_description | string | No | — | — |
| error_hint | string | No | — | — |
| error_uri | string | No | — | — |

```json
{
  "error": "string",
  "error_description": "string",
  "error_hint": "string",
  "error_uri": "string"
}
```

**401** — Client authentication failed (RFC 6749 §5.2 OAuth error).

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| error | string | Yes | — | — |
| error_description | string | No | — | — |
| error_hint | string | No | — | — |
| error_uri | string | No | — | — |

```json
{
  "error": "string",
  "error_description": "string",
  "error_hint": "string",
  "error_uri": "string"
}
```

**429**

**500** — Server error (RFC 6749 §5.2 OAuth error).

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| error | string | Yes | — | — |
| error_description | string | No | — | — |
| error_hint | string | No | — | — |
| error_uri | string | No | — | — |

```json
{
  "error": "string",
  "error_description": "string",
  "error_hint": "string",
  "error_uri": "string"
}
```

## Code samples

### cURL

```bash
curl -X POST "https://developer-api.amplitude.com/v1/auth/device-authorization" \
  -H "Content-Type: application/json" \
  -H "Authorization: YOUR_API_KEY"
```

### Python

```python
import requests

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

### JavaScript

```javascript
const response = await fetch("https://developer-api.amplitude.com/v1/auth/device-authorization", {
  method: "POST",
  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/auth/device-authorization");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
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("POST", "https://developer-api.amplitude.com/v1/auth/device-authorization", 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/auth/device-authorization"))
      .method("POST", 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/auth/device-authorization")
request = Net::HTTP::Post.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
```

