# StackAdapt

> Run StackAdapt programmatic campaigns: manage advertisers, pause and resume campaign groups, campaigns and ads, and report delivery and conversions.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/stackadapt

## Actions

### Archive ads

Archive one or more ads, which stops them running.

**Inputs**

- Ads (`ad_ids`, list, required): The ads.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "ads": [
      {
        "brandname": "example",
        "campaign": {
          "id": "example",
          "name": "example"
        },
        "channelType": "example",
        "clickUrl": "example",
        "creativeSize": "example",
        "creativeStatus": {
          "state": "example",
          "status": "example"
        },
        "id": "example",
        "isArchived": true,
        "isDraft": true,
        "isRejected": true,
        "name": "example",
        "paused": true
      }
    ],
    "changed": 1
  }
}
```

### Archive advertiser

Archive an advertiser. Restore advertiser brings it back.

**Inputs**

- Advertiser (`advertiser_id`, text, required): The advertiser.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": "example"
  }
}
```

### Archive campaign

Archive a campaign, which stops it. Restore campaign brings it back.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": "example"
  }
}
```

### Create advertiser

Add an advertiser to your account.

**Inputs**

- Name (`name`, text, required): The advertiser's name.
- Description (`description`, text): A description of the advertiser.
- Excluded domains (`domain_exclusions`, list): Websites the advertiser's ads must never run on.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "description": "example",
    "domainExclusions": [
      "example"
    ],
    "id": "example",
    "isArchived": true,
    "name": "example"
  }
}
```

### Get account

Get your StackAdapt account's ID and currency.

**Inputs**: None.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "currency": "example",
    "id": "example"
  }
}
```

### Get ad delivery

Get each ad's impressions, clicks, conversions, cost and revenue over a period.

**Inputs**

- From (`start_date`, date, required): The first day of the report.
- To (`end_date`, date, required): The last day of the report.
- Split by (`granularity`, text): How to split the period. Leave empty for one total per row. One of: `TOTAL` (No split (totals)), `DAILY` (Day), `WEEKLY` (Week), `MONTHLY` (Month).
- Advertisers (`advertiser_ids`, list): Only these advertisers. Leave empty for all of them.
- Campaigns (`campaign_ids`, list): Only these campaigns.
- Limit (`first`, number): How many to return, up to 100. Leave empty for 100. From 1 to 100.
- After (`after`, text): The endCursor of the previous page, for the next page.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "pageInfo": {
      "endCursor": "example",
      "hasNextPage": true
    },
    "records": [
      {
        "ad": {
          "id": "example",
          "name": "example"
        },
        "campaign": {
          "id": "example",
          "name": "example"
        },
        "metrics": {
          "clicks": 1,
          "conversions": 1,
          "cost": 1,
          "ctr": 1,
          "cvr": 1,
          "ecpa": 1,
          "ecpc": 1,
          "ecpm": 1,
          "impressions": 1,
          "revenue": 1,
          "roas": 1,
          "uniqueImpressions": 1
        },
        "period": {
          "endTime": "example",
          "startTime": "example",
          "type": "example"
        }
      }
    ],
    "totalCount": 1,
    "totalStats": {
      "clicks": 1,
      "conversions": 1,
      "cost": 1,
      "ctr": 1,
      "cvr": 1,
      "ecpa": 1,
      "ecpc": 1,
      "ecpm": 1,
      "impressions": 1,
      "revenue": 1,
      "roas": 1,
      "uniqueImpressions": 1
    }
  }
}
```

### Get advertiser

Get an advertiser's name, description and excluded domains.

**Inputs**

- Advertiser (`advertiser_id`, text, required): The advertiser.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "description": "example",
    "domainExclusions": [
      "example"
    ],
    "id": "example",
    "isArchived": true,
    "name": "example"
  }
}
```

### Get advertiser delivery

Get each advertiser's impressions, clicks, conversions, cost and revenue over a period.

**Inputs**

- From (`start_date`, date, required): The first day of the report.
- To (`end_date`, date, required): The last day of the report.
- Split by (`granularity`, text): How to split the period. Leave empty for one total per row. One of: `TOTAL` (No split (totals)), `DAILY` (Day), `WEEKLY` (Week), `MONTHLY` (Month).
- Advertisers (`advertiser_ids`, list): Only these advertisers. Leave empty for all of them.
- Limit (`first`, number): How many to return, up to 100. Leave empty for 100. From 1 to 100.
- After (`after`, text): The endCursor of the previous page, for the next page.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "pageInfo": {
      "endCursor": "example",
      "hasNextPage": true
    },
    "records": [
      {
        "advertiser": {
          "id": "example",
          "name": "example"
        },
        "metrics": {
          "clicks": 1,
          "conversions": 1,
          "cost": 1,
          "ctr": 1,
          "cvr": 1,
          "ecpa": 1,
          "ecpc": 1,
          "ecpm": 1,
          "impressions": 1,
          "revenue": 1,
          "roas": 1,
          "uniqueImpressions": 1
        },
        "period": {
          "endTime": "example",
          "startTime": "example",
          "type": "example"
        }
      }
    ],
    "totalCount": 1,
    "totalStats": {
      "clicks": 1,
      "conversions": 1,
      "cost": 1,
      "ctr": 1,
      "cvr": 1,
      "ecpa": 1,
      "ecpc": 1,
      "ecpm": 1,
      "impressions": 1,
      "revenue": 1,
      "roas": 1,
      "uniqueImpressions": 1
    }
  }
}
```

