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

# 노션 API 통합 발급받고 연결하기

## 노션 API 통합 발급받기

노션 액션 사용을 위해 API 통합 발급받는 방법을 알려드리겠습니다.\
간단한 입력만으로 발급이 가능하며 자세한 방법은 아래 순서를 참고해 주세요.

{% hint style="success" %}
노션 API 통합은 여러 개 생성할 수 있으며, 바티와도 여러 개 연결할 수 있습니다.\
자동화 연동할 노션 DB가 많은 경우 여러 개를 생성해서 용도에 따라 분류해서 사용하시는 걸 추천드릴게요. :)
{% endhint %}

> <mark style="background-color:yellow;">🔎Click! 이미지를 클릭하면 예시 화면을 크게 볼 수 있습니다.</mark>

1. 노션 개발자 페이지의 Internal integrations(<https://www.notion.so/profile/integrations/internal>)에 접속합니다.
2. '새 API 통합 만들기'를 선택합니다.

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

3. Integration을 설정합니다.

   1. API 통합 이름 작성(임의로 자유롭게 작성)
   2. 관련 워크스페이스 선택(바티와 연동할 DB가 있는 워크스페이스 선택)
   3. 아이콘 업로드(선택, 필수 아님)

4. '저장'을 선택하여 API 통합을 생성합니다.

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

5. 생성된 internal integration API 상세페이지에서 아래 기능이 설정되어있는지 확인해주세요
   1. <기능>의 **<콘텐츠 기능>**&#xC5D0;서 **콘텐츠 읽기, 콘텐츠 업데이트, 콘텐츠 입력**이 체크되어 있는지 확인
   2. <기능>의 **<사용자 기능>**&#xC5D0;서 **이메일 주소를 포함하는 사용자 정보를 읽습니다**가 선택되어 있는지 확인

{% hint style="danger" %}
**위 기능 설정이되어 있지 않으면 바티에서 노션 DB에 접근할 수가 없어서 자동화 설정이 불가능합니다. 꼭 확인해주세요!**
{% endhint %}

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

6. '프라이빗 API 통합 시크릿'의 '표시' 클릭 후 시크릿 키를 '복사'합니다.

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

7. 복사한 시크릿 키를 바티 액션설정의 'API 통합 시크릿'에 붙여넣고 계정을 연동합니다.

1\) 바티의 프로젝트 리스트에서 '새 작업' - '바티엑셀'을 만드시고

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

2\) 오른쪽 워크플로 검색창에서 '노션'을 검색한 뒤, 한 가지 액션을 눌러 추가해주세요

<figure><img src="/files/8GxqatkyPl1tD5ED7uwe" alt=""><figcaption></figcaption></figure>

3\)  액션의  톱니바퀴 아이콘을 눌러 설정창을 열어주세요.

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

4\) 설정창에 노션 API 통합 정보를 입력하고 '노션 계정 연결하기'를 눌러 계정을 추가해주세요.

* 별칭 : API 통합 생성 시 입력한 이름 또는 계정을 구분할 수 있는 별칭을 자유롭게 입력해 주세요.
* API 통합 시크릿 : 5단계 화면의 '프라이빗 API 통합 시크릿'를 '복사'하여 붙여넣어 주세요.

<figure><img src="/files/75Z3A9Jzj5F8AZECHvOM" alt=""><figcaption></figcaption></figure>

***

## 노션 API 통합과 DB 연결하기

노션 API 통합 후 사용하려는 DB와 연결해야 바티 액션을 사용하실 수 있습니다.\
개인 워크스페이스 페이지에서 간단한 설정을 통해 적용할 수 있으므로 아래 순서를 확인해 주세요.

> <mark style="background-color:yellow;">🔎Click! 이미지를 클릭하면 예시 화면을 크게 볼 수 있습니다.</mark>

1. 사용할 DB가 포함된 노션 페이지에 접속합니다.
2. 페이지 우측 상단 더보기(점 3개)를 클릭합니다.
3. 아래의 '연결' 파트에서 '연결 항목'을 선택합니다.
4. 생성한 API 통합의 이름을 선택하여 해당 페이지와 연결합니다.

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

5. 해당 페이지 URL을 복사합니다.

<figure><img src="/files/7l38cLym85aEwanK1lHO" alt=""><figcaption></figcaption></figure>

6. 복사한  노션페이지 URL을 바티 액션에 붙여 넣고 확인을 클릭해주세요.

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

{% hint style="danger" %}
**잠깐! 혹시 사용하시려는 DB에 관계형(relation) 속성이 포함되어 있나요?**

그렇다면 관계형의 원본 DB가 포함된 페이지도 [위 방법](#api-db)대로 노션 API 통합과 연결해주셔야 합니다.\
관계형의 원본 DB에 또 관계형이 있다면 그 원본 DB가 포함된 페이지 역시 노션 API 통합과 연결이 필요해요.
{% endhint %}

{% hint style="warning" %}
**노션 페이지 vs 데이터베이스 차이**

* **노션 페이지 : 일반적인 노션 문서, 텍스트, 이미지, 체크리스트, 데이터베이스, 캘린더 등을 삽입할 수 있어요**
  * URL은 <https://www.notion.so/> + **(숫자&알파벳)**&#xC774; 붙어있어요
  * 예시 : <https://www.notion.so/batiai/><mark style="background-color:red;">**10b00cfebbfc800e8abbcd9326b87d73**</mark>
* **노션 데이터베이스 : 인라인/전체페이지 2개 유형으로 나뉘며, 테이블/보드/캘린더/갤러리 뷰 등 다양한 형태로 볼 수 있어요**
  * URL은 <https://www.notion.so/>  + **(숫자&알파벳?v=숫자&알파벳)**&#xC774; 붙어있어요
  * 예시 : <https://www.notion.so/batiai/fff00cfebbfc81ce9207ccc06f04b133><mark style="background-color:red;">**?v=fff00cfebbfc81428710000c4d6ed1dc\&pvs=4**</mark>
    {% endhint %}

***


---

# 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 dynamically by asking a question.

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

```
GET https://batiai.gitbook.io/service/api/notionapi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
