> 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/references/authentication.md).

# 인증

{% hint style="info" %}
**API 연동 중 문의사항이나 개선 제안이 있으신가요?**

토스애즈 API 연동에 대한 질문이나, 건의사항이 있다면 [채널톡](http://toss-business.channel.io/)에 남겨주세요.
{% endhint %}

인증 API는 토스애즈 API를 쓰는 데 필요한 Access Token을 발급하는 API예요. 광고주 서버에서 Client ID와 Client Secret을 보내면 Access Token을 발급해 줘요.

\
처음부터 순서대로 따라 하려면 [인증하기](/toss-ads/getting-started/authentication.md)를 참고해 주세요.

&#x20;

## 요청

아래 주소로 POST 요청을 보내요.

<mark style="color:green;">**`POST`**</mark> <mark style="color:green;"></mark><mark style="color:green;"><https://oauth2.cert.toss.im></mark><mark style="color:green;">**/token**</mark>

```json
curl -X POST https://oauth2.cert.toss.im/token \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Accept: application/json; charset=UTF-8" \
    -d "grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}&scope={scope}"
```

`-d` 뒤에 오는 값이 요청 본문이에요. 필드를 `&`로 이어 붙인 형식이에요. 중괄호(`{ }`)로 표시한 자리에 아래 값을 넣어 주세요.

<table><thead><tr><th width="175.881103515625">필드</th><th width="136.357666015625">타입</th><th width="105.990478515625">필수</th><th>설명</th></tr></thead><tbody><tr><td><code>grant_type</code></td><td>string</td><td>O</td><td>토큰을 발급받는 방식(OAuth2 grant type)이에요. 항상 <code>client_credentials</code>를 넣어 주세요.</td></tr><tr><td><code>client_id</code></td><td> string</td><td>O</td><td>광고주센터에서 발급받은 Client ID예요.</td></tr><tr><td><code>client_secret</code></td><td>string</td><td>O</td><td>광고주센터에서 발급받은 Client Secret이에요.</td></tr><tr><td><code>scope</code></td><td>string</td><td>O</td><td><p>요청할 권한 범위예요. 호출할 API에 필요한 권한을 넣어 주세요.</p><p>여러 개를 요청하려면 공백으로 구분해 주세요.<br>예: <code>ads:report.read ads:report.write</code></p></td></tr></tbody></table>

## 응답

발급에 성공하면 아래와 같은 응답을 받아요.

```json
{
"access_token": "{발급된 access token}",
"scope": "ads:report.read",
"token_type": "Bearer",
"expires_in": 31535999
}
```

<table><thead><tr><th width="175.881103515625">필드</th><th width="136.357666015625">타입</th><th>설명</th></tr></thead><tbody><tr><td><code>access_token</code></td><td>string</td><td>발급된 Access Token이에요. API를 호출할 때 사용해요.</td></tr><tr><td><code>scope</code></td><td>string</td><td>요청한 권한 범위예요.</td></tr><tr><td><code>token_type</code></td><td>string</td><td>토큰 타입이에요.</td></tr><tr><td><code>expires_in</code></td><td>integer</td><td>토큰의 유효 기간이에요. 초 단위예요.</td></tr></tbody></table>


---

# 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/references/authentication.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.