### Get campaign

Get a campaign's status and why, its channel, advertiser and campaign group.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "advertiser": {
      "id": "example",
      "name": "example"
    },
    "campaignGroup": {
      "id": "example",
      "name": "example"
    },
    "campaignStatus": {
      "state": "example",
      "status": "example"
    },
    "channelType": "example",
    "createdAt": "example",
    "id": "example",
    "isArchived": true,
    "isDraft": true,
    "name": "example",
    "timezone": "example",
    "updatedAt": "example"
  }
}
```

### Get campaign delivery

Get each campaign's impressions, clicks, conversions, cost and revenue over a period.

**Inputs**

- From (`start_date`, date, required): The first day of the report.
- To (`end_date`, date, required): The last day of the report.
- Split by (`granularity`, text): How to split the period. Leave empty for one total per row. One of: `TOTAL` (No split (totals)), `DAILY` (Day), `WEEKLY` (Week), `MONTHLY` (Month).
- Advertisers (`advertiser_ids`, list): Only these advertisers. Leave empty for all of them.
- Campaign groups (`campaign_group_ids`, list): Only these campaign groups.
- Campaigns (`campaign_ids`, list): Only these campaigns.
- Limit (`first`, number): How many to return, up to 100. Leave empty for 100. From 1 to 100.
- After (`after`, text): The endCursor of the previous page, for the next page.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "pageInfo": {
      "endCursor": "example",
      "hasNextPage": true
    },
    "records": [
      {
        "campaign": {
          "id": "example",
          "name": "example"
        },
        "metrics": {
          "clicks": 1,
          "conversions": 1,
          "cost": 1,
          "ctr": 1,
          "cvr": 1,
          "ecpa": 1,
          "ecpc": 1,
          "ecpm": 1,
          "impressions": 1,
          "revenue": 1,
          "roas": 1,
          "uniqueImpressions": 1
        },
        "period": {
          "endTime": "example",
          "startTime": "example",
          "type": "example"
        }
      }
    ],
    "totalCount": 1,
    "totalStats": {
      "clicks": 1,
      "conversions": 1,
      "cost": 1,
      "ctr": 1,
      "cvr": 1,
      "ecpa": 1,
      "ecpc": 1,
      "ecpm": 1,
      "impressions": 1,
      "revenue": 1,
      "roas": 1,
      "uniqueImpressions": 1
    }
  }
}
```

### Get campaign group

Get a campaign group's status, budget type, time zone and advertiser.

**Inputs**

- Campaign group (`campaign_group_id`, text, required): The campaign group.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "advertiser": {
      "id": "example",
      "name": "example"
    },
    "budgetType": "example",
    "campaignGroupStatus": {
      "state": "example",
      "status": "example"
    },
    "createdAt": "example",
    "id": "example",
    "isArchived": true,
    "name": "example",
    "timezone": "example"
  }
}
```

### List ads

List ads (creatives), with their review status, size and campaign.

**Inputs**

- Advertisers (`advertiser_ids`, list): Only these advertisers. Leave empty for all of them.
- Campaigns (`campaign_ids`, list): Only these campaigns.
- Status (`states`, list): Only ads in these states. One or more of: `LIVE`, `APPROVED` (Not started), `PENDING` (Ads pending review), `PAUSED`, `ENDED`, `REJECTED` (Ads rejected), `DRAFT`, `ERROR` (Has a problem).
- Name or ID contains (`search`, text): Only those whose name or ID contains this text.
- Archived (`archived`, true/false): On for only archived ones, off for only active ones. Leave empty for both.
- Limit (`first`, number): How many to return, up to 100. Leave empty for 100. From 1 to 100.
- After (`after`, text): The endCursor of the previous page, for the next page.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "nodes": [
      {
        "brandname": "example",
        "campaign": {
          "id": "example",
          "name": "example"
        },
        "channelType": "example",
        "clickUrl": "example",
        "creativeSize": "example",
        "creativeStatus": {
          "state": "example",
          "status": "example"
        },
        "id": "example",
        "isArchived": true,
        "isDraft": true,
        "isRejected": true,
        "name": "example",
        "paused": true
      }
    ],
    "pageInfo": {
      "endCursor": "example",
      "hasNextPage": true
    },
    "totalCount": 1
  }
}
```

