# Help Scout Developer APIs This file documents the public APIs available through Help Scout's developer platform for integration and automation purposes. ## Inbox API 2.0 (Primary API) **Base URL:** https://api.helpscout.net/v2 **Authentication:** OAuth 2.0 (Authorization Code & Client Credentials flows) **Rate Limits:** 200 requests/minute per account, 12 write requests per 5 seconds burst limit **Format:** HAL+JSON with embedded resources and pagination The primary REST API for managing Help Scout conversations, customers, and support operations. ### Authentication Example **Client Credentials Flow:** ```bash curl -X POST https://api.helpscout.net/v2/oauth2/token \ --data "grant_type=client_credentials" \ --data "client_id={application_id}" \ --data "client_secret={application_secret}" ``` **Response:** ```json { "token_type": "bearer", "access_token": "369dbb08be58430086d2f8bd832bc1eb", "expires_in": 172800 } ``` ### Conversations **GET /v2/conversations** - List conversations with advanced filtering List conversations with support for complex queries, custom field filtering, and sorting. Example with filtering: ```bash curl -H "Authorization: Bearer {token}" \ "https://api.helpscout.net/v2/conversations?mailbox=123&status=active&query=(subject:\"rainbow\")" ``` Advanced query examples: - Subject search: `query=(subject:"rainbow")` - Tag search: `query=(tag:"urgent")` - Date range: `query=(modifiedAt:[2024-01-01T00:00:00Z TO *])` - Email search: `query=(email:"john@example.com")` - NOT operator: `query=(NOT email:"spam@domain.com")` - Custom fields: `customFieldsByIds=123:blue,234:99` Response: ```json { "_embedded": { "conversations": [{ "id": 10, "number": 12, "threads": 2, "type": "email", "status": "active", "subject": "Help with setup", "mailboxId": 13, "assignee": { "id": 99, "type": "user", "first": "John", "last": "Agent", "email": "john@company.com" }, "customFields": [{ "id": 8, "name": "Account Type", "value": "8518", "text": "Premium" }], "snooze": { "snoozedBy": 4, "snoozedUntil": "2024-06-03T12:00:00Z", "unsnoozeOnCustomerReply": true }, "createdAt": "2024-01-15T09:30:00Z", "modifiedAt": "2024-01-15T14:20:00Z" }] }, "page": { "size": 25, "totalElements": 156, "totalPages": 7, "number": 1 } } ``` **POST /v2/conversations** - Create new conversation Create a new conversation with customer, threads, tags and custom fields. Request: ```json { "subject": "Need help with billing", "customer": { "email": "customer@example.com", "firstName": "Jane", "lastName": "Smith" }, "mailboxId": 85, "type": "email", "status": "active", "threads": [{ "type": "customer", "customer": { "email": "customer@example.com" }, "text": "I have a question about my recent bill. Can you help?" }], "tags": ["billing", "priority"], "fields": [{ "id": 531, "value": "premium" }] } ``` Response: ```json { "id": 12345, "number": 98765, "subject": "Need help with billing", "status": "active", "createdAt": "2024-01-15T10:00:00Z", "_links": { "self": { "href": "https://api.helpscout.net/v2/conversations/12345" } } } ``` **PATCH /v2/conversations/{id}** - Update conversation using JSON Patch Update conversation properties using JSON Patch operations. Request: ```json [ {"op": "replace", "path": "/subject", "value": "Updated subject"}, {"op": "replace", "path": "/status", "value": "closed"}, {"op": "replace", "path": "/assignTo", "value": 123}, {"op": "move", "path": "/mailboxId", "value": 456} ] ``` **GET /v2/conversations/{id}/threads** - List conversation threads Retrieve all threads (messages) in a conversation with attachments and ratings. Response: ```json { "_embedded": { "threads": [{ "id": 1234, "type": "customer", "status": "active", "state": "published", "body": "Thank you for the quick response!", "customer": { "id": 29418, "first": "Jane", "last": "Smith", "email": "jane@example.com" }, "rating": { "customerId": 1234, "rating": "great", "comments": "Very helpful!" }, "createdAt": "2024-01-15T10:30:00Z", "_embedded": { "attachments": [{ "id": 1234, "filename": "screenshot.jpg", "mimeType": "image/jpeg", "size": 20191, "state": "valid" }] } }] } } ``` **POST /v2/conversations/{id}/reply** - Create reply thread Add a reply, note, or other thread type to a conversation. Request: ```json { "type": "reply", "text": "I've checked your account and resolved the billing issue.", "draft": false, "status": "active", "attachments": [{ "fileName": "invoice.pdf", "mimeType": "application/pdf", "data": "JVBERi0xLjQKJdP..." }] } ``` ### Customers **GET /v2/customers** - List customers with search Search and filter customers by various criteria. Example with search: ```bash curl -H "Authorization: Bearer {token}" \ "https://api.helpscout.net/v2/customers?query=(email:\"jane@example.com\")" ``` **POST /v2/customers** - Create new customer Create a customer with contact information and properties. Request: ```json { "firstName": "Jane", "lastName": "Smith", "jobTitle": "Marketing Manager", "organization": "Example Corp", "emails": [{ "type": "work", "value": "jane@example.com" }], "phones": [{ "type": "work", "value": "+1-555-123-4567" }], "properties": [{ "slug": "account-type", "value": "Premium" }] } ``` Response: ```json { "id": 12345, "firstName": "Jane", "lastName": "Smith", "emails": [{ "id": 67890, "type": "work", "value": "jane@example.com" }], "createdAt": "2024-01-15T09:00:00Z", "_links": { "self": { "href": "https://api.helpscout.net/v2/customers/12345" } } } ``` ### Customer Sub-Resources **POST /v2/customers/{id}/emails** - Add email address **POST /v2/customers/{id}/phones** - Add phone number **POST /v2/customers/{id}/social_profiles** - Add social profile **PUT /v2/customers/{id}/address** - Update address ### Reports (Plus/Pro Plans) **GET /v2/reports/conversations** - Conversation volume and trends Get detailed conversation analytics with comparison periods. Parameters: - `start`, `end` - Date range (ISO 8601) - `previousStart`, `previousEnd` - Comparison period - `mailboxes`, `tags`, `types`, `folders` - Filters Example: ```bash curl -H "Authorization: Bearer {token}" \ "https://api.helpscout.net/v2/reports/conversations?start=2024-01-01T00:00:00Z&end=2024-01-31T23:59:59Z&mailboxes=123" ``` Response: ```json { "busiestDay": { "day": 3, "hour": 14, "count": 45 }, "current": { "totalConversations": 1816, "conversationsCreated": 1698, "customers": 1302, "conversationsPerDay": 60 }, "deltas": { "newConversations": -14.07, "totalConversations": -12.69 }, "tags": { "top": [{ "id": 1, "name": "urgent", "count": 146, "percent": 8.04 }] }, "customFields": { "fields": [{ "id": 8, "name": "Account Type", "values": [{ "name": "Premium", "count": 142, "percent": 55.12 }] }] } } ``` **GET /v2/reports/productivity** - Response time and resolution metrics Get detailed productivity metrics including response times and resolution data. Response: ```json { "current": { "resolutionTime": 86400, "responseTime": 3600, "firstResponseTime": 1800, "handleTime": 600, "percentResolvedOnFirstReply": 45.5 }, "responseTime": { "ranges": [{ "id": 10, "label": "< 1 hour", "count": 145, "percent": 68.2 }] } } ``` **GET /v2/reports/user** - Individual user performance Get performance metrics for a specific user or team member. Parameters: `user={id}` or `users={id1,id2}` Response: ```json { "user": { "id": 123, "name": "John Agent", "totalCustomersHelped": 1250 }, "current": { "resolved": 45, "totalReplies": 156, "responseTime": 2700, "happinessScore": 92.5, "repliesToResolve": 2.1 } } ``` ### Inboxes (Mailboxes) **GET /v2/mailboxes** - List all inboxes Get all mailboxes/inboxes accessible to the authenticated user. Response: ```json { "_embedded": { "mailboxes": [{ "id": 1, "name": "General Support", "slug": "83ebc5d87292a795", "email": "support@company.com", "createdAt": "2023-06-05T09:17:15Z" }] } } ``` **GET /v2/mailboxes/{id}/folders** - List inbox folders **GET /v2/mailboxes/{id}/fields** - List custom fields **GET /v2/mailboxes/{id}/saved_replies** - List saved replies ### Webhooks **POST /v2/webhooks** - Create webhook subscription Create webhook to receive real-time notifications for Help Scout events. Request: ```json { "url": "https://yourapp.com/helpscout-webhook", "events": [ "convo.assigned", "convo.created", "convo.status", "customer.created" ], "secret": "your-webhook-secret", "payloadVersion": "V2", "label": "Main App Webhook" } ``` Response: ```json { "id": 12345, "url": "https://yourapp.com/helpscout-webhook", "events": ["convo.assigned", "convo.created"], "state": "enabled", "createdAt": "2024-01-15T10:00:00Z" } ``` Available webhook events: - `convo.assigned`, `convo.created`, `convo.deleted`, `convo.merged`, `convo.moved`, `convo.status` - `convo.tags.added`, `convo.tags.removed` - `convo.customer.reply.created`, `convo.agent.reply.created`, `convo.note.created` - `customer.created`, `customer.updated`, `customer.deleted` - `satisfaction.ratings.received` - `beacon.chat.created`, `beacon.chat.customer.reply.created` ### Users & Teams **GET /v2/users** - List all users **GET /v2/users/me** - Get current authenticated user **GET /v2/teams** - List teams **GET /v2/teams/{id}/members** - List team members ### Workflows **POST /v2/workflows/{id}/run** - Execute manual workflow Run a manual workflow on specific conversations. Request: ```json { "conversationIds": [123, 456, 789] } ``` ### Tags & Properties **GET /v2/tags** - List all tags **GET /v2/customer-properties** - List customer properties **POST /v2/customer-properties** - Create custom property ### Error Handling All API errors follow a consistent format: ```json { "logRef": "64bb72b4-0a92-11e8-ba89-0ed5f89f718b", "message": "Validation failed", "_embedded": { "errors": [{ "path": "subject", "message": "may not be empty", "source": "JSON" }] } } ``` ## Docs API **Base URL:** https://docsapi.helpscout.net/v1 **Authentication:** API Key via HTTP Basic Auth (API key as username, dummy password) **Rate Limits:** 2000-4000 requests per 10 minutes (varies by number of sites) **Format:** JSON only with envelope structure **Pagination:** Maximum 50 records per page (customizable up to 100) API for managing Help Scout Docs knowledge base content including articles, collections, categories, and sites. ### Authentication Example ```bash curl --user {api_key}:X https://docsapi.helpscout.net/v1/collections ``` ### Articles **GET /v1/articles/{id}** - Get single article Retrieve a specific article by ID or number. Supports draft versions. Parameters: - `draft=true` - Get draft version if available Response: ```json { "article": { "id": "5214c77c45667acd25394b51", "number": 123, "collectionId": "5214c77c45667acd25394b50", "status": "published", "hasDraft": false, "name": "Getting Started Guide", "slug": "getting-started-guide", "text": "
Welcome to our platform! This guide will help you...
", "categories": ["5214c83d45667acd25394b54"], "related": ["521509f145667acd25394b5b"], "publicUrl": "http://docs.company.com/article/123-getting-started-guide", "popularity": 4.2, "viewCount": 1547, "keywords": ["setup", "onboarding", "tutorial"], "createdAt": "2023-01-15T10:30:00Z", "updatedAt": "2024-01-10T14:20:00Z", "lastPublishedAt": "2024-01-10T14:20:00Z" } } ``` **GET /v1/collections/{id}/articles** - List articles in collection List all articles within a specific collection with filtering and sorting. Parameters: - `page` - Page number (default: 1) - `pageSize` - Items per page (max: 100, default: 50) - `status` - Filter by status (all/published/notpublished) - `sort` - Sort by (number/status/name/popularity/createdAt/updatedAt) - `order` - Sort order (asc/desc) Example: ```bash curl --user {api_key}:X \ "https://docsapi.helpscout.net/v1/collections/123/articles?status=published&sort=popularity&order=desc" ``` **POST /v1/articles** - Create new article Create a new article with content, categories, and metadata. Request: ```json { "collectionId": "5214c77c45667acd25394b51", "status": "published", "slug": "billing-faq", "name": "Billing FAQ", "text": "Here are answers to frequently asked billing questions...
", "categories": ["5214c83d45667acd25394b54"], "related": ["521509f145667acd25394b5b"], "keywords": ["billing", "faq", "payment"] } ``` Response: ```json { "article": { "id": "5214c77c45667acd25394b52", "number": 124, "status": "published", "name": "Billing FAQ", "publicUrl": "http://docs.company.com/article/124-billing-faq", "createdAt": "2024-01-15T10:00:00Z" } } ``` **GET /v1/search/articles** - Search articles Search articles across collections with filtering options. Parameters: - `query` - Search terms - `collectionId` - Filter by collection - `siteId` - Filter by site - `visibility` - Filter by visibility (all/public/private) - `status` - Filter by status Example: ```bash curl --user {api_key}:X \ "https://docsapi.helpscout.net/v1/search/articles?query=billing+payment&collectionId=123" ``` Response: ```json { "articles": { "page": 1, "pages": 3, "count": 45, "items": [{ "id": "5214c77c45667acd25394b51", "number": 123, "name": "Billing FAQ", "preview": "Here are answers to frequently asked billing questions...", "url": "/article/123-billing-faq", "docsUrl": "http://docs.company.com/article/123-billing-faq", "categoryIds": ["5214c83d45667acd25394b54"], "visibility": "public", "status": "published" }] } } ``` **POST /v1/articles/upload** - Upload article from file Create article by uploading HTML, text, or Markdown file. Request (multipart/form-data): - `collectionId` - Target collection ID - `file` - File to upload (HTML, text, or Markdown) - `name` - Article name (optional, uses filename if not provided) ### Collections **GET /v1/collections** - List all collections List collections with filtering and sorting options. Parameters: - `page`, `siteId`, `visibility` (all/public/private) - `sort` (number/visibility/order/name/createdAt/updatedAt), `order` Response: ```json { "collections": { "page": 1, "pages": 2, "count": 8, "items": [{ "id": "52404efc4566740003092640", "siteId": "52444cc53e3e9bd67a3dc68c", "number": 12, "slug": "user-guide", "visibility": "public", "order": 1, "name": "User Guide", "description": "Complete user documentation", "publicUrl": "http://docs.company.com/collection/12-user-guide", "articleCount": 45, "publishedArticleCount": 42, "createdAt": "2023-06-15T09:00:00Z", "updatedAt": "2024-01-10T16:30:00Z" }] } } ``` **POST /v1/collections** - Create new collection Create a new collection to organize articles. Request: ```json { "siteId": "52404efc4566740003092640", "name": "API Documentation", "description": "Complete API reference and guides", "visibility": "public", "order": 2 } ``` ### Categories **GET /v1/collections/{id}/categories** - List categories in collection List all categories within a specific collection. Response: ```json { "categories": { "items": [{ "id": "5214c83d45667acd25394b54", "collectionId": "5214c77c45667acd25394b50", "number": 5, "slug": "getting-started", "name": "Getting Started", "visibility": "public", "order": 1, "articleCount": 12, "createdAt": "2023-06-15T10:00:00Z" }] } } ``` **POST /v1/categories** - Create new category Create a category to organize articles within a collection. Request: ```json { "collectionId": "5214c83d45667acd25394b53", "name": "Billing & Payments", "slug": "billing-payments", "visibility": "public", "order": 3, "defaultSort": "name" } ``` ### Sites **GET /v1/sites** - List all sites List all documentation sites associated with your account. Response: ```json { "sites": { "items": [{ "id": "52444cc53e3e9bd67a3dc68c", "status": "active", "subDomain": "docs", "cname": "docs.company.com", "hasPublicSite": true, "companyName": "Company Inc", "title": "Company Documentation", "logoUrl": "https://cdn.company.com/logo.png", "logoWidth": 200, "logoHeight": 50, "homeUrl": "https://company.com", "homeLinkText": "Back to Company", "bgColor": "#ffffff", "description": "Help documentation for Company's products", "hasContactForm": true, "mailboxId": "52404efc4566740003092640", "contactEmail": "support@company.com", "createdAt": "2023-01-15T10:00:00Z" }] } } ``` **POST /v1/sites** - Create new site Create a new documentation site. Request: ```json { "subDomain": "support", "companyName": "Example Corp", "title": "Example Support Center", "homeUrl": "https://example.com", "homeLinkText": "Back to Example", "hasContactForm": true, "mailboxId": "52404efc4566740003092640" } ``` ### Redirects **GET /v1/redirects/site/{siteId}** - List redirects for site List all URL redirects configured for a specific site. Response: ```json { "redirects": { "items": [{ "id": "52444cc53e3e9bd67a3dc68d", "siteId": "52444cc53e3e9bd67a3dc68c", "urlMapping": "/article/22-old-article", "type": "article", "documentId": "5214c77c45667acd25394b51", "redirect": "http://docs.company.com/article/123-new-article", "createdAt": "2024-01-10T15:00:00Z" }] } } ``` **POST /v1/redirects** - Create URL redirect Create a redirect from an old URL to a new location. Request: ```json { "siteId": "52444cc53e3e9bd67a3dc68c", "urlMapping": "/article/old-setup-guide", "redirect": "http://docs.company.com/article/123-getting-started-guide" } ``` **GET /v1/redirects/find** - Find redirect by URL Check if a redirect exists for a specific URL mapping. Parameters: - `url` - The URL mapping to check ### Article Revisions **GET /v1/articles/{id}/revisions** - List article revisions Get revision history for an article. Response: ```json { "revisions": { "items": [{ "id": "revision123", "createdAt": "2024-01-10T14:20:00Z", "createdBy": { "id": "user456", "firstName": "John", "lastName": "Editor" } }] } } ``` ### Error Handling All errors follow a consistent format: ```json { "code": 404, "error": "Resource not found" } ``` Common HTTP status codes: - **200:** Success - **201:** Created (includes Location header) - **204:** Successfully deleted - **400:** Bad request format - **401:** Invalid API key - **403:** Access denied - **404:** Resource not found - **429:** Rate limit exceeded ## Chat API **Base URL:** https://api.helpscout.net/chat/v1 **Authentication:** OAuth 2.0 Bearer tokens **Format:** JSON API for managing Beacon chat conversations and retrieving chat-specific data. ### Chat Conversations **GET /chat/v1/conversations/{id}** - Get chat conversation details Retrieve detailed information about a specific chat conversation including customer data and chat context. Request: ```bash curl -H "Authorization: Bearer {token}" \ https://api.helpscout.net/chat/v1/conversations/12345 ``` Response: ```json { "id": 12345, "number": 67890, "mailboxId": 123, "assignee": { "id": 456, "type": "user", "firstName": "John", "lastName": "Agent", "email": "john@company.com" }, "customer": { "id": 789, "firstName": "Jane", "lastName": "Customer", "email": "jane@example.com" }, "status": "active", "subject": "Chat conversation", "preview": "Customer started a chat about billing", "createdAt": "2024-01-15T14:30:00Z", "modifiedAt": "2024-01-15T14:45:00Z", "chatStartedBy": "customer", "chatEndedBy": null, "chatEndedAt": null } ``` **GET /chat/v1/conversations/{id}/events** - Get conversation events and messages Retrieve the complete timeline of events and messages for a chat conversation. Response: ```json { "events": [{ "id": "event123", "type": "message", "createdAt": "2024-01-15T14:30:00Z", "author": { "type": "customer", "id": 789, "name": "Jane Customer" }, "body": "Hi, I have a question about my billing.", "source": "chat" }, { "id": "event124", "type": "message", "createdAt": "2024-01-15T14:32:00Z", "author": { "type": "user", "id": 456, "name": "John Agent" }, "body": "Hello! I'd be happy to help with your billing question.", "source": "chat" }, { "id": "event125", "type": "chat_ended", "createdAt": "2024-01-15T14:45:00Z", "endedBy": { "type": "customer", "id": 789 } }] } ``` ## Webhooks Real-time event notifications sent via HTTP POST to your specified endpoints when events occur in Help Scout. ### Webhook Payload Structure All webhook payloads follow a consistent structure: ```json { "timestamp": "2024-01-15T14:30:00Z", "webhook": { "id": 12345, "url": "https://yourapp.com/webhook" }, "eventType": "convo.created", "data": { // Event-specific data object } } ``` ### Security & Verification **HMAC SHA1 Signature Verification:** ```bash # Verify using the X-HelpScout-Signature header expected_signature = "sha1=" + hmac.new(webhook_secret, payload, hashlib.sha1).hexdigest() received_signature = request.headers.get('X-HelpScout-Signature') ``` **Retry Mechanism:** - Automatic retries for failed deliveries (up to 10 attempts) - Exponential backoff between attempts (1s, 2s, 4s, 8s, etc.) - Webhooks disabled after repeated failures ### Conversation Events **convo.created** - New conversation created ```json { "eventType": "convo.created", "data": { "id": 12345, "number": 67890, "type": "email", "status": "active", "subject": "Need help with billing", "mailboxId": 123, "customer": { "id": 456, "firstName": "Jane", "lastName": "Smith", "email": "jane@example.com" }, "assignee": null, "createdAt": "2024-01-15T14:30:00Z" } } ``` **convo.assigned** - Conversation assigned to user ```json { "eventType": "convo.assigned", "data": { "id": 12345, "assignee": { "id": 789, "firstName": "John", "lastName": "Agent", "email": "john@company.com" }, "assignedBy": { "id": 999, "firstName": "Manager", "lastName": "Smith" } } } ``` **convo.status** - Conversation status changed ```json { "eventType": "convo.status", "data": { "id": 12345, "status": "closed", "previousStatus": "active", "closedBy": { "id": 789, "firstName": "John", "lastName": "Agent" } } } ``` **convo.customer.reply.created** - Customer replied to conversation ```json { "eventType": "convo.customer.reply.created", "data": { "conversationId": 12345, "thread": { "id": 54321, "type": "customer", "body": "Thank you for your help!", "customer": { "id": 456, "firstName": "Jane", "lastName": "Smith" }, "createdAt": "2024-01-15T15:00:00Z" } } } ``` ### Customer Events **customer.created** - New customer created ```json { "eventType": "customer.created", "data": { "id": 456, "firstName": "Jane", "lastName": "Smith", "emails": [{ "id": 789, "value": "jane@example.com", "type": "work" }], "organization": "Example Corp", "jobTitle": "Marketing Manager", "createdAt": "2024-01-15T14:30:00Z" } } ``` ### Rating Events **satisfaction.ratings.received** - Customer satisfaction rating received ```json { "eventType": "satisfaction.ratings.received", "data": { "conversationId": 12345, "rating": { "id": 98765, "rating": "great", "ratingCustomerId": 456, "ratingUserId": 789, "comments": "Excellent support, very helpful!", "createdAt": "2024-01-15T16:00:00Z" } } } ``` ### Chat Events **beacon.chat.created** - New chat conversation started ```json { "eventType": "beacon.chat.created", "data": { "conversationId": 12345, "customer": { "id": 456, "firstName": "Jane", "lastName": "Smith" }, "beaconId": "beacon-abc123", "startedAt": "2024-01-15T14:30:00Z" } } ``` ### Available Event Types **Conversation Events:** - `convo.assigned`, `convo.created`, `convo.deleted`, `convo.merged`, `convo.moved` - `convo.status`, `convo.tags.added`, `convo.tags.removed` - `convo.customer.reply.created`, `convo.agent.reply.created`, `convo.note.created` **Customer Events:** - `customer.created`, `customer.updated`, `customer.deleted` **Rating Events:** - `satisfaction.ratings.received` **Chat Events:** - `beacon.chat.created`, `beacon.chat.customer.reply.created` **Survey Events:** - `survey.response.received` **Tag Events:** - `tag.created`, `tag.updated`, `tag.deleted` ## Apps Platform Platform for building custom applications that integrate directly into Help Scout's interface, displayed in the conversation sidebar. ### JavaScript SDK The JavaScript SDK provides access to Help Scout's context and enables communication between your app and Help Scout. **HelpScout.getApplicationContext()** - Get current application context ```javascript HelpScout.getApplicationContext().then(context => { const { conversation, customer, user, inbox } = context; // Access conversation data console.log('Conversation ID:', conversation.id); console.log('Subject:', conversation.subject); // Access customer data console.log('Customer:', customer.firstName, customer.lastName); console.log('Email:', customer.emails[0].value); // Access current user console.log('Agent:', user.firstName, user.lastName); // Access inbox info console.log('Inbox:', inbox.name); }); ``` **Context Object Structure:** ```javascript { conversation: { id: 12345, number: 67890, subject: "Need help with billing", status: "active", type: "email", threads: 3, customFields: [{ id: 123, name: "Priority", value: "high" }], tags: ["billing", "urgent"] }, customer: { id: 456, firstName: "Jane", lastName: "Smith", emails: [{ id: 789, value: "jane@example.com", type: "work" }], phones: [{ id: 101, value: "+1-555-123-4567", type: "work" }], organization: "Example Corp", jobTitle: "Marketing Manager" }, user: { id: 999, firstName: "John", lastName: "Agent", email: "john@company.com", role: "agent" }, inbox: { id: 123, name: "General Support", email: "support@company.com" } } ``` **HelpScout.setHeight(height)** - Dynamically adjust app iframe height ```javascript // Set height to 400px HelpScout.setHeight(400); // Auto-size based on content HelpScout.setHeight('auto'); ``` **HelpScout.showModal(options)** - Display modal dialog ```javascript HelpScout.showModal({ title: "Customer Details", url: "https://yourapp.com/modal/customer/456", width: 600, height: 400 }); ``` **HelpScout.closeModal()** - Close current modal ```javascript HelpScout.closeModal(); ``` **Event Handling:** ```javascript // Listen for context changes HelpScout.on('conversation.changed', (newConversation) => { console.log('Switched to conversation:', newConversation.id); }); // Listen for customer changes HelpScout.on('customer.changed', (newCustomer) => { console.log('Customer changed:', newCustomer.firstName); }); ``` ### React UI Kit Pre-built React components that match Help Scout's design system for consistent app interfaces. **Installation:** ```bash npm install @helpscout/ui-kit ``` **Core Components:** **Button Component:** ```jsx import { Button } from '@helpscout/ui-kit'; ``` **Input Component:** ```jsx import { Input } from '@helpscout/ui-kit'; setCustomerName(e.target.value)} /> ``` **Modal Component:** ```jsx import { Modal } from '@helpscout/ui-kit';Customer details here...