# Meltwater

> Manage Meltwater saved searches and tags; search mentions; inspect exports, account metadata and usage; watch searches and tags.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/meltwater

## Actions

### Add document tags

Add document tags.

**Inputs**

- Company ID (`company_id`, text): Set the company where the change will be applied
- Document IDs (`document_ids`, list, required): Document IDs.
- Tags (`tag_ids`, list, required): Tags.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "data": "example"
  }
}
```

### Count mentions

Count mentions.

**Inputs**

- Id (`id`, number, required): Search id
- Company ID (`company_id`, text): Company which owns the given search. If not specified your default company is used.
- Start date (`start_date`, date and time): The start date of the search to count result for. Default: `two weeks ago` in ISO8601 format. Must include a timezone offset, for example `2024-04-01T00:00:00Z`.
- End date (`end_date`, date and time): The end date of the search to count result for. Default: `now` in ISO8601 format. Must include a timezone offset, for example `2024-04-30T23:59:59Z`.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "count": {
      "total": 901382
    }
  }
}
```

### Create search

Create search.

**Inputs**

- Company ID (`company_id`, text): Company which owns the given search. If not specified your default company is used.
- Name (`name`, text, required): The name associated with this search
- Query (`query`, object, required): Query associated with a search
- Id (`id`, number): Identifier

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "search": {
      "id": 1025,
      "name": "Electric Cars",
      "query": {
        "boolean": "cars AND electric",
        "case_sensitivity": false,
        "filter_set": null
      },
      "updated": "2020-08-23T08:25:56Z"
    }
  }
}
```

### Create tag

Create tag.

**Inputs**

- Company ID (`company_id`, text): Company which will own the new tag. If not specified, your default company is used.
- Name (`name`, text, required): Name.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "tag": {
      "id": 123,
      "name": "new-tag"
    }
  }
}
```

### Delete search

Delete search.

**Inputs**

- Id (`id`, number, required): Search id
- Company ID (`company_id`, text): Company which owns the given search. If not specified your default company is used.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {}
}
```

### Delete tag

Delete tag.

**Inputs**

- Tag (`tag_id`, number, required): Tag ID
- Company ID (`company_id`, text): Company which owns the tag to be deleted. If not specified, your default company is used.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {}
}
```

### Get export

Get export.

**Inputs**

- Id (`id`, number, required): One-time export id

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "onetime_export": {
      "company_name": "example",
      "end_date": "2020-03-29T23:59:59.000000Z",
      "id": 1,
      "searches": [],
      "start_date": "2020-03-25T00:00:00.000000Z"
    }
  }
}
```

### Get search

Get search.

**Inputs**

- Id (`id`, number, required): Search id
- Company ID (`company_id`, text): Company which owns the given search. If not specified your default company is used.
- Expand combined (`expand_combined`, true/false): For combined searches, show whether the ids belongs to a search, filter set or custom category

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "search": {
      "id": 1024,
      "name": "Electric Cars",
      "query": {
        "boolean": "Tesla OR (Volvo NEAR electric)",
        "case_sensitivity": "no",
        "filter_set": null,
        "type": "boolean"
      },
      "updated": "2020-08-23T08:25:56Z"
    }
  }
}
```

### Get usage

Get usage.

**Inputs**

- Token ID (`token_id`, text): Optional API token ID to filter usage
- Period (`period`, text): The time period for this statistics query. One of: `24hours`, `7days`, `30days`, `12months`.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {}
}
```

### List companies

List companies.

**Inputs**: None.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "companies": [
      {
        "id": "61d07a1eb6b501051b5af3d7",
        "name": "Meltwater"
      }
    ]
  }
}
```

### List custom categories

List custom categories.

**Inputs**

- Company ID (`company_id`, text): Company which owns the given custom categories. If not specified your default company is used.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "count": 2,
    "custom_categories": [
      {
        "id": 123,
        "name": "Japanese cars",
        "type": "include"
      },
      {
        "id": 456,
        "name": "German cars",
        "type": "exclude"
      }
    ]
  }
}
```

### List exports

List exports.

**Inputs**: None.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "onetime_exports": []
  }
}
```

