# 인증

DFINERY는 API 토큰을 통해 사용자가 보낸 요청이 인증된 요청인지 판단합니다. 모든 API 요청의 헤더에는 API 토큰이 필수로 포함되어야 합니다. API 토큰은 디파이너리 콘솔을 통해 발급 받을 수 있습니다.

DFINERY의 API 토큰은 Import API, Export API 토큰으로 나뉘어 있습니다. Import API 토큰은 주로 디파이너리에 고객사의 데이터를 전송할 때 사용합니다 (Event, Identity, Profile API). Export API 토큰은 주로 고객사가 디파이너리에 적재되어 있는 데이터를 추출할 때 사용합니다 (Export API).

## API 토큰 발급

[디파이너리 콘솔](https://console.dfinery.ai/)에 로그인 후 좌측 메뉴의 `서비스 관리`에 들어가시면 `Key 정보`에서 `API 토큰`을 확인할 수 있습니다 (<mark style="color:blue;">`서비스 관리`</mark> > <mark style="color:blue;">`Key 정보`</mark> > <mark style="color:blue;">`API 토큰`</mark>).

{% hint style="info" %}

* 토큰 발급 / 재발급 / 삭제는 서비스 관리자만이 가능합니다.
* API 토큰은 서비스 생성 시 자동 발급되며 재발급만이 가능합니다.
  {% endhint %}

## API 토큰을 통한 요청

### Import API

Import API 토큰은 요청 헤더에 **`access_token`** 값을 추가하여 사용할 수 있습니다.

<pre class="language-bash"><code class="lang-bash"><strong>curl -X GET "https://openapi.dfinery.ai/api/v1/..." \
</strong><strong>-H "access_token: ${your-import-api-token}"
</strong></code></pre>

### Export API

Emport API 토큰은 요청 헤더에 **`Authorization`** 값을 추가하여 사용할 수 있습니다.

```bash
curl -X GET "https://openapi.dfinery.ai/api/v1/..." \
-H "Authorization: Bearer ${your-export-api-token}"
```

## API 토큰 재발급

DFINERY에서는 서비스 별 1개의 API 토큰만 발급이 가능합니다. 만약 토큰을 변경하고 싶을 때는 재발급 버튼을 통해 변경이 가능합니다 (<mark style="color:blue;">`서비스 관리`</mark> > <mark style="color:blue;">`Key 정보`</mark> > <mark style="color:blue;">`API 토큰`</mark> > <mark style="color:blue;">`재발급`</mark>).

<figure><img src="/files/MTPCz285xR2tkopSKZQX" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
재발급 시 기존 토큰은 2주 동안만 사용이 가능합니다. 2주 내에 재발급한 토큰으로 변경해 주세요.
{% endhint %}

## API 토큰 관련 응답 코드

토큰 관련 응답 코드 및 공통 에러 및 코드는 [Response](/api-guide/api/import-api/response.md) 탭을 참고해 주시면 됩니다.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dfinery.ai/api-guide/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
