# 쓰기

> 워크스페이스에 쓰기. 도구 12개와 매개변수, 호출 예제.

Source: https://piqline.com/ko/docs/api/reference/write

워크스페이스 객체를 만들거나 변경하는 Piqline 에이전트의 도구입니다. `write` 스코프가 필요합니다.

각 호출은 `Authorization: Bearer`에 키를 넣은 `POST` 요청입니다. JSON 본문이 도구의 입력이며, 응답은 `{ "tool": "nom", "output": … }` 형태입니다. 예제에는 필수 매개변수만 포함되어 있습니다. 매개변수 설명은 에이전트가 읽는 설명과 같습니다.

### `updateWorkspaceProfile`

워크스페이스의 니즈 프로필을 저장합니다: 목표, 주제, 엔티티, 언어, 지역, 수준, 속도.

`POST https://piqline.com/api/v1/tools/updateWorkspaceProfile`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `needs` | `object` | 아니요 |  |
| `stage` | `string` | 아니요 |  |
| `onboarding_status` | `not_started \| in_progress \| done \| skipped` | 아니요 |  |
| `summary` | `string` | 아니요 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/updateWorkspaceProfile \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/updateWorkspaceProfile", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/updateWorkspaceProfile",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `followEntity`

회사, 브랜드 또는 공개 계정(개인은 제외)을 팔로우하여 그 항목과 언급을 연결합니다.

`POST https://piqline.com/api/v1/tools/followEntity`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `name` | `string` | 예 |  |
| `kind` | `company \| brand \| account` | 아니요 |  |
| `siren` | `string` | 아니요 |  |
| `domain` | `string` | 아니요 |  |
| `handles` | `array<object>` | 아니요 |  |
| `role` | `self \| competitor \| client \| target \| other` | 아니요 |  |
| `aliases` | `array<string>` | 아니요 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/followEntity \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/followEntity", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/followEntity",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "name": "texte",
    },
)
output = response.json()["output"]
```

### `unfollowEntity`

엔티티 팔로우를 중단합니다. 기존 연결은 남습니다.

`POST https://piqline.com/api/v1/tools/unfollowEntity`

유형: 삭제. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `entityId` | `string` | 예 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/unfollowEntity \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entityId":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/unfollowEntity", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "entityId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/unfollowEntity",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "entityId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
    },
)
output = response.json()["output"]
```

### `saveBookmark`

워크스페이스 보관함에 북마크를 저장합니다. http(s) URL은 읽기, 보관, 벡터화 대기열에 들어갑니다.

`POST https://piqline.com/api/v1/tools/saveBookmark`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `title` | `string` | 예 |  |
| `href` | `string` | 예 |  |
| `kind` | `item \| source \| signal \| graph \| search \| document \| board \| chat` | 아니요 |  |
| `subtitle` | `string` | 아니요 |  |
| `note` | `string` | 아니요 |  |
| `tags` | `array<string>` | 아니요 |  |
| `origin` | `dashboard \| api \| slack \| whatsapp \| mail \| other` | 아니요 |  |
| `originRef` | `string` | 아니요 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/saveBookmark \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"texte","href":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/saveBookmark", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "title": "texte",
    "href": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/saveBookmark",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "title": "texte",
        "href": "texte",
    },
)
output = response.json()["output"]
```

### `setWatchContract`

소스에 모니터링 계약을 설정합니다. 이후 모니터링 페이지에는 일치하는 항목만 표시됩니다. 결정적 방식이며 모델을 사용하지 않습니다.

`POST https://piqline.com/api/v1/tools/setWatchContract`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `sourceId` | `string` | 예 |  |
| `intent` | `string` | 예 | What this workspace watches on the source, in the person's words. |
| `include` | `array<string>` | 아니요 | Keep an item only if it contains at least one of these terms (whole word, any case or accent). |
| `exclude` | `array<string>` | 아니요 | Drop an item containing any of these terms. |
| `event` | `hiring \| funding \| launch \| expansion \| reorg \| open_to_work \| leaving \| interested_comment \| …` | 아니요 | Business event the item must announce (hiring, funding, launch…), read from its text. |
| `sectors` | `array<string>` | 아니요 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/setWatchContract \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70","intent":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/setWatchContract", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "sourceId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
    "intent": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/setWatchContract",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "sourceId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
        "intent": "texte",
    },
)
output = response.json()["output"]
```

### `removeWatchContract`

소스의 모니터링 계약을 제거합니다. 모든 항목이 다시 표시됩니다.

`POST https://piqline.com/api/v1/tools/removeWatchContract`

