---
title: "Request device code for CLI authentication"
method: POST
path: "/auth/device/code"
tags: ["Authentication"]
---

# Request device code for CLI authentication

`POST /auth/device/code`

Initiates OAuth 2.0 Device Authorization flow. Returns a code for the user to enter in browser.

## Response `200`

OK

- InternalHttpapiUsersapiDeviceCodeResponse — Device code response for CLI authentication
  - `device_code` string — DeviceCode is used when polling for the token (keep secret)
  - `expires_in` integer — ExpiresIn is the lifetime of the device code in seconds
  - `interval` integer — Interval is the minimum polling interval in seconds
  - `user_code` string — UserCode is displayed to the user to enter in browser
  - `verification_uri` string — VerificationURI is the URL the user should visit
  - `verification_uri_complete` string — VerificationURIComplete is the full URL with code pre-filled

## Other responses

- `500` — Internal Server Error
- `503` — Device flow not configured

---

[API](https://skmtc.net/deeplake/apis/deeplake-api.md) · [All operations](https://skmtc.net/deeplake/apis/deeplake-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeplake/deeplake-api/revisions/e16ed11d991c/schema)
