Skip to content

Connect Sendoso to ChatGPT: Automate Campaigns and Gifting

Learn how to build a managed MCP server to connect Sendoso to ChatGPT. Automate eGifts, track physical sends, and orchestrate campaigns using natural language.

Uday Gajavalli Uday Gajavalli · · 9 min read
Connect Sendoso to ChatGPT: Automate Campaigns and Gifting

If you are reading this, you are likely trying to give an AI agent read and write access to your Sendoso account. Whether you want to automate physical swag distribution for HR onboarding, trigger eGifts based on sales pipeline stages, or audit your organization's sending budget, you need a Model Context Protocol (MCP) server. If your team uses Claude, check out our guide on connecting Sendoso to Claude or explore our broader architectural overview on connecting Sendoso to AI Agents.

Giving a Large Language Model (LLM) the ability to spend real money and send physical goods introduces high stakes. You have to handle OAuth 2.0 token lifecycles, map massive JSON schemas to MCP tool definitions, and deal with Sendoso's specific API design patterns. Every time an endpoint changes, you have to update your server code, redeploy, and test the integration.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Sendoso, connect it natively to ChatGPT, and execute complex enterprise gifting workflows using natural language.

The Engineering Reality of the Sendoso API

A custom MCP server is a self-hosted integration layer that translates an LLM's JSON-RPC tool calls into REST API requests. While the open MCP standard provides a predictable way for models to discover tools, the reality of implementing it against vendor APIs is painful. You own the entire API lifecycle.

Here are the specific integration challenges that break standard CRUD assumptions when working with Sendoso:

Touch IDs and Campaign Hierarchies

You do not simply send a "Starbucks gift card." In the Sendoso API, every send is tied to a specific touch_id. A Touch is the specific configuration of a campaign, including the item, the budget, the allowed senders, and the messaging parameters. If an LLM wants to send a gift, it must first query the campaigns endpoint, extract the correct touch_id for the desired item, verify the team group has the budget, and only then construct the send request. If your MCP server does not expose these relational dependencies clearly, the LLM will hallucinate invalid item IDs and fail.

The Address Collection State Machine

Sending physical gifts to B2B prospects often means you do not have their home address. Sendoso handles this via "Address Collection" links. The API requires specific payload flags like no_address, confirm_address, and expire_after_days. The LLM needs to understand that calling the physical gift endpoint in this mode does not immediately ship a product - it generates a tracking code and an address confirmation workflow. Your tool schemas must clearly document these state transitions so the agent can accurately report back to the user.

Rate Limits and 429 Errors

When an LLM agent executes a bulk gifting operation - for example, "send a $10 eGift to everyone who attended the webinar yesterday" - it might try to fire off dozens of POST requests in a tight loop. Sendoso enforces rate limits to prevent abuse.

It is critical to note that Truto does not retry, throttle, or apply backoff on rate limit errors. When the upstream Sendoso API returns an HTTP 429 Too Many Requests, Truto passes that error directly back to the caller. Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification. The caller (the LLM client or agent orchestrator) is strictly responsible for reading these headers and implementing its own retry or exponential backoff logic.

Flat Input Namespace vs Nested Payloads

When an MCP client calls a tool, all arguments arrive as a single flat object. The Sendoso API, however, requires deeply nested JSON payloads for recipient details, sender overrides, and shipping parameters. The MCP router must split and map the flat tool arguments into the exact nested schema the proxy API expects. If a query schema and body schema share a property name, the system must deterministically route it.

Instead of forcing your engineering team to build and maintain this translation layer, you can use Truto to auto-generate a Sendoso MCP server derived directly from API documentation.

Sendoso Hero Tools

Truto derives MCP tools dynamically from the integration's resource definitions and documentation records. A tool only appears in the MCP server if it has a corresponding documentation entry, ensuring only well-described endpoints are exposed to the LLM.

Here are the core Sendoso tools you can expose to ChatGPT.

list_all_sendoso_campaigns

To send any gift, the LLM must first know what is available. This tool returns all active campaigns, including their id (which acts as the touch_id for sends), name, description, and delivery type (physical vs eGift). The LLM uses this to map a human request ("send them the branded Yeti mug") to the exact identifier required by the API.

"List all active Sendoso campaigns for my team. Show me the campaign name, ID, and delivery type so I can choose the right touch ID for a physical gift."