### List advertisers

List the advertisers in your account, by name or whether they are archived.

**Inputs**

- Name or ID contains (`search`, text): Only those whose name or ID contains this text.
- Archived (`archived`, true/false): On for only archived ones, off for only active ones. Leave empty for both.
- Limit (`first`, number): How many to return, up to 100. Leave empty for 100. From 1 to 100.
- After (`after`, text): The endCursor of the previous page, for the next page.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "nodes": [
      {
        "description": "example",
        "domainExclusions": [
          "example"
        ],
        "id": "example",
        "isArchived": true,
        "name": "example"
      }
    ],
    "pageInfo": {
      "endCursor": "example",
      "hasNextPage": true
    },
    "totalCount": 1
  }
}
```

### List campaign groups

List campaign groups, with their status and advertiser.

**Inputs**

- Advertisers (`advertiser_ids`, list): Only these advertisers. Leave empty for all of them.
- Status (`group_states`, list): Only groups in these states. One or more of: `LIVE`, `PAUSED`, `ENDED`, `INACTIVE`, `EMPTY` (No campaigns).
- Name or ID contains (`search`, text): Only those whose name or ID contains this text.
- Archived (`archived`, true/false): On for only archived ones, off for only active ones. Leave empty for both.
- Limit (`first`, number): How many to return, up to 100. Leave empty for 100. From 1 to 100.
- After (`after`, text): The endCursor of the previous page, for the next page.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "nodes": [
      {
        "advertiser": {
          "id": "example",
          "name": "example"
        },
        "budgetType": "example",
        "campaignGroupStatus": {
          "state": "example",
          "status": "example"
        },
        "createdAt": "example",
        "id": "example",
        "isArchived": true,
        "name": "example",
        "timezone": "example"
      }
    ],
    "pageInfo": {
      "endCursor": "example",
      "hasNextPage": true
    },
    "totalCount": 1
  }
}
```

### List campaigns

List campaigns, with their status, channel, advertiser and campaign group.

**Inputs**

- Advertisers (`advertiser_ids`, list): Only these advertisers. Leave empty for all of them.
- Campaign groups (`campaign_group_ids`, list): Only these campaign groups.
- Status (`states`, list): Only campaigns in these states. One or more of: `LIVE`, `PENDING` (Ads pending review), `APPROVED` (Not started), `PAUSED`, `ENDED`, `REJECTED` (Ads rejected), `DRAFT`, `ERROR` (Has a problem).
- Channels (`channels`, list): Only campaigns on these channels. One or more of: `NATIVE`, `DISPLAY`, `VIDEO`, `CTV` (Connected TV), `AUDIO`, `DOOH` (Digital out-of-home).
- Name or ID contains (`search`, text): Only those whose name or ID contains this text.
- Archived (`archived`, true/false): On for only archived ones, off for only active ones. Leave empty for both.
- Limit (`first`, number): How many to return, up to 100. Leave empty for 100. From 1 to 100.
- After (`after`, text): The endCursor of the previous page, for the next page.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "nodes": [
      {
        "advertiser": {
          "id": "example",
          "name": "example"
        },
        "campaignGroup": {
          "id": "example",
          "name": "example"
        },
        "campaignStatus": {
          "state": "example",
          "status": "example"
        },
        "channelType": "example",
        "createdAt": "example",
        "id": "example",
        "isArchived": true,
        "isDraft": true,
        "name": "example",
        "timezone": "example",
        "updatedAt": "example"
      }
    ],
    "pageInfo": {
      "endCursor": "example",
      "hasNextPage": true
    },
    "totalCount": 1
  }
}
```

### List conversion pixels

List your account's conversion pixels, with the key each fires with.

**Inputs**

- Name or key contains (`search`, text): Only pixels whose name or key contains this text.
- Limit (`first`, number): How many to return, up to 100. Leave empty for 100. From 1 to 100.
- After (`after`, text): The endCursor of the previous page, for the next page.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "nodes": [
      {
        "advertiserIds": [
          "example"
        ],
        "description": "example",
        "id": "example",
        "isLegacyPixel": true,
        "name": "example",
        "uniqueKey": "example"
      }
    ],
    "pageInfo": {
      "endCursor": "example",
      "hasNextPage": true
    },
    "totalCount": 1
  }
}
```

### Pause ads

Pause one or more ads.

**Inputs**

