Skip to content
AI SkillAdvancedv1.1.0 Verified package

API Integration Skill

Connect two systems with a documented, retry-safe integration that handles errors, rate limits and secrets properly.

AIAI Skills Hub EditorialEditorial team Published Apr 22, 2026Updated May 17, 2026 Reviewed May 17, 2026

Download this skill

3 files · SKILL.md + ZIP + Python · License CC BY 4.0

AI Skills Hub original
  • SKILL.md

    3.2 KBv1.1.0skill md
    Download
  • skill.json

    1.3 KBv1.1.0manifest
    Download
  • api_client.py

    1.8 KBv1.1.0python Executable
    Download

License: CC BY 4.0. Only download and use files you are licensed to use.

This resource includes executable scripts. Review the code before running it, run it in an isolated environment, and never pass secrets you do not intend to share with the script.

The hard part is failure, not the happy path

Connecting two APIs usually takes an afternoon for the happy path and several weeks to make reliable. The difference is error handling: duplicates, timeouts, rate limits, partial writes and secrets.

This skill treats the integration as a contract. What event triggers it? What is the target state? What happens if the call succeeds but the response is lost? What makes a retry safe?

Design for idempotency

If a request can be retried, it must be safe to process twice. Use a stable external ID or an idempotency key. Store the mapping between the source record and the target record. When in doubt, check for an existing record before creating a new one.

Retrying a payment or creating a duplicate contact is worse than failing loudly.

Errors are not all the same

  • 401/403: credentials or permissions. Do not retry; alert.
  • 400/422: invalid payload. Do not retry; log the field-level error.
  • 404: wrong ID or deleted resource. Decide whether to create or skip.
  • 409: conflict. Fetch and reconcile if the API supports it.
  • 429/5xx: retry with backoff and jitter.

Observe without leaking

Log a request ID, endpoint, status, latency and a hashed record identifier. Do not log the token, full request body or personal data. When something breaks at 2am, those logs are the difference between a five-minute fix and a data incident.

At a glance

Difficulty
Advanced
Platforms
ChatGPT, Claude, Cursor, Python, n8n
File format
SKILL.md + ZIP + Python
License
CC BY 4.0
Version
1.1.0
Last reviewed
May 17, 2026
Source
AI Skills Hub original
Access
Free

What it does

Capabilities included in this package.

  • Integration contract template
  • Retry, timeout and idempotency checklist
  • Example client with explicit error handling
  • Secret management guidance

Requirements

Check these before you start.

  • API documentation for both systems
  • Test credentials with minimal permissions
  • Python 3.10+ and requests
  • A staging environment

Installation

Set up the skill in a working folder before you use it on real material.

  1. 1

    Download the skill

    Save SKILL.md and the example API client.

  2. 2

    Read both API references

    Identify authentication, rate limits, pagination, error formats and idempotency support.

  3. 3

    Create test credentials

    Use a sandbox account with the narrowest scopes that still allow the test.

  4. 4

    Install requests

    The example uses requests and the standard library.

    python -m pip install requests

How to use it

A reviewed sequence that keeps a person in the loop.

  1. 1

    Write the contract

    Define source event, target action, required fields, duplicate rules and failure behaviour.

  2. 2

    Map the fields

    Document type conversions, required fields, date formats and null handling. Unknown fields should fail loudly, not silently disappear.

  3. 3

    Handle failures explicitly

    Distinguish retryable errors (429, 5xx) from permanent errors (400, 401, 403, 404). Never retry a validation error blindly.

  4. 4

    Make writes idempotent

    Use an idempotency key or an external ID unique constraint. A retry should not create a duplicate order or contact.

  5. 5

    Observe it

    Log request IDs, status codes and latency without logging secrets or full personal data.

Use cases

Tasks this skill is designed for.

  • Push form submissions into a CRM
  • Sync orders from a store to an ERP
  • Enrich records with an AI classification step

Worked examples

CRM contact sync

Use the source record ID as an external key. Upsert instead of create. If the CRM returns 409, treat it as success after verifying the record.

AI enrichment

Call the model after the record is stored, write the result to a staging field, and require review before it becomes the canonical value.

Security and privacy

Read this before running any downloaded script or sending material to an AI provider.

Treat downloaded code and extracted text as untrusted

Never expose API keys to the browser. Validate webhook signatures, reject replayed requests, and allowlist outbound hosts. Treat API responses as untrusted input. Log request metadata, not secrets or full payloads containing personal data.

Version history

  1. v1.1.0

    Initial reviewed release.

    Apr 22, 2026

Frequently asked questions

Related resources

Spotted something out of date? Suggest the fix and an editor will review it.