create_a_sendoso_egift

This tool sends an eGift directly via Sendoso Email. It requires the touch_id identified from the campaigns list, the recipient's email, and the sender's details. The tool returns a success status, a message, a tracking code, and a tracking URL. The LLM can pass this tracking URL back to the user to confirm delivery.

"Send a $25 Amazon eGift to jane.doe@example.com using the 'Q3 Webinar Attendees' campaign touch ID. Provide the tracking URL once it is sent."

create_a_sendoso_physical_gift_address_collection

This is the workhorse for B2B physical swag. When you do not know where a recipient lives, this tool triggers the address confirmation workflow. It requires the touch_id, name, email, and specific flags like expire_after_days. The LLM uses this to initiate the send and get the tracking code without needing raw physical address data.

"Send a welcome kit to the new hire, John Smith, at john.smith@example.com. We do not have his home address, so use the address collection method and set the link to expire in 7 days."

list_all_sendoso_sends

This tool allows the LLM to track the status of gifts over time. It returns the send_gid, current total cost, status updates, recipient data, and touch data. The LLM can filter this data to find out if a specific physical gift has shipped or if an eGift was opened.

"Check the status of all sends from the past week. Are there any physical gifts stuck in the 'address confirmation pending' state?"

list_all_sendoso_groups

Budgeting in Sendoso is handled at the group level. This tool lists all active team groups, returning their ID, name, and available budget. Before executing a bulk send, an AI agent should call this tool to ensure the team has sufficient funds.

"List all Sendoso team groups and their available budgets. I need to make sure the Sales Development team has enough balance before I trigger these eGifts."

For the complete inventory of available Sendoso tools and their exact JSON schemas, review the Sendoso integration page.

Workflows in Action

Connecting Sendoso to ChatGPT unlocks complex, multi-step agentic workflows. Here is how a single natural language prompt translates into a sequence of specific tool calls.

Scenario 1: The Account-Based Marketing (ABM) Trigger

A sales rep wants to send a high-value physical gift to a champion at a target account, but needs to verify budget and find the right item first.

"I want to send the 'Executive Whiskey Set' to Sarah Connor at Cyberdyne. Please check if the Enterprise Sales group has enough budget, find the right campaign ID, and initiate the send using the address collection workflow so she can enter her shipping details."

Tool sequence:

  1. list_all_sendoso_groups: The agent fetches all groups to find "Enterprise Sales" and verifies its budget property.
  2. list_all_sendoso_campaigns: The agent searches the active campaigns to find the touch ID for the "Executive Whiskey Set".
  3. create_a_sendoso_physical_gift_address_collection: Using the retrieved group ID and touch ID, the agent posts the request with no_address: true and Sarah's email.

The user gets back a summary: "The Enterprise Sales group had $5,000 available. I found the Executive Whiskey Set (Touch ID: 8934) and initiated the send. Sarah will receive an email to confirm her address. The tracking code is TRK-99281."

Scenario 2: The HR Onboarding Audit

An HR administrator wants to verify that all new hires added to a specific team group last month received their onboarding swag.

"Get the list of all users in the 'New Hires Q3' team group. Then, check the recent sends to see if a 'Welcome Swag Box' was initiated for each of their email addresses."

Tool sequence:

  1. list_all_sendoso_groups: The agent finds the ID for the "New Hires Q3" group.
  2. list_all_sendoso_team_group_users: The agent retrieves the array of users belonging to that specific group ID.
  3. list_all_sendoso_sends: The agent pulls the recent sends history, parsing the recipient and touch properties.

The agent cross-references the two datasets in memory and responds: "I found 4 users in the New Hires Q3 group. Three of them have active tracking codes for the Welcome Swag Box. However, David Wallace does not have a corresponding send record. Would you like me to initiate one for him now?"

Creating the Managed MCP Server

You can generate an MCP server for your connected Sendoso account using either the Truto UI or the API. Each MCP server is backed by a cryptographic token stored in Cloudflare KV that encodes the specific integrated account, environment, and filtering configuration.

Method 1: Via the Truto UI

  1. Navigate to the integrated account page for your Sendoso connection in the Truto dashboard.
  2. Click the MCP Servers tab.
  3. Click Create MCP Server.
  4. Select your desired configuration (e.g., name, method restrictions, tags, and expiration date).
  5. Copy the generated MCP server URL. It will look like https://api.truto.one/mcp/a1b2c3d4e5f6....

