> For the complete documentation index, see [llms.txt](https://docs.countercyclical.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.countercyclical.io/~/changes/ZwrMx5xpgOpgFGNOVADb/developers/endpoints/integrations/zapier.md).

# Zapier

API endpoints related to our integration with Zapier

## Getting Started

As always, all of our API endpoints start with the same base URL:

```
https://api.countercyclical.io
```

*See the* [*example*](https://docs.countercyclical.io/~/changes/ZwrMx5xpgOpgFGNOVADb/developers/authentication#example) *in our API documentation above for more information*

## Authentication

{% hint style="warning" %}
An API key is required in order to authenticate successfully between Zapier & Countercyclical. Please visit our Integrations page on the platform to generate your Zapier-specific API key: <https://dashboard.countercyclical.io/settings/workspace/integrations>

*This API is scoped purely to Zapier & cannot be used on any of Countercyclical's other publicly available API endpoints (otherwise a* `401 Unauthorized` *response will be sent back)*
{% endhint %}

### Connecting Zapier & Countercyclical

<mark style="color:green;">`POST`</mark> `/zapier/auth`

Authenticate with Zapier on Countercyclical

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

| Name     | Type   | Description                                                                                                                                            |
| -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `apiKey` | string | API key generated in the [Zapier](/~/changes/ZwrMx5xpgOpgFGNOVADb/fundamentals/settings/workspace/integrations/zapier.md) integration on our platform. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "success": true,
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid API key."
}
```

{% endtab %}
{% endtabs %}

## Triggers

{% hint style="info" %}
Triggers are an event in Countercyclical (e.g., an Investment being created) that initiates a workflow in Zapier.

Learn more about Triggers in [Zapier's Help Center](https://help.zapier.com/hc/en-us/articles/8496288188429-Set-up-your-Zap-trigger)
{% endhint %}

### Investments

<mark style="color:green;">`GET`</mark> `/zapier/triggers/investments`

Kicks off a [Zap](https://help.zapier.com/hc/en-us/articles/8496309697421-Create-Zaps) in Zapier based on an Investment created in your workspace.

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Query Parameters**

| Name     | Type   | Description                                                                                                                                            |
| -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `apiKey` | string | API key generated in the [Zapier](/~/changes/ZwrMx5xpgOpgFGNOVADb/fundamentals/settings/workspace/integrations/zapier.md) integration on our platform. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "id": 1,
  "name": "John",
  "age": 30
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request."
}
```

{% endtab %}
{% endtabs %}

## Actions

{% hint style="info" %}
Actions in Zapier are a task that is performed as part of the workflow (e.g., creating an Investment in Countercyclical)

Learn more about Actions in [Zapier's Help Center](https://help.zapier.com/hc/en-us/articles/8496257774221-Set-up-your-Zap-action)
{% endhint %}

### Investments

#### Create a New Investment

<mark style="color:green;">`POST`</mark> `/zapier/actions/investments`

Creates a new Investment in your Countercyclical Workspace

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Query Parameters**

| Name     | Value                                                                                                                                                  |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `apiKey` | API key generated in the [Zapier](/~/changes/ZwrMx5xpgOpgFGNOVADb/fundamentals/settings/workspace/integrations/zapier.md) integration on our platform. |

**Body**

| Name           | Type   | Description                                                                                                                                                                     |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tickerSymbol` | string | The ticker symbol for a publicly-traded company (following [NASDAQ Symbology](https://www.nasdaqtrader.com/Trader.aspx?id=CQSSymbolConvention) is recommended for best results) |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "success": true,
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request."
}
```

{% endtab %}
{% endtabs %}
