curl --request GET \
--url https://api.credira.com/v1/email-templates?account_id=acc_987654321 \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
{
"success": true,
"data": [
{
"id": "template_123456789",
"account_id": "acc_987654321",
"name": "Payment Reminder Template",
"subject": "Payment Reminder - Invoice #{{invoice_number}}",
"category": "payment_reminder",
"status": "active",
"html_content": "<html><body><h1>Payment Reminder</h1><p>Dear {{customer_name}},</p><p>This is a reminder that your invoice #{{invoice_number}} for ${{amount}} is due on {{due_date}}.</p><p>Please make your payment as soon as possible.</p><p>Best regards,<br>Credira Team</p></body></html>",
"text_content": "Payment Reminder\n\nDear {{customer_name}},\n\nThis is a reminder that your invoice #{{invoice_number}} for ${{amount}} is due on {{due_date}}.\n\nPlease make your payment as soon as possible.\n\nBest regards,\nCredira Team",
"variables": ["customer_name", "invoice_number", "amount", "due_date"],
"created_time": "2024-01-15T10:30:00Z",
"updated_time": "2024-01-15T10:30:00Z",
"created_by": "user_456789123",
"usage_count": 150,
"last_used": "2024-01-15T09:30:00Z",
"metadata": {
"department": "billing",
"priority": "high",
"tags": ["payment", "reminder", "invoice"]
}
}
],
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"total_templates": 1
}
}
Retrieve email templates for an account
curl --request GET \
--url https://api.credira.com/v1/email-templates?account_id=acc_987654321 \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
{
"success": true,
"data": [
{
"id": "template_123456789",
"account_id": "acc_987654321",
"name": "Payment Reminder Template",
"subject": "Payment Reminder - Invoice #{{invoice_number}}",
"category": "payment_reminder",
"status": "active",
"html_content": "<html><body><h1>Payment Reminder</h1><p>Dear {{customer_name}},</p><p>This is a reminder that your invoice #{{invoice_number}} for ${{amount}} is due on {{due_date}}.</p><p>Please make your payment as soon as possible.</p><p>Best regards,<br>Credira Team</p></body></html>",
"text_content": "Payment Reminder\n\nDear {{customer_name}},\n\nThis is a reminder that your invoice #{{invoice_number}} for ${{amount}} is due on {{due_date}}.\n\nPlease make your payment as soon as possible.\n\nBest regards,\nCredira Team",
"variables": ["customer_name", "invoice_number", "amount", "due_date"],
"created_time": "2024-01-15T10:30:00Z",
"updated_time": "2024-01-15T10:30:00Z",
"created_by": "user_456789123",
"usage_count": 150,
"last_used": "2024-01-15T09:30:00Z",
"metadata": {
"department": "billing",
"priority": "high",
"tags": ["payment", "reminder", "invoice"]
}
}
],
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"total_templates": 1
}
}
active, inactive, draftpayment_reminder,
follow_up, welcome, notification, marketingcurl --request GET \
--url https://api.credira.com/v1/email-templates?account_id=acc_987654321 \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
{
"success": true,
"data": [
{
"id": "template_123456789",
"account_id": "acc_987654321",
"name": "Payment Reminder Template",
"subject": "Payment Reminder - Invoice #{{invoice_number}}",
"category": "payment_reminder",
"status": "active",
"html_content": "<html><body><h1>Payment Reminder</h1><p>Dear {{customer_name}},</p><p>This is a reminder that your invoice #{{invoice_number}} for ${{amount}} is due on {{due_date}}.</p><p>Please make your payment as soon as possible.</p><p>Best regards,<br>Credira Team</p></body></html>",
"text_content": "Payment Reminder\n\nDear {{customer_name}},\n\nThis is a reminder that your invoice #{{invoice_number}} for ${{amount}} is due on {{due_date}}.\n\nPlease make your payment as soon as possible.\n\nBest regards,\nCredira Team",
"variables": ["customer_name", "invoice_number", "amount", "due_date"],
"created_time": "2024-01-15T10:30:00Z",
"updated_time": "2024-01-15T10:30:00Z",
"created_by": "user_456789123",
"usage_count": 150,
"last_used": "2024-01-15T09:30:00Z",
"metadata": {
"department": "billing",
"priority": "high",
"tags": ["payment", "reminder", "invoice"]
}
}
],
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"total_templates": 1
}
}
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Missing required parameter: account_id"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Account not found"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}