유형: 삭제. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `sourceId` | `string` | 예 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/removeWatchContract \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/removeWatchContract", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "sourceId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/removeWatchContract",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "sourceId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
    },
)
output = response.json()["output"]
```

### `initReaderInterview`

읽기 인터뷰의 두 가지 답(핵심 또는 상세, 주된 의도)을 읽기 프로필에 저장합니다.

`POST https://piqline.com/api/v1/tools/initReaderInterview`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `density` | `essentiel \| detail` | 예 |  |
| `intent` | `read-arrivals \| spot-change \| watch-entities \| compare \| measure-coverage \| control-sources \| analyze-market \| prepare-output \| …` | 예 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/initReaderInterview \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"density":"essentiel","intent":"read-arrivals"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/initReaderInterview", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "density": "essentiel",
    "intent": "read-arrivals"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/initReaderInterview",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "density": "essentiel",
        "intent": "read-arrivals",
    },
)
output = response.json()["output"]
```

### `applyBoardChange`

이미 승인된 변경 사항을 보드에 적용합니다.

`POST https://piqline.com/api/v1/tools/applyBoardChange`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `dashboardId` | `string` | 아니요 |  |
| `changes` | `array<object>` | 예 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/applyBoardChange \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"changes":[{"id":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70","kind":"add","widgetId":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70","reason":"texte","title":"texte"}]}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/applyBoardChange", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "changes": [
      {
        "id": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
        "kind": "add",
        "widgetId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
        "reason": "texte",
        "title": "texte"
      }
    ]
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/applyBoardChange",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "changes": [
            {
                "id": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
                "kind": "add",
                "widgetId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
                "reason": "texte",
                "title": "texte",
            },
        ],
    },
)
output = response.json()["output"]
```

### `buildDashboard`

위젯 선택기를 거치지 않고 보드를 직접 만듭니다.

`POST https://piqline.com/api/v1/tools/buildDashboard`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `spec` | `object` | 예 |  |
| `save` | `boolean` | 아니요 | Persist the board when the user is owner/admin. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/buildDashboard \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"spec":{"version":1,"title":"texte","description":"texte","period":"1h","widgets":[{"kind":"texte","title":"texte"}]}}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/buildDashboard", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "spec": {
      "version": 1,
      "title": "texte",
      "description": "texte",
      "period": "1h",
      "widgets": [
        {
          "kind": "texte",
          "title": "texte"
        }
      ]
    }
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/buildDashboard",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "spec": {
            "version": 1,
            "title": "texte",
            "description": "texte",
            "period": "1h",
            "widgets": [
                {
                    "kind": "texte",
                    "title": "texte",
                },
            ],
        },
    },
)
output = response.json()["output"]
```

### `saveWorkspaceTable`

유용한 열이 채워진 워크스페이스 테이블을 만듭니다.

`POST https://piqline.com/api/v1/tools/saveWorkspaceTable`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `name` | `string` | 예 |  |
| `comment` | `string` | 예 |  |
| `columns` | `array<object>` | 예 |  |
| `rows` | `array<object>` | 예 |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/saveWorkspaceTable \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"texte","comment":"texte","columns":[{"id":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70","name":"texte","type":"text"}],"rows":[{}]}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/saveWorkspaceTable", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "texte",
    "comment": "texte",
    "columns": [
      {
        "id": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
        "name": "texte",
        "type": "text"
      }
    ],
    "rows": [
      {}
    ]
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/saveWorkspaceTable",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "name": "texte",
        "comment": "texte",
        "columns": [
            {
                "id": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
                "name": "texte",
                "type": "text",
            },
        ],
        "rows": [
            {},
        ],
    },
)
output = response.json()["output"]
```

### `writeFromWatch`

워크스페이스 모니터링 항목을 바탕으로 텍스트를 작성합니다(기사, LinkedIn 게시물, X 스레드, Instagram 캡션, 뉴스레터, 동영상 스크립트, 보도 자료, SEO 기사, 이메일, 요약). 9개 언어를 지원하며, 각 사실에는 출처를 [n]으로 인용하고, 텍스트는 초안에 추가됩니다. 크레딧을 조금 사용합니다.

`POST https://piqline.com/api/v1/tools/writeFromWatch`

유형: 쓰기. 스코프: `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `instruction` | `string` | 예 | What to write and for whom, in plain words, e.g. « Le post de la semaine sur ce qui a bougé dans la cosmétique ». |
| `example` | `string` | 아니요 | Optional sample text whose style to follow. |
| `scope` | `object` | 아니요 | Which items of the workspace watches to write from: sources, topics, keywords, platforms, item types or item ids, period and depth. Default: the last 7 days, 15 items. |
| `pen` | `object` | 아니요 | Format (article, linkedin, x_thread, instagram, newsletter, video_script, press_release, seo_brief, email, summary), goal, tone, framework, length, voice, language (fr, en, es, de, it, pt, nl, he, ar), creativity, variants and options. |
| `save` | `boolean` | 아니요 | Keep the text in the workspace drafts (default). false: return it only. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/writeFromWatch \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"instruction":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/writeFromWatch", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "instruction": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/writeFromWatch",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "instruction": "texte",
    },
)
output = response.json()["output"]
```

### `setTableFeed`

테이블이 스스로 채워지게 합니다: 규칙에 맞는 코퍼스 항목이 생기면 확인 후 추가됩니다. status=paused는 채우기를 중지합니다.

`POST https://piqline.com/api/v1/tools/setTableFeed`

유형: 실행. 스코프: `act`, `write`.

| 매개변수 | 형식 | 필수 | 설명 |
| --- | --- | --- | --- |
| `schema` | `string` | 아니요 |  |
| `name` | `string` | 예 |  |
| `status` | `live \| paused` | 아니요 |  |
| `prompt` | `string` | 예 | The person's words, unchanged. |
| `summary` | `string` | 예 | What you understood, in plain French, one sentence. |
| `sourceIds` | `array<string>` | 아니요 |  |
| `sourceLabels` | `array<string>` | 아니요 |  |
| `query` | `string` | 아니요 |  |
| `platform` | `string` | 아니요 |  |
| `itemType` | `post \| video \| article \| listing \| job_offer` | 아니요 |  |
| `alreadyMatching` | `integer` | 아니요 | How many items searchItems found just now. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/setTableFeed \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"texte","prompt":"texte","summary":"texte"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/setTableFeed", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "texte",
    "prompt": "texte",
    "summary": "texte"
  }),
});
const { output } = await response.json();
```
```python tab="Python"
import os
import requests

response = requests.post(
    "https://piqline.com/api/v1/tools/setTableFeed",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "name": "texte",
        "prompt": "texte",
        "summary": "texte",
    },
)
output = response.json()["output"]
```
