# Korpus

> Korpus und Workspace lesen. 22 Tools, mit ihren Parametern und Aufrufbeispielen.

Source: https://piqline.com/de/docs/api/reference/corpus

Tools des Piqline-Agenten. Sie lesen, was der Workspace bereits erfasst hat: keine Credits verbraucht, nichts geschrieben.

Jeder Aufruf ist eine `POST`-Anfrage mit dem Schlüssel in `Authorization: Bearer`. Der JSON-Body ist die Eingabe des Tools, und die Antwort hat die Form `{ "tool": "nom", "output": … }`. Die Beispiele enthalten nur die erforderlichen Parameter. Die Parameterbeschreibungen sind die, die die Agenten lesen.

### `getCoverageStats`

Erfassungsvolumen und Zustand: Summen, aufgeteilt nach Plattform und Art, Erfassungsreihen über das Analysefenster (`1h`, `24h`, `7d` oder `30d`).

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `period` | `1h \| 24h \| 7d \| 30d` | Nein | Analysis window |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getCoverageStats \
  -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/getCoverageStats", {
  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/getCoverageStats",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listSources`

Quellen, denen der Workspace folgt, mit Anzahl der Items, Zustand und letztem Lesevorgang.

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

Typ: Lesen. Scopes: `read`.

Dieses Tool nimmt keine Parameter: Senden Sie einen leeren Body, `{}`.

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listSources \
  -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/listSources", {
  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/listSources",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `searchItems`

Sucht Items (Beiträge, Videos, Artikel, Anzeigen, Jobs) mit Filtern: Text, Plattform, Art, Quelle. Ohne Filter werden die neuesten geliefert (höchstens 40).

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `query` | `string` | Nein | Free-text match on title and body |
| `platform` | `string` | Nein |  |
| `itemType` | `post \| video \| article \| listing \| job_offer` | Nein |  |
| `sourceId` | `string` | Nein |  |
| `limit` | `integer` | Nein |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/searchItems \
  -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/searchItems", {
  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/searchItems",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `getItem`

Detail eines Items: Text, Transkript, OCR, erkannte Themen, bedeutungsnahe Items und seine Beobachtungsdaten.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `itemId` | `string` | Ja |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getItem \
  -H "Authorization: Bearer $PIQLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"itemId":"5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70"}'
```
```javascript tab="JavaScript"
const response = await fetch("https://piqline.com/api/v1/tools/getItem", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.PIQLINE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "itemId": "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/getItem",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "itemId": "5a0e9c1f-2b7d-4e63-8f14-d3c8a6b92e70",
    },
)
output = response.json()["output"]
```

### `searchPassages`

Bedeutungssuche in langen Dokumenten (vom Motor gelesene PDFs): die Passagen, die einer Frage am nächsten kommen, mit Item, Seite und Abschnittstitel.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `query` | `string` | Ja | Question or phrase to look for |
| `itemId` | `string` | Nein | Limit to one document |
| `limit` | `integer` | Nein |  |

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

response = requests.post(
    "https://piqline.com/api/v1/tools/searchPassages",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "query": "levée de fonds",
    },
)
output = response.json()["output"]
```

### `citeItem`

Prüft, ob eine Passage wörtlich in einem Item vorkommt, und liefert eine Zitatnummer; andernfalls die nächstliegende Passage. Grundlage des Modus Zitate im Chat.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `itemId` | `string` | Ja | Item id from searchItems or getItem |
| `quote` | `string` | Ja | Exact passage copied from the item text |

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

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

### `drawDiagram`

Zeichnet die Antwort als SVG-Diagramm (Zeitleiste, Matrix, Ablauf, Baum …): Farben nach Rolle im Theme, SVG vor der Anzeige bereinigt. Grundlage des Modus Diagramm im Chat.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `type` | `architecture \| flowchart \| sequence \| state \| timeline \| swimlane \| quadrant \| tree \| …` | Ja | Visual type chosen for the layout |
| `title` | `string` | Ja | Short name of the subject, in the user's language |
| `description` | `string` | Ja | One sentence on what the diagram shows, for screen readers and the caption |
| `svg` | `string` | Ja | A single <svg viewBox="0 0 960 H">…</svg> following the diagram rules |

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

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

