Docs/Platform Integrations/Zapier

Zapier

Add Trappr security monitoring to your Zapier AI actions using the Webhooks by Zapier or Code by Zapier step — no custom apps needed.


Overview

Zapier's native OpenAI integration doesn't expose a custom base URL, so the recommended approach is to replace the OpenAI action with a Webhooks by Zapier → POST step that calls the Trappr Gateway directly. The gateway is fully OpenAI API-compatible, so the request body and response structure are identical.

Zapier Trigger
any trigger
Webhooks: POST
custom HTTP step
Trappr Gateway
monitor · protect
LLM Provider
completion response

Setup

1
Add a "Webhooks by Zapier — POST" action to your Zap

In your Zap editor, add a new action step. Search for Webhooks by Zapierand select the POST event. This lets you make a fully custom HTTP request.

2
Configure the request

Set the following fields:

FieldValue
URLhttps://gateway.trappr.net/v1/chat/completions
Payload TypeJSON
Headers — AuthorizationBearer cht_gw_XXXX
Headers — Content-Typeapplication/json
3
Set the request body

In the Data field, enter the OpenAI-compatible JSON body. Use Zapier field mapping for dynamic content:

JSON
{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "{{zap_field_content}}"
    }
  ],
  "temperature": 0.5
}
4
Test and verify

Run the Zap test. The LLM response comes back in the webhook response body — map choices[0].message.content to your downstream steps. Confirm the call appears in Trappr → Gateway → Logs.

Using Code by Zapier

If you prefer to keep the logic in a code step, use Code by Zapier → JavaScript:

JavaScript
const response = await fetch("https://gateway.trappr.net/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + inputData.trappr_key,
    "Content-Type":  "application/json",
  },
  body: JSON.stringify({
    model:    "gpt-4o",
    messages: [
      { role: "system", content: "You are a support assistant." },
      { role: "user",   content: inputData.user_message },
    ],
  }),
});

const data = await response.json();
return { reply: data.choices[0].message.content };
Store your Trappr Gateway key in Zapier's Secret Manager(available on paid plans) or pass it as an environment variable through Zap input fields. Never hardcode it directly in the code step.

Parsing the response

The Trappr Gateway returns the exact same response format as the OpenAI API. Map the completion content using:

Text
choices → 0 → message → content