What you need
- A Google Cloud service account with a JSON key:
- In console.cloud.google.com, open or create a project.
- APIs & Services → Library → enable the Google Sheets API.
- APIs & Services → Credentials → Create Credentials → Service
Account, name it (for example,
pyai-call-log). - Open the service account → Keys → Add Key → Create new key → JSON → download.
- Share your spreadsheet with the service account’s email as an Editor
(the
client_emailin the JSON, likepyai-call-log@project.iam.gserviceaccount.com). Rows cannot append without this share. - The spreadsheet id from the URL (
/d/<this-part>/edit) and the tab name (for example,Sheet1).
Connect
- In PyAI Console, open Integrations and find Google Sheets under Automation.
- Click Connect, paste the full JSON key, the spreadsheet id, and the tab name, and pick your events.
- Press Test. A sample row lands in the tab.
- Done. Rows append from the next completed call.
What lands
One row per call, with these columns in order:Troubleshooting
- Error: The caller does not have permission. The sheet is not shared with the service account’s email, or it is shared as Viewer. Share as Editor and press Test again.
- Error: Unable to parse range. The tab name is wrong or was renamed. Update the connection with the current tab name (stored credentials are preserved).
- Error: invalid_grant / private key error. The JSON key was deleted or the paste was truncated. Create a fresh key in Google Cloud and paste the whole file again.
- Revoking access later. Unshare the sheet or delete the JSON key in Google Cloud; deliveries fail visibly and stop, and disconnecting the integration in PyAI deletes the stored key.