### `createCanvas`

Kompiliert ein Canvas (eine TSX-Datei, die nur das SDK piqline/canvas importiert) und liefert anzeigefertigen Code oder den zu behebenden Fehler. Grundlage der Modi Canvas und Bericht im Chat.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `title` | `string` | Ja | Short title shown above the canvas, in French |
| `source` | `string` | Ja | Full .canvas.tsx source |

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

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

### `getTopics`

Erkannte Themen mit ihrem Anteil an der Aufmerksamkeit und Stories (dasselbe Thema, gesehen in mehreren Quellen).

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `period` | `1h \| 24h \| 7d \| 30d` | Nein | Analysis window |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getTopics \
  -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/getTopics", {
  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/getTopics",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `getSignals`

Offene Signale, ausgelöst durch die Persistenzregeln des Workspace, mit Vorlaufzeit und Status.

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

Typ: Lesen. Scopes: `read`.

Dieses Tool nimmt keine Parameter: Senden Sie einen leeren Body, `{}`.

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getSignals \
  -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/getSignals", {
  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/getSignals",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listWorkspaceTables`

Bereits im Workspace erstellte Tabellen: Name, Kommentar, Anzahl der Spalten und Zeilen und ob sich die Tabelle selbst füllt.

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

Typ: Lesen. Scopes: `read`.

Dieses Tool nimmt keine Parameter: Senden Sie einen leeren Body, `{}`.

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listWorkspaceTables \
  -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/listWorkspaceTables", {
  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/listWorkspaceTables",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `getWorkspaceTable`

Eine Workspace-Tabelle als JSON: Schema, Spalten und Zeilen. Dient als Grundlage oder Datenquelle für eine Website, eine App oder einen Agenten (Scope read).

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `schema` | `string` | Nein | Schema, default public. |
| `name` | `string` | Ja | Table name. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/getWorkspaceTable \
  -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/getWorkspaceTable", {
  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/getWorkspaceTable",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "name": "texte",
    },
)
output = response.json()["output"]
```

### `listBookmarks`

Lesezeichen und Ordner des Workspace-Tresors: Titel, Typ, Ordner, Status, Aufnahme. Optionaler Filter nach Wort, Status oder Typ.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `query` | `string` | Nein | Optional filter on title, note or tags. |
| `status` | `inbox \| reading \| done` | Nein |  |
| `kind` | `item \| source \| signal \| graph \| search \| document \| board \| chat` | Nein |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listBookmarks \
  -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/listBookmarks", {
  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/listBookmarks",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listEntities`

Verfolgte Entitäten (Unternehmen, Marken, öffentliche Konten) und verknüpfte Items im Zeitraum.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `period` | `7d \| 30d \| 90d` | Nein |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listEntities \
  -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/listEntities", {
  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/listEntities",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listWatchContracts`

Auf Quellen gesetzte Watch-Verträge: Absicht, behaltene und ausgeschlossene Begriffe, Ereignis.

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

Typ: Lesen. Scopes: `read`.

Dieses Tool nimmt keine Parameter: Senden Sie einen leeren Body, `{}`.

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listWatchContracts \
  -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/listWatchContracts", {
  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/listWatchContracts",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `checkInvestigation`

Status der letzten Edge-Recherche oder einer bestimmten: ausstehend, laufend, abgeschlossen mit ihren Kandidaten oder fehlgeschlagen.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `missionId` | `string` | Nein | Omit to read the latest investigator mission of this workspace |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/checkInvestigation \
  -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/checkInvestigation", {
  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/checkInvestigation",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `checkHunt`