### List filter sets

List filter sets.

**Inputs**

- Company ID (`company_id`, text): Company which owns the given filter sets. If not specified your default company is used.
- Include quickpicks (`include_quickpicks`, true/false): Include meltwater-provided QUICKPICK filter sets, default "false"

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "filter_sets": [
      {
        "id": 123,
        "name": "English and from the UK",
        "subtype": "custom",
        "type": "saved"
      },
      {
        "id": 456,
        "name": "Well known french journalists",
        "subtype": "quickpick",
        "type": "saved"
      }
    ]
  }
}
```

### List hooks

List hooks.

**Inputs**: None.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {}
}
```

### List searches

List searches.

**Inputs**

- Company ID (`company_id`, text): Company which owns the given search. If not specified your default company is used.
- Query type (`query_type`, text): Only return searches of the specified query type, if omitted searches of all query types will be returned. One of: `boolean`, `keyword`, `combined`.
- Expand combined (`expand_combined`, true/false): For combined searches, show whether the ids belongs to a search, filter set or custom category

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "searches": [
      {
        "id": 1025,
        "name": "Electric Cars",
        "updated": "2020-08-23T08:25:56Z"
      },
      {
        "id": 1027,
        "name": "Pokemon",
        "updated": "2020-08-23T08:25:56Z"
      }
    ]
  }
}
```

### List tags

List tags.

**Inputs**

- Company ID (`company_id`, text): Company which owns the given tags. If not specified your default company is used.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "tags": [
      {
        "id": 123456,
        "name": "my tag"
      }
    ]
  }
}
```

### List workspaces

List workspaces.

**Inputs**: None.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "count": 0,
    "workspaces": [
      {
        "created_at": "2023-09-19T14:54:38Z",
        "description": "My awesome workspace",
        "id": "61d07a1eb6b501051b5af3d7",
        "name": "My Workspace"
      }
    ]
  }
}
```

### Remove document tags

Remove document tags.

**Inputs**

- Company ID (`company_id`, text): Set the company where the change will be applied
- Document IDs (`document_ids`, list, required): Document IDs.
- Tags (`tag_ids`, list, required): Tags.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "data": "example"
  }
}
```

### Search mentions

Search mentions.

**Inputs**

- Id (`id`, number, required): Search ID
- Company ID (`company_id`, text): Set the company to search by
- Countries (`countries`, list): Countries.
- End (`end`, date and time): End.
- Languages (`languages`, list): Languages.
- Page (`page`, number): Page. At most 10.
- Page size (`page_size`, number): Page size. From 0 to 100.
- Sentiments (`sentiments`, list): Sentiments.
- Sort by (`sort_by`, text): Sort by. One of: `date`, `country`, `sentiment`, `language`, `title`, `reach`, `relevance`, `engagement`, `social_echo` (Social echo), `prominence`, `views`.
- Sort order (`sort_order`, text): Sort order. One of: `asc`, `desc`.
- Sources (`sources`, list): Sources.
- Start (`start`, date and time): Start.
- Template (`template`, object): Template.
- Keywords (`keywords`, list): List of keywords to filter documents by.
- Emojis (`emojis`, list): List of emojis to filter documents by.
- Custom categories (`custom_categories`, list): List of custom category IDs to filter documents by.
- Filter set (`filter_set`, text): ID of a filter set to apply.
- Author lists (`author_lists`, list): List of author list IDs to filter documents by.

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "tz": "Europe/London"
  }
}
```

### Update search

Update search.

**Inputs**

- Id (`id`, number, required): Search id
- Company ID (`company_id`, text): Company which owns the given search. If not specified your default company is used.
- Name (`name`, text): The name associated with this search
- Query (`query`, object): Query associated with a search

**Outputs**

- `response` (object): The complete service response, including resource data and pagination fields.

**Example output**

```json
{
  "response": {
    "search": {
      "id": 1025,
      "name": "Electric Cars",
      "query": {
        "boolean": "cars AND electric",
        "case_sensitivity": false,
        "filter_set": null
      },
      "updated": "2020-08-23T08:25:56Z"
    }
  }
}
```
