> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sambanova.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Zapier integration guide

[Zapier](https://zapier.com/) is a no-code automation platform that connects thousands of apps into automated workflows called Zaps. You can call SambaNova models from any Zap using the Webhooks by Zapier action, which sends a request to the SambaNova chat completions endpoint and makes the reply available to every later step.

<Note>
  Zapier's built-in AI steps, such as AI by Zapier and Zapier Chatbots, offer no custom endpoint field. Use Webhooks by Zapier as described on this page, which reaches SambaNova from any Zap without either.
</Note>

## Prerequisites

Before you begin, ensure you have:

### SambaNova endpoint

You can connect to SambaNova using one of the following options:

* SambaCloud (Free account)
  * Base URL: `https://api.sambanova.ai/v1/chat/completions`
  * API key: [Available in your dashboard](https://cloud.sambanova.ai/apis?utm_source=zapier\&utm_medium=external\&utm_campaign=cloud_signup)
* SambaStack (Dedicated deployment)
  * Base URL and API key: Provided by your SambaNova contact.

### Zapier account

A [Zapier account](https://zapier.com/) on the Professional plan or higher. Webhooks by Zapier is not available on the Free plan, and it powers every step on this page.

## Create a chat completion

<Steps>
  <Step title="Add a trigger">
    Create a Zap and choose any trigger that suits your workflow. The examples below use **Schedule by Zapier** with the **Every Day** event, which needs no
    connection and is useful while you test.
  </Step>

  <Step title="Add the Webhooks action">
    Add an action step, select **Webhooks by Zapier**, and choose the
    **Custom Request** event. Custom Request lets you send a raw JSON body, which
    the chat completions endpoint requires.

    <Note>
      Zapier then offers **API by Zapier**, which stores credentials in a reusable
      App Connection instead of a header. It is a reasonable alternative if you
      would rather not keep the key in the step itself, but the rest of this page
      assumes Custom Request. Select **Cancel** to continue.
    </Note>
  </Step>

  <Step title="Configure the request">
    Set the following fields:

    | Field | Value |
    | :- | :- |
    | Method | `POST` |
    | URL | `https://api.sambanova.ai/v1/chat/completions` |
    | Data | The JSON body shown below |
    | Unflatten | `No` |
    | Return Raw Response | `No`, which is the default |
    | Headers | `Authorization` with value `Bearer YOUR_SAMBANOVA_API_KEY`, and `Content-Type` with value `application/json` |

    Use this as the **Data** value, replacing the message content with your own
    text or with a field from an earlier step:

    ```json theme={}
    {
      "model": "MiniMax-M3",
      "max_tokens": 2000,
      "messages": [
        { "role": "user", "content": "What can you do?" }
      ]
    }
    ```

    <Warning>
      Set **Unflatten** to `No`. It defaults to `Yes`, which rewrites nested
      structures and corrupts the `messages` array, so the request fails with an
      HTTP 400 before it reaches the model.
    </Warning>

    <Note>
      Leave **Return Raw Response** at its default of `No`. That default is what
      makes Zapier split the reply into named fields such as
      **Choices Message Content**. Setting it to `Yes` returns the response as one
      unparsed string, and the field this guide maps in later steps no longer
      appears.
    </Note>

    <Frame>
      <img src="https://mintcdn.com/sambanova-systems/CchL6LllN5ADVV9o/images/docs/integrations/zapier/zapier-webhook-configuration.png?fit=max&auto=format&n=CchL6LllN5ADVV9o&q=85&s=c1af09351d550ff0abca6bceff3d40ab" alt="Zapier Custom Request configuration with Unflatten set to No and headers for Authorization and Content-Type." width="1470" height="725" data-path="images/docs/integrations/zapier/zapier-webhook-configuration.png" />
    </Frame>
  </Step>

  <Step title="Test the step">
    Select **Test step**. Zapier sends the request and maps the response into
    fields you can use later in the Zap. The model's reply appears in
    **Choices Message Content**.

    <Frame>
      <img src="https://mintcdn.com/sambanova-systems/CchL6LllN5ADVV9o/images/docs/integrations/zapier/zapier-webhook-response.png?fit=max&auto=format&n=CchL6LllN5ADVV9o&q=85&s=f8ba22aac514465a7be7ded279d2924a" alt="Zapier Data out panel showing the Choices Message Content field containing the reply returned by MiniMax-M3." width="1470" height="725" data-path="images/docs/integrations/zapier/zapier-webhook-response.png" />
    </Frame>
  </Step>

  <Step title="Use the reply in later steps">
    In any following step, insert the **Choices Message Content** field to pass the
    model's answer into Slack, Gmail, Google Sheets, or any other app.

    <Note>
      Reasoning models such as `MiniMax-M3` also return a
      **Choices Message Reasoning** field holding their internal reasoning. Map
      **Choices Message Content** for the answer itself.
    </Note>

    <Frame>
      <img src="https://mintcdn.com/sambanova-systems/CchL6LllN5ADVV9o/images/docs/integrations/zapier/zapier-field-mapping.png?fit=max&auto=format&n=CchL6LllN5ADVV9o&q=85&s=f43152b4bf9f6dc9c5c015722d5e398f" alt="Zapier field picker listing the Custom Request outputs, with Choices Message Content holding the reply and Choices Message Reasoning listed separately." width="1470" height="725" data-path="images/docs/integrations/zapier/zapier-field-mapping.png" />
    </Frame>
  </Step>
</Steps>

## Example: triage incoming support tickets

The chat completion above uses a fixed prompt. A real Zap passes data from the
trigger into the prompt and sends the model's answer somewhere useful. This
example receives a support ticket, asks SambaNova to triage it, and emails the
result. It uses built-in Zapier apps only, so you can build it without
connecting any other account.

<Steps>
  <Step title="Catch the incoming ticket">
    Add a **Webhooks by Zapier** trigger with the **Catch Hook** event. Zapier
    gives you a URL. Send your ticket data to it as JSON, either from your
    helpdesk or from a terminal while testing:

    ```bash theme={}
    curl -X POST "https://hooks.zapier.com/hooks/catch/YOUR/HOOK/" \
      -H "Content-Type: application/json" \
      -d '{"customer":"Dana Whitfield","subject":"Billing charged twice this month","message":"I was charged 49.00 twice on the 3rd and again on the 4th. Can you refund the duplicate?"}'
    ```

    Select **Test trigger**. Each JSON key becomes a field you can use later.
  </Step>

  <Step title="Ask SambaNova to triage it">
    Add the **Custom Request** action exactly as described above, then build the
    **Data** body so the ticket text is part of the prompt. Insert the trigger
    fields with the **+** button next to the field rather than typing them:

    ```json theme={}
    {
      "model": "MiniMax-M3",
      "max_tokens": 2000,
      "messages": [
        {
          "role": "system",
          "content": "You are a support triage assistant. Reply with urgency (low, medium, high), a one-line summary, and a short draft reply to the customer."
        },
        {
          "role": "user",
          "content": "Subject: <Subject field>. Message: <Message field>"
        }
      ]
    }
    ```

    A system message is what makes the output predictable enough to act on. It
    fixes the shape of the answer, so later steps can rely on it.
  </Step>

  <Step title="Send the result">
    Add an **Email by Zapier** action with the **Send Outbound Email** event. Set
    **Body** to the **Choices Message Content** field from the SambaNova step, and
    put the ticket subject in the email subject so the triage is easy to scan.

    <Note>
      Email by Zapier sends up to 5 emails per day on Free and Trial plans, and up
      to 10 per hour on paid plans. Swap in Gmail, Slack, or your helpdesk once
      the flow works.
    </Note>
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/sambanova-systems/CchL6LllN5ADVV9o/images/docs/integrations/zapier/zapier-complete-flow.png?fit=max&auto=format&n=CchL6LllN5ADVV9o&q=85&s=abcdb70c59fe67d967e75fb0166bd13b" alt="Three step Zap: a Catch Hook trigger, a Custom Request action calling SambaNova, and a Send Outbound Email action, each marked complete." width="1470" height="725" data-path="images/docs/integrations/zapier/zapier-complete-flow.png" />
</Frame>

For the ticket above, `MiniMax-M3` returned urgency **Medium**, a one-line
summary of the duplicate charge, and a drafted reply offering the refund and a
processing time. The whole flow needs no app to be published and no model to be
hosted, so the same pattern works for classifying leads, summarizing form
submissions, or drafting responses to anything a webhook can reach.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The app returned 400">
    * Set **Unflatten** to `No`. The default of `Yes` rewrites the nested `messages` array into a shape the endpoint rejects. This is the most common cause.
    * Confirm the **Data** field holds valid JSON, and that `model`, `messages`, and each message's `role` and `content` are present.
    * Confirm the model ID exists in your account. See [SambaCloud models](/docs/en/models/sambacloud-models).
  </Accordion>

  <Accordion title="We could not parse the JSON body of your request">
    The **Data** field is not valid JSON by the time Zapier sends it.

    * Confirm the field holds exactly one JSON object. Editing in place can leave a second object appended after the first, which is not valid JSON even though both halves look correct.
    * Insert trigger fields with the **+** button rather than typing placeholders by hand.
    * Paste the resolved body from the **Data in** tab into a JSON validator to see where it breaks.
  </Accordion>

  <Accordion title="The app returned 401">
    * Confirm the `Authorization` header value begins with `Bearer ` followed by your key.
    * Get a new key from the [SambaCloud portal](https://cloud.sambanova.ai/apis?utm_source=zapier\&utm_medium=external\&utm_campaign=cloud_signup).
    * Put the key in the `Authorization` header rather than the **Basic Auth** field, which sends a different authentication scheme.
  </Accordion>

  <Accordion title="The app returned 429">
    Your Zaps are exceeding your account's request limits. Reduce how often the Zap
    runs, or add a **Delay** step between calls. See
    [rate limits](/docs/en/models/rate-limits) for the limits that apply to your tier.
  </Accordion>

  <Accordion title="Webhooks by Zapier is unavailable">
    Webhooks by Zapier requires the Professional plan or higher and does not appear
    on the Free plan. Check your plan in Zapier, or start a trial to evaluate the
    integration.
  </Accordion>

  <Accordion title="Choices Message Content is empty or truncated">
    Reasoning models return their reasoning separately from the answer. Map
    **Choices Message Content**, not **Choices Message Reasoning**. If `max_tokens`
    is too low, generation can be cut off while the model is still reasoning, so
    **Choices Message Content** comes back empty, or cut off mid-sentence if the
    limit is hit just after the answer starts. Raise `max_tokens` so the model has
    room to finish reasoning and still produce its answer.
  </Accordion>
</AccordionGroup>

## Related

* [Make integration guide](/docs/en/integrations/make)
* [n8n integration guide](/docs/en/integrations/n8n)
