google_sheets_integration
Google Sheets Integration for ElevenLabs Agents
Overview
This integration allows ElevenLabs agents to capture contact details directly into Google Spreadsheets via webhook tools.
Setup Instructions
1. Create Google Service Account
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google Sheets API
- Go to “Credentials” → “Create Credentials” → “Service Account”
- Download the JSON key file
2. Share Spreadsheet with Service Account
- Create a Google Spreadsheet
- Share it with the service account email (from the JSON file)
- Give “Editor” permissions
- Copy the Spreadsheet ID from the URL
3. Configure Agent
Update the agent’s Google Sheets configuration:
UPDATE elevenlabs_agents
SET google_sheets_config = JSON_OBJECT(
'default_spreadsheet_id', 'YOUR_SPREADSHEET_ID',
'default_sheet_name', 'Contacts',
'service_account_credentials', JSON_OBJECT(
'client_email', 'your-service-account@project.iam.gserviceaccount.com',
'private_key', 'YOUR_PRIVATE_KEY'
)
)
WHERE agent_id = 'your_agent_id';
4. Add Webhook Tool to Agent
In ElevenLabs Agent Settings, add this webhook tool:
Tool Name: google_sheets_tool
Method: POST
URL: https://api.triluna.app/api/google-sheets/webhook
Headers: Content-Type: application/json
Available Actions
Add Contact
{
"request": "{
\"action\": \"add_contact\",
\"agent_id\": \"your_agent_id\",
\"contact_name\": \"John Doe\",
\"contact_email\": \"john@example.com\",
\"contact_phone\": \"+1234567890\",
\"contact_company\": \"Acme Corp\",
\"contact_notes\": \"Interested in services\"
}"
}
Create Header Row
{
"request": "{
\"action\": \"create_header\",
\"agent_id\": \"your_agent_id\"
}"
}
Get Recent Contacts
{
"request": "{
\"action\": \"get_contacts\",
\"agent_id\": \"your_agent_id\"
}"
}
Spreadsheet Format
The integration creates columns:
- A: Timestamp
- B: Contact Name
- C: Email
- D: Phone
- E: Company
- F: Notes
Security Notes
- Service account credentials are stored in the database
- Spreadsheets must be explicitly shared with the service account
- All API calls are logged for auditing
Troubleshooting
Authentication Error: Check service account credentials and spreadsheet sharing Permission Error: Ensure service account has Editor access to the spreadsheet Not Found Error: Verify spreadsheet ID and sheet name are correct