---
title: "Device access token request"
url: "https://nov18-dev.movespot.fyi/apis/konnect-identity-internal-3/versions/4156893f-a5db-4eb8-8deb-93f18fa8fbfa/operations/post-oauth-device-token"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-identity-internal-3/versions/4156893f-a5db-4eb8-8deb-93f18fa8fbfa.md

# Device access token request

`POST` `/internal/oauth/device/token`

Operation ID: `post-oauth-device-token`

This endpoint provides the machine client a means of being notified when a request for authorization is granted or rejected. It is expected for the client to try the access token request repeatedly in a polling fashion based on the error code in the response. See https://www.rfc-editor.org/rfc/rfc8628#section-3.4 for details.

## Request body (required)

Content types: `application/x-www-form-urlencoded`

## Responses

- `200` - Device access token response
- `400` - Bad Request

## OpenAPI definition

```yaml
openapi: 3.0.2
info:
  title: Konnect Identity
  version: 3.0.2
servers:
  - url: https://global.api.konghq.com/v3
    description: Global Base URL
paths:
  /internal/oauth/device/token:
    post:
      operationId: post-oauth-device-token
      summary: Device access token request
      description: >-
        This endpoint provides the machine client a means of being notified when
        a request for authorization is granted or rejected.

        It is expected for the client to try the access token request repeatedly
        in a polling fashion based on the error code in the response.

        See https://www.rfc-editor.org/rfc/rfc8628#section-3.4 for details.
      requestBody:
        description: The request schema for the device access token request.
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                grant_type:
                  description: Value MUST be set to
                    "urn:ietf:params:oauth:grant-type:device_code".
                  type: string
                device_code:
                  description: The device verification code, "device_code" from the device
                    authorization response.
                  type: string
                client_id:
                  description: The client identifier.
                  type: string
              required:
                - grant_type
                - device_code
                - client_id
      responses:
        "200":
          $ref: "#/components/responses/DeviceAccessTokenResponse"
        "400":
          $ref: "#/components/responses/DeviceAuthorizationGrantTokenBadRequest"
      security:
        - {}
      tags:
        - Device Authorization Grant
security:
  - {}
components:
  responses:
    DeviceAccessTokenResponse:
      description: Device access token response
      content:
        application/json:
          schema:
            type: object
            properties:
              access_token:
                description: The access token issued by the authorization server.
                type: string
              token_type:
                description: The type of the token issued.
                type: string
              expires_in:
                description: The lifetime in seconds of the access token.
                type: integer
              refresh_token:
                description: The refresh token, which can be used to obtain new access tokens
                  using the same authorization grant.
                type: string
              scope:
                description: The scope of the access token.
                type: string
            example:
              access_token: 2YotnFZFEjr1zCsicMWpAA
              token_type: Bearer
              expires_in: 3600
              refresh_token: tGzv3JOkF0XG5Qx2TlKWIA
              scope: read write
            required:
              - access_token
              - token_type
              - expires_in
            title: Device Access Token Response
    DeviceAuthorizationGrantTokenBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/BaseDeviceAuthorizationGrantBadRequest"
              - oneOf:
                  - $ref: "#/components/schemas/DeviceAuthorizationGrantAuthorizeError"
                  - $ref: "#/components/schemas/DeviceAuthorizationGrantTokenError"
  schemas:
    BaseDeviceAuthorizationGrantBadRequest:
      type: object
      properties:
        error_description:
          description: Human-readable text providing additional information, used to
            assist the client developer in understanding the error that
            occurred.
          type: string
        error_uri:
          description: A URI identifying a human-readable web page with information about
            the error, used to provide the client developer with additional
            information about the error.
          type: string
      title: Base Device Authorization Grant Bad Request
    DeviceAuthorizationGrantAuthorizeError:
      description: The error response for the device authorization grant request.
      type: object
      properties:
        error:
          description: >-
            A single error code from the following enum.

              invalid_request
                 The request is missing a required parameter, includes an unsupported parameter value (other than grant type),
                 repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the
                 client, or is otherwise malformed.

              invalid_client
                 Client authentication failed (e.g., unknown client, no client authentication included, or unsupported
                 authentication method).

              invalid_grant
                 The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is
                 invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to
                 another client.

              unauthorized_client
                 The authenticated client is not authorized to use this authorization grant type.

              unsupported_grant_type
                 The authorization grant type is not supported by the authorization server.

              invalid_scope
                 The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.
          type: string
          enum:
            - invalid_request
            - invalid_client
            - invalid_grant
            - unauthorized_client
            - unsupported_grant_type
            - invalid_scope
      required:
        - error
      title: Device Authorization Grant Authorize Error
    DeviceAuthorizationGrantTokenError:
      description: The error response for the device token request.
      type: object
      properties:
        error:
          description: >-
            A single error code from the following enum.

              authorization_pending
                 The authorization request is still pending as the end user hasn't yet completed the user-interaction steps.

              slow_down
                 A variant of "authorization_pending", the authorization request is still pending and polling should continue, but the interval MUST
                 be increased by 5 seconds for this and all subsequent requests.

              access_denied
                 The authorization request was denied.

              expired_token
                 The "device_code" has expired, and the device authorization session has concluded.
          type: string
          enum:
            - authorization_pending
            - slow_down
            - access_denied
            - expired_token
      required:
        - error
      title: Device Authorization Grant Token Error
```
