API Documentation

Integrate SmartMarty AI into your applications with our powerful RESTful API

Getting Started

The SmartMarty AI API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.

Base URL

https://smartmarty.ca/api

Authentication

Authenticate your API requests by including your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Email Endpoints

POST /email/sync

Sync emails from an email account

Request Parameters

Parameter Type Description
email string Email address to sync
password string Base64 encoded password
imap_server string IMAP server address
imap_port integer IMAP port (default: 993)

Example Request

curl -X POST https://smartmarty.ca/api/email/sync \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com", "password": "BASE64_PASSWORD", "imap_server": "imap.gmail.com", "imap_port": 993 }'
POST /email/generate-replies

Generate AI-powered email replies

Request Parameters

Parameter Type Description
from string Sender email address
subject string Email subject
body string Email body content
count integer Number of reply options (1-4)

Example Request

curl -X POST https://smartmarty.ca/api/email/generate-replies \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "from": "sender@example.com", "subject": "Meeting Request", "body": "Can we schedule a meeting?", "count": 4 }'

Example Response

{ "replies": [ { "tone": "Professional", "body": "Thank you for reaching out..." }, { "tone": "Friendly", "body": "Hi! I'd be happy to meet..." }, { "tone": "Brief", "body": "Yes, let's schedule it..." }, { "tone": "Direct", "body": "I'm available next week..." } ] }
POST /email/send

Send an email

Request Parameters

Parameter Type Description
to string Recipient email address
subject string Email subject
body string Email body content
account object Email account credentials

Authentication Endpoints

POST /auth/register

Register a new user account

POST /auth/login

Login and receive access token

GET /auth/me

Get current user information

Rate Limits

API requests are limited to prevent abuse and ensure service quality:

Support

Need help with the API? Contact our developer support team at api@smartmarty.ca