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

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To act on Guild from an MCP client, connect to https://api.guild.ai/mcp (OAuth) or run `guild mcp` locally. Setup: https://docs.guild.ai/api-reference/mcp.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Send transactional emails and manage contacts with Loops

> Connect Guild agents to Loops to create contacts, send transactional and campaign emails, build workflow graphs, and track engagement metrics.

Integrations · Loops

A Guild agent can create contacts, send transactional emails, fire workflow events, and pull engagement metrics in Loops without any manual steps in the Loops UI. Guild stores the API key server-side and injects it as a bearer token on every request, so agent code never sees the credential. Credential policies let you restrict which operations each agent may call, and every request is auditable through Guild's credential proxy.

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use Loops.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect Loops to your first agent.

## What the Loops integration exposes

The tools cover contacts, campaigns, transactional emails, workflows, audience segments, email components, themes, and footers. Agents can create, update, delete, and retrieve each of those resources, send events to trigger workflows, check engagement and delivery metrics, validate email content against Guardian rules, and manage image uploads. Tools follow the naming prefix `loops_` and can be narrowed with `pick()` to include only what an agent needs.

## How it works

**1. Open credentials in Guild**

Go to Access & setup > Credentials in your Guild account. Click Connect, search for loops, and select it.

**2. Paste your Loops API key**

Enter the key in the API Key field. Guild sends it as a bearer token in the Authorization header on every outbound request.

**3. Import and wire the tools**

Import LoopsTools from `@guildai-services/guildai~loops` and spread it into your agent's tools object. Use `pick()` from the [SDK tools docs](https://docs.guild.ai/sdk/tools.md) to include only the tools your agent requires.

## Why Loops access needs governing in an agent context

