> For the complete documentation index, see [llms.txt](https://toss-ads.gitbook.io/toss-ads/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://toss-ads.gitbook.io/toss-ads/api-common/authentication-errors.md).

# 인증 에러

Access Token에 문제가 있으면 토스애즈 API는 [응답 형식](https://toss-ads.gitbook.io/toss-ads/api-common/response-format.md)을 따르지 않고 짧은 텍스트로 응답해요. 이 문서에서는 인증 에러가 났을 때 확인할 내용과 해결 방법을 알려드려요.

### 응답 예시

인증에 실패하면 아래와 같은 응답을 받아요.

```http
HTTP/1.1 401 Unauthorized
Content-Type: application/json

잘못된 요청입니다(2).
```

{% hint style="warning" %}
인증 에러가 나면 응답 헤더에는 JSON이라고 표시되지만(`Content-Type: application/json`), 실제 본문은 일반 텍스트예요. HTTP 상태 코드가 401이면 본문을 JSON으로 읽지 말고, Access Token을 재발급받아 다시 호출해 주세요.
{% endhint %}

### 원인과 해결 방법

| HTTP 상태 코드 | 응답 본문           | 원인                                                                                                                                    | 해결 방법                                                                                 |
| ---------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| 401        | `잘못된 요청입니다(2).` | <p>아래 중 하나에 해당해요.<br>• <code>Authorization</code> 헤더가 없어요.<br>• <code>Bearer</code> 접두어가 빠졌어요.<br>• Access Token이 올바르지 않거나 만료됐어요.</p> | Access Token을 재발급받은 뒤 `Authorization` 헤더에 `Bearer {access_token}` 형식으로 넣어 다시 호출해 주세요. |

Access Token을 발급받는 방법은 [인증하기](https://toss-ads.gitbook.io/toss-ads/getting-started/authentication.md)에서 확인해 주세요.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://toss-ads.gitbook.io/toss-ads/api-common/authentication-errors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