- Ads (`ad_ids`, list, required): The ads.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "ads": [
      {
        "brandname": "example",
        "campaign": {
          "id": "example",
          "name": "example"
        },
        "channelType": "example",
        "clickUrl": "example",
        "creativeSize": "example",
        "creativeStatus": {
          "state": "example",
          "status": "example"
        },
        "id": "example",
        "isArchived": true,
        "isDraft": true,
        "isRejected": true,
        "name": "example",
        "paused": true
      }
    ],
    "changed": 1
  }
}
```

### Pause campaign group

Pause a campaign group, which pauses every campaign in it.

**Inputs**

- Campaign group (`campaign_group_id`, text, required): The campaign group.
- Reason (`reason`, text): Why it is paused, for StackAdapt's records. Leave empty for other. One of: `PERFORMANCE`, `GOAL_REACHED` (Goal reached), `BRAND_LIFT` (Brand lift study), `RECREATING` (Being recreated), `OTHER`.
- Note (`reason_text`, text): A note on why it is paused.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "advertiser": {
      "id": "example",
      "name": "example"
    },
    "budgetType": "example",
    "campaignGroupStatus": {
      "state": "example",
      "status": "example"
    },
    "createdAt": "example",
    "id": "example",
    "isArchived": true,
    "name": "example",
    "timezone": "example"
  }
}
```

### Pause campaigns

Pause one or more campaigns.

**Inputs**

- Campaigns (`campaign_ids`, list, required): The campaigns.
- Reason (`reason`, text): Why it is paused, for StackAdapt's records. Leave empty for other. One of: `PERFORMANCE`, `GOAL_REACHED` (Goal reached), `BRAND_LIFT` (Brand lift study), `RECREATING` (Being recreated), `OTHER`.
- Note (`reason_text`, text): A note on why it is paused.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "campaigns": [
      {
        "advertiser": {
          "id": "example",
          "name": "example"
        },
        "campaignGroup": {
          "id": "example",
          "name": "example"
        },
        "campaignStatus": {
          "state": "example",
          "status": "example"
        },
        "channelType": "example",
        "createdAt": "example",
        "id": "example",
        "isArchived": true,
        "isDraft": true,
        "name": "example",
        "timezone": "example",
        "updatedAt": "example"
      }
    ],
    "changed": 1
  }
}
```

### Restore advertiser

Bring back an archived advertiser.

**Inputs**

- Advertiser (`advertiser_id`, text, required): The archived advertiser.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": "example"
  }
}
```

### Restore campaign

Bring back an archived campaign.

**Inputs**

- Campaign (`campaign_id`, text, required): The archived campaign.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "done": true,
    "id": "example"
  }
}
```

### Resume ads

Set one or more paused ads running again.

**Inputs**

- Ads (`ad_ids`, list, required): The ads.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "ads": [
      {
        "brandname": "example",
        "campaign": {
          "id": "example",
          "name": "example"
        },
        "channelType": "example",
        "clickUrl": "example",
        "creativeSize": "example",
        "creativeStatus": {
          "state": "example",
          "status": "example"
        },
        "id": "example",
        "isArchived": true,
        "isDraft": true,
        "isRejected": true,
        "name": "example",
        "paused": true
      }
    ],
    "changed": 1
  }
}
```

### Resume campaign group

Set a paused campaign group running again.

**Inputs**

- Campaign group (`campaign_group_id`, text, required): The campaign group.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "advertiser": {
      "id": "example",
      "name": "example"
    },
    "budgetType": "example",
    "campaignGroupStatus": {
      "state": "example",
      "status": "example"
    },
    "createdAt": "example",
    "id": "example",
    "isArchived": true,
    "name": "example",
    "timezone": "example"
  }
}
```

### Resume campaigns

Set one or more paused campaigns running again.

**Inputs**

- Campaigns (`campaign_ids`, list, required): The campaigns.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "campaigns": [
      {
        "advertiser": {
          "id": "example",
          "name": "example"
        },
        "campaignGroup": {
          "id": "example",
          "name": "example"
        },
        "campaignStatus": {
          "state": "example",
          "status": "example"
        },
        "channelType": "example",
        "createdAt": "example",
        "id": "example",
        "isArchived": true,
        "isDraft": true,
        "name": "example",
        "timezone": "example",
        "updatedAt": "example"
      }
    ],
    "changed": 1
  }
}
```

### Update advertiser

Change an advertiser's name, description or excluded domains. Fields left empty stay as they are.

**Inputs**

- Advertiser (`advertiser_id`, text, required): The advertiser.
- Name (`name`, text): The new name.
- Description (`description`, text): The new description.
- Excluded domains (`domain_exclusions`, list): The full list of websites the advertiser's ads must never run on.

**Outputs**

- `data` (object): The response from StackAdapt.

**Example output**

```json
{
  "data": {
    "description": "example",
    "domainExclusions": [
      "example"
    ],
    "id": "example",
    "isArchived": true,
    "name": "example"
  }
}
```