Method 2: Via the API

The Truto API validates that the Sendoso integration is AI-ready (meaning it has documentation records), generates a secure token using an HMAC signing key, stores the configuration in D1 and KV, and returns the URL.

curl -X POST https://api.truto.one/integrated-account/{integrated_account_id}/mcp \
  -H "Authorization: Bearer YOUR_TRUTO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sendoso Marketing Agent",
    "config": {
      "methods": ["read", "create"],
      "tags": ["campaigns", "gifts"]
    }
  }'

The response will contain the url required for your MCP client.

Connecting the MCP Server to ChatGPT

Once you have the Truto MCP server URL, you can connect it to ChatGPT to grant the model access to Sendoso.

Method 1: Via the ChatGPT UI

  1. Open ChatGPT and navigate to Settings -> Apps -> Advanced settings.
  2. Enable Developer mode (MCP support requires this flag, available on Pro, Plus, Business, Enterprise, and Education accounts).
  3. Under MCP servers / Custom connectors, click to add a new server.
  4. Set the Name to "Sendoso (Truto)".
  5. Paste the Truto MCP URL into the Server URL field.
  6. Click Save. ChatGPT will immediately perform the JSON-RPC initialize handshake and call tools/list to discover the Sendoso endpoints.

Method 2: Via Manual Configuration File

If you are running a custom MCP orchestrator or using the Claude Desktop app, you can add the server via a JSON configuration file using the Server-Sent Events (SSE) transport.

{
  "mcpServers": {
    "sendoso-truto": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "--url",
        "https://api.truto.one/mcp/YOUR_TOKEN_HERE"
      ]
    }
  }
}

Security and Access Control

Giving an LLM the ability to spend real money requires strict governance. Truto provides multiple layers of access control baked directly into the MCP token configuration.

  • Method Filtering: You can restrict a server to specific operations via config.methods. Setting methods: ["read"] allows the LLM to call list_all_sendoso_campaigns and list_all_sendoso_sends, but completely blocks create_a_sendoso_egift. This is ideal for analytics or auditing agents.
  • Tag Filtering: You can group tools by functional area using config.tags. For example, applying a ["reporting"] tag ensures the LLM can only access endpoints tagged accordingly in the integration's configuration.
  • Require API Token Auth: By default, possession of the MCP URL is sufficient to call tools. For elevated security, setting require_api_token_auth: true forces the MCP client to also pass a valid Truto API token in the Authorization header. This prevents unauthorized execution if the MCP URL is ever leaked in logs.
  • Automatic Expiration: You can set an expires_at ISO datetime when creating the server. Truto uses Cloudflare KV TTLs and a Durable Object alarm to automatically delete the token and configuration at the exact specified time, ensuring temporary contractor or script access is never left dangling.

Automate Sendoso at Scale

Building a custom MCP server for Sendoso means writing pagination handlers, mapping deeply nested JSON schemas to flat LLM arguments, and building state machines for address collection. It turns a product feature into an infrastructure maintenance burden.

By leveraging Truto's dynamic tool generation, your engineering team can treat MCP servers as disposable, highly-scoped infrastructure. You generate a URL, pass it to ChatGPT, and let the model execute complex gifting workflows against live data instantly.

FAQ

Does Truto automatically handle Sendoso API rate limits?
No. Truto does not retry, throttle, or apply backoff on rate limit errors. When the upstream Sendoso API returns an HTTP 429, Truto passes that error to the caller along with standardized rate limit headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The caller is responsible for retry logic.
How do I restrict the ChatGPT agent from actually spending money?
When creating the MCP server in Truto, you can use Method Filtering. By setting the configuration to methods: ["read"], you restrict the MCP server to read-only operations like listing campaigns and checking budgets, entirely blocking create or update operations.
Can I use the Sendoso MCP server for temporary workflows?
Yes. You can specify an expires_at datetime when generating the MCP server. Truto will automatically clean up the token and disable access at the specified time using automated Durable Object alarms.
Do I need to maintain JSON schemas for the Sendoso tools?
No. Truto dynamically derives the tool definitions, descriptions, and JSON schemas from the underlying Sendoso integration documentation records on the fly. When Sendoso updates an endpoint, the tool schema updates automatically.

More from our Blog