---
title: "Fail Token Request"
method: POST
path: "/api/{serviceId}/auth/token/fail"
tags: ["Token Endpoint"]
---

# Fail Token Request

`POST /api/{serviceId}/auth/token/fail`

This API generates a content of an error token response that the authorization server implementation
returns to the client application.

## Path parameters

- `serviceId` string, required

## Request body

- TokenFailRequest
  - `ticket` string, required — The ticket issued from Authlete `/auth/token` API.
  - `reason` 'UNKNOWN' | 'INVALID_RESOURCE_OWNER_CREDENTIALS' | 'INVALID_TARGET', required — The reason of the failure of the token request.

## Response `200`

- TokenFailResponse
  - `resultCode` string — The code which represents the result of the API call.
  - `resultMessage` string — A short message which explains the result of the API call.
  - `action` 'INTERNAL_SERVER_ERROR' | 'BAD_REQUEST' — The next action that the authorization server implementation should take.
  - `responseContent` string — The content that the authorization server implementation is to return to the client application. Its format varies depending on the value of `action` parameter. See description for details.

## Other responses

- `400`
- `401`
- `403`
- `429` — The request exceeded the request rate permitted for the endpoint.
- `500`

---

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