mailtrap/mailtrap-skills

managing-contacts

>- Use when using Mailtrap Contacts API or UI to add, update, bulk import, list, segment marketing contacts, custom fields, or custom events. Use when syncing contacts from a CRM or warehouse, or building audiences for campaigns.

First seen Apr 9, 2026

Installation

$ npx skills add mailtrap/mailtrap-skills --skill managing-contacts

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from mailtrap/mailtrap-skills.

npx skills add mailtrap/mailtrap-skills

Browse all from mailtrap/mailtrap-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 10
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 7,428 B
  • docs SUMMARY.md 251 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 35 installs

SKILL.md

Managing Mailtrap contacts

Overview

Before generating API request bodies: check the Contacts OpenAPI spec for current field names, required parameters, and nested structures.

Contacts are the marketing database: lists, segments, custom fields, and imports for campaign audiences and related workflows. The Contacts API automates create/update and can feed CRM or CDP sync (your code, or tools like Zapier, Make, n8n — see Import contacts).

Suppressions (hard bounces, spam complaints, unsubscribes on the sending side) live in the sending product and block delivery for those addresses on your streams. That is applied separately from marketing filters (segments, list membership, consent flags) that decide who is eligible for campaigns. For sending-side blocks, see Suppressions and skill sending-emails.

Related skills: authorizing-api-requests (tokens, env vars, account_id resolution), sending-emails (live send paths).

When to use

  • Programmatic contact management (create, update, bulk import)
  • Sync with CRMs or data warehouses
  • Contact list cleanup and CSV import
  • Updating contacts with custom fields or firing custom events for automations
  • Segments and custom fields for audience building

Authorization

All endpoints below need Authorization: Bearer $MAILTRAPAPITOKEN and an $MAILTRAPACCOUNTID in the path. See skill authorizing-api-requests for token scope, storage, and the one-liner that resolves $MAILTRAPACCOUNTID from GET https://mailtrap.io/api/accounts.

Endpoints (replace placeholders)

Action Method URL Reference
Create / get / update / delete contact various https://mailtrap.io/api/accounts/$MAILTRAPACCOUNTID/contacts Contacts
Bulk import (async job) POST https://mailtrap.io/api/accounts/$MAILTRAPACCOUNTID/contacts/imports Bulk import
Contact lists various https://mailtrap.io/api/accounts/$MAILTRAPACCOUNTID/contacts/lists Contact lists
Custom fields various https://mailtrap.io/api/accounts/$MAILTRAPACCOUNTID/contacts/fields Contact fields
Custom events POST https://mailtrap.io/api/accounts/$MAILTRAPACCOUNTID/contacts/{contact_identifier}/events Contact events
Export contacts various https://mailtrap.io/api/accounts/$MAILTRAPACCOUNTID/contacts/exports Export contacts
  • Rate limit (typical): 200 requests per 60 seconds per account — prefer bulk import for large loads.
  • Bulk import limit: up to 50,000 contacts per import request (async job); poll import status with GET .../contacts/imports/{import_id}. See Bulk import.

Examples (curl)

Single contact create (with custom fields)

curl -X POST "https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/contacts" \
  -H "Authorization: Bearer $MAILTRAP_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "contact": {
      "email": "[email protected]",
      "fields": {"first_name": "John", "last_name": "Smith", "company": "Example Inc"},
      "list_ids": [1, 2, 3]
    }
  }'

Bulk import (array of contacts)

curl -X POST "https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/contacts/imports" \
  -H "Authorization: Bearer $MAILTRAP_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "contacts": [
      {"email": "[email protected]", "fields": {"first_name": "John"}, "list_ids_included": [1, 2]},
      {"email": "[email protected]", "fields": {"first_name": "Jane"}, "list_ids_included": [1]}
    ]
  }'

Custom event (event name + payload)

curl -X POST "https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/contacts/{contact_identifier}/events" \
  -H "Authorization: Bearer $MAILTRAP_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name": "UserLogin", "params": {"user_id": 101, "is_active": true}}'

Concepts

  • Lists — explicitly defined list of contacts.
  • Segments — dynamic groups; see Segments.
  • Custom fields — properties like first and last name or membership level; see Custom fields.
  • Custom events — POST .../events with an event name and params object for automations.

CRM and sync

Campaigns use case

Contacts power marketing campaigns: you maintain clean lists, consent, and attributes here; campaign authoring and scheduling are product features documented in Campaigns.

Common mistakes

Mistake Fix
Hitting rate limits with one-by-one creates Use /contacts/imports for bulk loads (respect 50k per request) and backoff
Treating marketing contacts as sending suppressions Use Suppressions for blocked recipients on send streams