Status der letzten Suche oder einer bestimmten: Stufe, gefundene Personen mit dem Urteil des Codes und Ihrem, und je Kriterium sein Status und sein datierter öffentlicher Beleg (URL, Datum, Ausschnitt). Nie Kontaktdaten.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `missionId` | `string` | Nein | Omit to read the latest hunt of this workspace. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/checkHunt \
  -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/checkHunt", {
  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/checkHunt",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `planSourcePack`

Schlägt für ein Ziel einen stimmigen Satz von Quellen zum Verfolgen vor. Erstellt nichts.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `name` | `string` | Ja |  |
| `rationale` | `string` | Ja | Why this pack answers the goal |
| `candidates` | `array<object>` | Ja |  |

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

response = requests.post(
    "https://piqline.com/api/v1/tools/planSourcePack",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={
        "name": "texte",
        "rationale": "texte",
        "candidates": [
            {
                "platform": "instagram",
                "target": "texte",
                "label": "texte",
                "why": "texte",
                "confidence": "high",
            },
        ],
    },
)
output = response.json()["output"]
```

### `listWidgets`

Widgets, die auf ein Board dieses Workspace gelegt werden können, für die Person gereiht, mit ihren Gründen.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `period` | `7d \| 30d \| 90d` | Nein | Window used by isProposable. Default 7d. |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listWidgets \
  -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/listWidgets", {
  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/listWidgets",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `getAdvertiserCampaigns`

Anzeigenakte eines Werbetreibenden aus den Erfassungen des Workspace: Anzeigen, laufende, Daten, Bibliotheken, Länder, gelesene Bedarfe, neue Anzeigen pro Monat und Hochfahren, neueste Anzeigen, Signale. Nie eine Person. Keine Credits.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `advertiser` | `string` | Ja | Name (or part of it) of the advertiser. |

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

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

### `listAdSignals`

Anzeigensignale des Workspace, stündlich berechnet: Kampagne gestartet oder gestoppt, Hochfahren, neues Land, neue Plattform, bezahlte Einstellung, Aktion, Launch, neuer Werbetreibender. Keine Credits.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `kind` | `ad_campaign_started \| ad_campaign_stopped \| ad_ramp_up \| ad_new_country \| ad_new_platform \| ad_hiring \| ad_promotion \| ad_launch \| …` | Nein | ad_hiring for paid recruitment campaigns, ad_campaign_started for new campaigns, etc. |
| `activeOnly` | `boolean` | Nein |  |
| `limit` | `integer` | Nein |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listAdSignals \
  -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/listAdSignals", {
  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/listAdSignals",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```

### `listCollectedAds`

Anzeigenerfassungen des Workspace (Meta, TikTok, Google, LinkedIn), bereits gelesen: die Liste oder, mit dem Namen einer Erfassung, ihre Aufschlüsselungen (Winkel, Angebote, Tonalitäten, Formate), ihr Rhythmus, ihre am längsten laufenden Anzeigen und ihre Anzeigen, gefiltert nach Bibliothek, Status, Winkel oder Wort. Keine Credits.

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

Typ: Lesen. Scopes: `read`.

| Parameter | Typ | Erforderlich | Beschreibung |
| --- | --- | --- | --- |
| `collection` | `string` | Nein | Name of a collection (exact, start or fragment). |
| `library` | `meta \| tiktok \| google \| linkedin` | Nein |  |
| `status` | `live \| new` | Nein | live: active or shown within 14 days. new: first seen at the last pass. |
| `angle` | `promotion \| lancement \| marque \| preuve_sociale \| education \| recrutement \| evenement \| lead \| …` | Nein |  |
| `query` | `string` | Nein | Word to find in the advertiser, title, text, button or transcript. |
| `limit` | `integer` | Nein |  |

```bash tab="curl"
curl -s https://piqline.com/api/v1/tools/listCollectedAds \
  -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/listCollectedAds", {
  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/listCollectedAds",
    headers={"Authorization": "Bearer " + os.environ["PIQLINE_API_KEY"]},
    json={},
)
output = response.json()["output"]
```
