Skip to content

Quickstart

This page walks through the fastest path from “blank workspace” to “first conversation in your inbox.” It exists to demonstrate the patterns we’ll use for every getting-started page: callouts, tabbed code blocks, and cross-links to API references.

1. Verify your credentials

Every API call requires an API key. You can find yours under Workspace → Developer → API keys. Hit /v1/users/me to confirm the key works and see which workspace it’s scoped to.

Terminal window
export FOYER_API_KEY="sk_live_…"
curl https://api.foyersupport.com/v1/users/me \
-H "Authorization: Bearer $FOYER_API_KEY"

2. Open a conversation

A conversation is the unit of work and always belongs to a customer on a specific channel. Grab a channel_id from GET /v1/channels (or create one under Settings → Channels), create or look up the customer, then open the conversation with an initial_message.

Terminal window
# 1. Create or look up the customer
CUSTOMER_ID=$(curl -s https://api.foyersupport.com/v1/customers \
-H "Authorization: Bearer $FOYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"display_name": "Alice", "primary_email": "alice@example.com"}' \
| jq -r .customer_id)
# 2. Open the conversation on an existing channel
curl https://api.foyersupport.com/v1/conversations \
-H "Authorization: Bearer $FOYER_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"customer_id\": \"$CUSTOMER_ID\",
\"subject\": \"Hello from the API\",
\"channel_type\": \"email\",
\"channel_id\": \"email-main\",
\"initial_message\": {
\"body_text\": \"Hi! Just checking things out.\",
\"author_type\": \"customer\",
\"author_id\": \"$CUSTOMER_ID\"
}
}"

3. Watch it land

Open the inbox at app.foyersupport.com — the conversation appears in real time over the WebSocket fanout (no polling, no refresh).

Next