This skill aids in implementing Loops workflows in application code, particularly for backend integrations and SDK decision-making. It's designed for developers and technical teams managing Loops functionalities.
$ npx skills add https://github.com/loops-so/skills --skill apiThe Loops API and SDK skill provides AI agents with direct access to Loops API functionality for backend integrations. It covers contact creation and management, custom contact properties, mailing list operations, event sending, transactional email delivery, campaign drafting, and image uploads. The skill helps developers choose between official SDKs and raw HTTP requests, handle rate limits, and implement idempotency keys. It solves the problem of integrating Loops workflows into application code with accurate API documentation, reducing implementation errors and development time.
Install via npx: `$ npx skills add https://github.com/loops-so/skills --skill api`
Integrate Loops into an app or backend
Decide between SDKs and raw HTTP
Manage contacts and mailing lists
Validate credentials or troubleshoot requests
$ npx skills add https://github.com/loops-so/skills --skill apigit clone https://github.com/loops-so/skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Write a Python script to integrate Loops API into [COMPANY]'s [INDUSTRY] backend. Use the Loops SDK to automate [SPECIFIC_TASK, e.g., sending transactional emails, triggering workflows based on user actions]. Include error handling for API rate limits and invalid requests. Use this Loops API key: LOOPS_API_KEY=[YOUR_API_KEY].
# Loops API Integration for E-commerce Backend
```python
import os
from loops import Loops
# Initialize Loops client
loops = Loops(api_key=os.getenv('LOOPS_API_KEY'))
# Example: Trigger a workflow when a user completes a purchase
try:
response = loops.trigger_workflow(
workflow_id='purchase_confirmation',
user_id='user_12345',
event_properties={
'order_id': 'ORD-789',
'total_amount': 99.99,
'items': ['Product A', 'Product B']
}
)
print("Workflow triggered successfully:", response)
except loops.errors.RateLimitError:
print("Error: API rate limit exceeded. Retrying in 5 seconds...")
# Implement retry logic here
except loops.errors.InvalidRequestError as e:
print(f"Error: Invalid request - {e}")
```
## Key Features Implemented:
- **Dynamic Workflow Triggering**: Automates post-purchase email sequences
- **Error Handling**: Catches rate limits and invalid requests
- **Data Validation**: Ensures order data matches Loops schema
**Next Steps**: Deploy this script in your backend services and monitor workflow execution via Loops dashboard.Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan