# Signals & themes

> A section of the Kumkuat API 1.0.0 reference. The rest of it: https://product.tech/docs-kumkuat-ai/api-reference.md (API Reference). Base URL: `https://api.kumkuat.ai`.

Signal templates (themes), theme filters, signal runs, and the executives extracted from documents.

## Get detailed information about a specific executive

`GET /api/v1/executives/{executive_name}`

### Path parameters

- `executive_name` (string, required): The executive's name as it appears on documents.

### Returns (200, object)

OK

- `cached_at` (string, nullable)
- `communication_types` (object)
- `companies` (array of string)
- `companies_mentioned` (array of string)
- `date_range` (object): earliest and latest document dates.
- `documents` (array of object): Documents attributed to the executive (same shape as GET /api/v1/documents/&#123;doc_id&#125;).
- `last_communication` (string, nullable)
- `name` (string, required, for example "Jane Doe")
- `signals` (array of object): Up to ten recent signals extracted from those documents.
- `themes_mentioned` (array of string)
- `total_documents` (integer, default 0)
- `total_signals` (integer, default 0)
- `unique_companies` (integer, default 0)
- `unique_themes` (integer, default 0)

### Responses

- `200`: OK
- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/executives/{executive_name}' \
  -H 'X-API-Key: <api key>'
```

### Example response

```json
{
  "cached_at": "string",
  "communication_types": {},
  "companies": [
    "string"
  ],
  "companies_mentioned": [
    "string"
  ],
  "date_range": {},
  "documents": [
    {}
  ],
  "last_communication": "string",
  "name": "Jane Doe",
  "signals": [
    {}
  ],
  "themes_mentioned": [
    "string"
  ],
  "total_documents": 0,
  "total_signals": 0,
  "unique_companies": 0,
  "unique_themes": 0
}
```

## Get all signals

`GET /api/v1/signals`

Get all signals with pagination

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl https://api.kumkuat.ai/api/v1/signals \
  -H 'X-API-Key: <api key>'
```

## Get signals for a specific document

`GET /api/v1/signals/document/{document_id}`

Get all signals for a specific document with filtering

### Path parameters

- `document_id` (string, required): Document id.

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/signals/document/{document_id}' \
  -H 'X-API-Key: <api key>'
```

## Delete signals for a specific document

`DELETE /api/v1/signals/document/{document_id}`

Soft-delete all non-deleted signals for a specific document in the current workspace.

### Path parameters

- `document_id` (string, required): Document id.

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/signals/document/{document_id}' \
  -X DELETE \
  -H 'X-API-Key: <api key>'
```

## Get the theme and executive filters

`GET /api/v1/signals/filters`

The themes, executives, pillars, content types and companies available for filtering.

### Query parameters

- `refresh` (boolean): Recompute instead of serving the cached copy.
- `force_refresh` (boolean): Same as refresh.

### Returns (200, object)

OK

- `companies` (array of string)
- `content_types` (array of string)
- `executives` (array of object, required)
  - `companies` (array of string)
  - `display` (string, required)
  - `executive` (string, required)
- `pillars` (array of string)
- `theme_metadata` (array of object): theme and pillar pairs.
- `theme_to_pillar` (object)
- `themes` (array of string, required)

### Responses

- `200`: OK
- `422`: Unprocessable Entity

### Example request

```bash
curl https://api.kumkuat.ai/api/v1/signals/filters \
  -H 'X-API-Key: <api key>'
```

### Example response

```json
{
  "companies": [
    "string"
  ],
  "content_types": [
    "string"
  ],
  "executives": [
    {
      "companies": [],
      "display": "string",
      "executive": "string"
    }
  ],
  "pillars": [
    "string"
  ],
  "theme_metadata": [
    {}
  ],
  "theme_to_pillar": {},
  "themes": [
    "string"
  ]
}
```

## Get all signal runs

`GET /api/v1/signals/runs`

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl https://api.kumkuat.ai/api/v1/signals/runs \
  -H 'X-API-Key: <api key>'
```

## Get signal run

`GET /api/v1/signals/runs/{run_id}`

Get signal run status and results

### Path parameters

- `run_id` (string, required): Signal run id.

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/signals/runs/{run_id}' \
  -H 'X-API-Key: <api key>'
```

## Get all signal templates

`GET /api/v1/signals/templates`

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl https://api.kumkuat.ai/api/v1/signals/templates \
  -H 'X-API-Key: <api key>'
```

## Create a signal template

`POST /api/v1/signals/templates`

Create a signal template (a theme to extract).

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl https://api.kumkuat.ai/api/v1/signals/templates \
  -X POST \
  -H 'X-API-Key: <api key>'
```

## Get signal template by ID

`GET /api/v1/signals/templates/{template_id}`

Get a specific signal template

### Path parameters

- `template_id` (string, required): Signal template id.

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/signals/templates/{template_id}' \
  -H 'X-API-Key: <api key>'
```

## Update a signal template

`PUT /api/v1/signals/templates/{template_id}`

Update a signal template.

### Path parameters

- `template_id` (string, required): Signal template id.

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/signals/templates/{template_id}' \
  -X PUT \
  -H 'X-API-Key: <api key>'
```

## Delete a signal template

`DELETE /api/v1/signals/templates/{template_id}`

Delete a signal template.

### Path parameters

- `template_id` (string, required): Signal template id.

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/signals/templates/{template_id}' \
  -X DELETE \
  -H 'X-API-Key: <api key>'
```

## Get signals by template

`GET /api/v1/signals/templates/{template_id}/signals`

Get all signals from a specific template

### Path parameters

- `template_id` (string, required): Signal template id.

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/signals/templates/{template_id}/signals' \
  -H 'X-API-Key: <api key>'
```

## Get themes and extracted signals

`GET /api/v1/signals/themes`

Theme extractions across the workspace's documents, paginated.

### Query parameters

- `page` (integer, default 1): Page number, 1-based.
- `per_page` (integer, default 20): Items per page.
- `theme` (string): Only this theme (signal template name).
- `executive` (string): Only this executive.
- `company` (string): Only this company.
- `communication_type` (string): Only this communication type.
- `signal_id` (string): One signal.
- `refresh` (boolean): Recompute instead of serving the cached copy.
- `force_refresh` (boolean): Same as refresh.

### Returns (200, object)

OK

- `pagination` (object, required)
  - `page` (integer, required): Page number, 1-based.
  - `per_page` (integer, required): Items per page.
  - `total_count` (integer, required): Items across all pages.
  - `total_extractions` (integer, nullable)
  - `total_pages` (integer, required)
- `themes` (array of object, required)
  - `auto_tags` (array of object)
    - `applied_at` (string, nullable)
    - `confidence_score` (number, nullable)
    - `extracted_value` (string, required, for example "Jane Doe")
    - `name` (string, required, for example "Executives")
    - `tag_type` (string, nullable)
  - `content` (string, nullable)
  - `content_type` (string, nullable)
  - `created_at` (string, nullable)
  - `document_id` (string, nullable)
  - `extracted_date` (string, nullable)
  - `json_data` (object): extractions: the statements found, each with extraction, justification and executive.
  - `signal_id` (string, required)
  - `source_url` (string, nullable)
  - `template_category` (string, nullable)
  - `template_id` (string, required)
  - `template_name` (string, required, for example "Pricing power")

### Responses

- `200`: OK
- `422`: Unprocessable Entity

### Example request

```bash
curl https://api.kumkuat.ai/api/v1/signals/themes \
  -H 'X-API-Key: <api key>'
```

### Example response

```json
{
  "pagination": {
    "page": 0,
    "per_page": 0,
    "total_count": 0,
    "total_extractions": 0,
    "total_pages": 0
  },
  "themes": [
    {
      "auto_tags": [],
      "content": "string",
      "content_type": "string",
      "created_at": "string",
      "document_id": "string",
      "extracted_date": "string"
    }
  ]
}
```

## Submit signal feedback

`POST /api/v1/signals/{signal_id}/feedback`

Submit feedback for a signal (thumbs up/down)

### Path parameters

- `signal_id` (string, required): Signal id.

### Responses

- `422`: Unprocessable Entity

### Example request

```bash
curl --globoff 'https://api.kumkuat.ai/api/v1/signals/{signal_id}/feedback' \
  -X POST \
  -H 'X-API-Key: <api key>'
```
