> ## Documentation Index
> Fetch the complete documentation index at: https://supermemory-capy-add-llmstxt-summary-and.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Zapier

> Automate memory management with Supermemory in Zapier workflows

With Supermemory you can now easily add memory to your Zapier workflow steps. Here's how:

## Prerequisites

* A Supermemory API Key. Get yours [here](https://console.supermemory.ai)

## Step-by-step tutorial

For this tutorial, we're building a simple flow that adds incoming emails in Gmail to Supermemory.

<Steps>
  <Step title="Make a flow">
    Open your Zapier account and click on 'Zap' to make a new automation.

    <img src="https://mintcdn.com/supermemory-capy-add-llmstxt-summary-and/RZUchfWXNk8FOiN_/images/make-zap.png?fit=max&auto=format&n=RZUchfWXNk8FOiN_&q=85&s=2a885f6e74235f54f73ca00878a65420" alt="make a zap - annotated" width="2840" height="1353" data-path="images/make-zap.png" />
  </Step>

  <Step title="Add Gmail node">
    Add a new Gmail node that gets triggered on every new email. Connect to your Google account.

    <img src="https://mintcdn.com/supermemory-capy-add-llmstxt-summary-and/RZUchfWXNk8FOiN_/images/add-gmail-node-zapier.png?fit=max&auto=format&n=RZUchfWXNk8FOiN_&q=85&s=46e8d1cb8290147df98e77add1876881" alt="add gmail" width="2064" height="658" data-path="images/add-gmail-node-zapier.png" />
  </Step>

  <Step title="Add code block">
    Now, add a new 'Code by Zapier' block. Set it up to run Python.

    In the **Input Data** section, map the content field to the Gmail raw snippet.

    <img src="https://mintcdn.com/supermemory-capy-add-llmstxt-summary-and/RZUchfWXNk8FOiN_/images/map-content-to-gmail.png?fit=max&auto=format&n=RZUchfWXNk8FOiN_&q=85&s=f6730cc94343fd63789d38c2cfabc536" alt="" width="818" height="520" data-path="images/map-content-to-gmail.png" />
  </Step>

  <Step title="Integrate Supermemory">
    Since we're ingesting data here, we'll use the add documents endpoint.

    Add the following code block:

    ```python theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
        import requests

        url = "https://api.supermemory.ai/v3/documents"

        payload = { "content": inputData['content'], "containerTag": "gmail" }
        headers = {
            "Authorization": "Bearer YOUR_SM_API_KEY",
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers)

        print(response.json())
    ```

    The `inputData['content']` field maps to the Gmail content fetched from Zapier.

    <img src="https://mintcdn.com/supermemory-capy-add-llmstxt-summary-and/7wJD298SojLZvZDp/images/zapier-output.png?fit=max&auto=format&n=7wJD298SojLZvZDp&q=85&s=ecc7c14290a31a55efecfdc54af75456" alt="" width="888" height="802" data-path="images/zapier-output.png" />
  </Step>
</Steps>

<Note>
  Sometimes Zapier might show an error on the first test run. It usually works right after. Weird bug, we know.
</Note>

You can perform other operations like search, filtering, user profiles, etc., by using other Supermemory API endpoints which can be found in our API Reference tab.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.