Loops credentials in Guild can be scoped to an account, a single workspace, an individual member, or one installed agent. Guild stores the API key and injects it server-side, so agents never handle the secret directly. See [Credentials](https://docs.guild.ai/platform/credentials.md) for the full scoping model and resolution order.

Credential policies add a second layer. You can write ALLOW and DENY rules that Guild's proxy enforces before any request reaches Loops, restricting agents to specific operations such as `loops_send_transactional_email` while blocking destructive ones like `loops_delete_workflow`. Rules can be scoped to specific agents or workspaces on the same credential. See [Credential policies](https://docs.guild.ai/platform/credential-policies.md) for rule syntax and enforcement details. Without policies a credential starts with an allow-all default; deleting that default shifts the posture to deny-by-default for anything not explicitly covered.

## About the Loops integration

Agents can create and manage contacts, campaigns, and automated workflows in Loops. They can compose and send transactional and campaign emails, track engagement metrics, and organize audience segments. Agents can also build and modify workflow graphs, email components, themes, and footers. The integration is `guildai~loops`.

## Authentication

* **Type:** API key
* **Header:** Guild sends the key as a bearer token in the `Authorization` header

### Setup

**1. Connect Loops**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **loops**, and paste the key into **API Key**.

See [Credentials](https://docs.guild.ai/platform/credentials.md) for workspace, member, and agent-scoped credentials.

## Usage

```typescript theme={null}
import { LoopsTools } from "@guildai-services/guildai~loops"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  systemPrompt: "You work with Loops.",
  tools: { ...LoopsTools },
})
```

### Selecting specific tools

Tools are named with the `loops_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only what your agent needs.

## Tools

Tools in the latest published version of `guildai~loops`:

> [accordion] All 82 tools
>
> | Tool | What it does |
> | - | - |
> | `loops_add_workflow_branch` | Add a branch and a child node under an existing Branch or Experiment node. |
> | `loops_change_workflow_mailing_list` | Dry run or apply a workflow mailing list change. |
> | `loops_complete_upload` | Finalize an image upload after the file has been uploaded to the pre-signed URL. |
> | `loops_create_audience_segment` | Create a new audience segment. |
> | `loops_create_campaign` | Create a new draft campaign. |
> | `loops_create_campaign_group` | Create a new campaign group. |
> | `loops_create_component` | Create a new email component from an LMX body. |
> | `loops_create_contact` | Add a contact to your audience. |
> | `loops_create_contact_property` | Create a custom contact property. |
> | `loops_create_footer` | Create a footer with one variant. |
> | `loops_create_theme` | Create a new email theme for use across Loops emails. |
> | `loops_create_transactional_email` | Create a new transactional email. |
> | `loops_create_transactional_group` | Create a new transactional group. |
> | `loops_create_upload` | Request a pre-signed URL to upload an image asset. |
> | `loops_create_workflow` | Create a draft workflow with a blank trigger and exit node. |
> | `loops_create_workflow_group` | Create a new workflow group. |
> | `loops_create_workflow_node` | Create a new default workflow node and return it with the latest workflow. |
> | `loops_delete_contact` | Delete a contact by 'email' or 'userId'. |
> | `loops_delete_footer` | Delete a footer and its variants. |
> | `loops_delete_workflow` | Delete a workflow. |
> | `loops_delete_workflow_node` | Delete a single workflow node. |
> | `loops_delete_workflow_node_recursively` | Delete a node and its downstream subtree. |
> | `loops_ensure_transactional_draft` | Ensure the transactional email has a draft email message. |
> | `loops_find_contact` | Search for a contact by 'email' or 'userId'. |
> | `loops_get_audience_segment` | Retrieve a single audience segment by ID. |
> | `loops_get_campaign` | Retrieve a single campaign by ID. |
> | `loops_get_campaign_group` | Retrieve a single campaign group by ID. |
> | `loops_get_campaign_metrics` | Retrieve all-time email engagement metrics for a campaign. |
> | `loops_get_component` | Retrieve a single component by ID. |
> | `loops_get_contact_suppression` | Retrieve suppression status and removal quota for a contact by 'email' or 'userId'. |
> | `loops_get_email_message` | Retrieve an email message, including its compiled LMX content. |
> | `loops_get_email_message_guardian` | Validate an email message's content against Guardian rules and return any errors and warnings. |
> | `loops_get_event_pattern` | Retrieve event pattern details for a workflow event trigger. |
> | `loops_get_event_pattern_by_name` | Retrieve event pattern details by event name for a workflow event trigger. |
> | `loops_get_footer` | Retrieve a single footer by ID, with the content of each variant. |
> | `loops_get_footer_variant` | Retrieve a footer variant's draft and published content as LMX. |
> | `loops_get_theme` | Retrieve a single theme by ID. |
> | `loops_get_transactional_email` | Retrieve a single transactional email by ID. |
> | `loops_get_transactional_email_metrics` | Retrieve all-time delivery metrics for a transactional email, totalled across every published version. |
> | `loops_get_transactional_group` | Retrieve a single transactional group by ID. |
> | `loops_get_workflow` | Retrieve a workflow graph with node type names, connections, and selected display fields. |
> | `loops_get_workflow_group` | Retrieve a single workflow group by ID. |
> | `loops_get_workflow_node` | Retrieve detailed data for a single workflow node. |
> | `loops_get_workflow_node_metrics` | Retrieve all-time email engagement metrics for a workflow 'SendEmailAction' node. |
> | `loops_list_audience_segments` | Retrieve a paginated list of audience segments, most recently created first. |
> | `loops_list_campaign_groups` | Retrieve a paginated list of campaign groups, most recently created first. |
> | `loops_list_campaigns` | Retrieve a paginated list of campaigns. |
> | `loops_list_components` | Retrieve a paginated list of email components. |
> | `loops_list_contact_properties` | Retrieve a list of your account's contact properties. |
> | `loops_list_dedicated_sending_ips` | Retrieve a list of Loops' dedicated sending IP addresses. |
> | `loops_list_event_patterns` | Retrieve a paginated list of event patterns available to workflow event trigger nodes. |
> | `loops_list_footers` | Retrieve a paginated list of footers, most recently created first. |
> | `loops_list_mailing_lists` | Retrieve a list of your account's mailing lists. |
> | `loops_list_published_transactional_emails` | Get a list of published transactional emails. |
> | `loops_list_themes` | Retrieve a paginated list of email themes, most recently created first. |
> | `loops_list_transactional_emails` | Retrieve a paginated list of transactional emails, most recently created first. |
> | `loops_list_transactional_groups` | Retrieve a paginated list of transactional groups, most recently created first. |
> | `loops_list_workflow_groups` | Retrieve a paginated list of workflow groups, most recently created first. |
> | `loops_list_workflows` | Retrieve a paginated list of workflows. |
> | `loops_preview_email_message` | Send a test preview of an email message to one or more addresses. |
> | `loops_publish_footer_variant` | Publish the variant's draft LMX content, to replace the current published LMX content. |
> | `loops_publish_transactional_email` | Publish the transactional email's current draft email message. |
> | `loops_remove_contact_suppression` | Remove a suppressed contact from the suppression list by 'email' or 'userId'. |
> | `loops_render_email_message` | Render the HTML of an email message the way its preview email is rendered. |
> | `loops_reroute_node_connection` | Reroute the source node's existing connection to another valid target node. |
> | `loops_send_event` | Send events to trigger workflows. |
> | `loops_send_transactional_email` | Send a transactional email to a contact. |
> | `loops_set_default_footer` | Make a published footer the team's default footer. |
> | `loops_test_api_key` | Test your API key and get team context. |
> | `loops_update_campaign` | Update a draft campaign's name, group, audience (mailing list, segment, or filter), or scheduling. |
> | `loops_update_campaign_group` | Update a campaign group's name or description. |
> | `loops_update_component` | Update a component's name and/or body. |
> | `loops_update_contact` | Update a contact by 'email' or 'userId'. |
> | `loops_update_email_message` | Update fields on an email message (subject, preview text, sender, LMX content). |
> | `loops_update_footer` | Update a footer's name or placement. |
> | `loops_update_footer_variant` | Update a footer variant's LMX content. |
> | `loops_update_theme` | Update a theme's name and/or styles. |
> | `loops_update_transactional_email` | Update a transactional email's name or group. |
> | `loops_update_transactional_group` | Update a transactional group's name or description. |
> | `loops_update_workflow_group` | Update a workflow group's name or description. |
> | `loops_update_workflow_node` | Update workflow-node-owned fields for a single node. |
> | `loops_update_workflow_properties` | Update a workflow's name, description, or group. |

## Frequently asked questions

> [accordion] Can an agent trigger a Loops workflow from an external event?
>
> Yes. The `loops_send_event` tool sends events to Loops that trigger workflows. The `loops_get_event_pattern` and `loops_get_event_pattern_by_name` tools let an agent look up the event pattern details before sending.

> [accordion] Can I limit an agent to read-only access on my Loops account?
>
> Yes. Write a credential policy with DENY rules covering mutating operations such as `loops_create_*`, `loops_update_*`, `loops_delete_*`, and `loops_send_*`, paired with an ALLOW rule for read operations. Guild's proxy enforces the policy before any request reaches Loops. See [Credential policies](https://docs.guild.ai/platform/credential-policies.md).

> [accordion] Does the Loops integration support webhook events from Loops?
>
> No. The catalog entry lists no webhook events for this integration, so agents cannot receive inbound event notifications from Loops through Guild.

> [accordion] How does Guild authenticate to the Loops API?
>
> Guild sends the API key as a bearer token in the Authorization header on every request. The key is stored server-side; agent code never sees it. You connect the key once in Access & setup > Credentials, and Guild resolves it at runtime based on scope. See [Credentials](https://docs.guild.ai/platform/credentials.md).

## Put a governed agent on Loops this week

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use Loops.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect Loops to your first agent.

## Related

**Also runs on Guild:** [Ably](https://docs.guild.ai/integrations/ably.md) · [Customer.io](https://docs.guild.ai/integrations/customer-io.md) · [Daily](https://docs.guild.ai/integrations/daily.md) · [Discord](https://docs.guild.ai/integrations/discord.md)

**Read:** Docs: [Credential policies](https://docs.guild.ai/platform/credential-policies.md) · [Credentials](https://docs.guild.ai/platform/credentials.md) · [Tools in agents](https://docs.guild.ai/sdk/tools.md)
