Setting up API keys
Most automations connect to other services, and each one needs your own credentials. This page covers the ones our automations use most.
Keep keys secret. Treat an API key like a password: store it in your automation platform's credential manager (not in a shared file or a screenshot), never post it publicly, and revoke it straight away if it leaks. The providers' dashboards change from time to time, so a menu may have moved slightly.
OpenAI
Used for AI steps: writing replies, summarising, extracting data from documents.
- Sign in at platform.openai.com.
- Go to API keys (platform.openai.com/api-keys) and click Create new secret key.
- Give it a name (for example n8n – lead replies) and copy the key. It's only shown once, so paste it straight into your automation's OpenAI credential.
- Add credit under Billing. API usage is billed separately from a ChatGPT subscription. Setting a monthly usage limit there is a good idea.
WhatsApp Cloud API
Used to send and receive WhatsApp messages from your business number. You need a Meta developer account and a Meta Business portfolio.
Get started with the test number
- Go to developers.facebook.com, open My Apps and create an app for WhatsApp (a business-type app).
- Add the WhatsApp product to the app and open its API Setup page.
- Note the values your automation asks for:
- Phone number ID
- WhatsApp Business Account ID
- Temporary access token — fine for testing, but it expires after 24 hours.
- Add your own phone number as a test recipient and send yourself the sample message to confirm it works.
Go live
- On the API Setup page, add and verify your real business phone number.
- Create a permanent token: in Meta Business settings, create a System user, give it access to your app and WhatsApp account, then generate a token with the
whatsapp_business_messagingandwhatsapp_business_managementpermissions. - If the automation receives messages, set the Webhook in your app's WhatsApp configuration: paste the automation's webhook URL, choose a verify token, and subscribe to the
messagesfield.
Good to know:
- You can reply freely within 24 hours of a customer's last message. To message someone outside that window, you need an approved message template.
- Meta charges for some message types. Check Meta's WhatsApp pricing page for current rates in India.
Google (Sheets, Gmail, Drive, Calendar)
Most automation platforms connect to Google with OAuth: you sign in with Google and approve access.
- Open the Google Cloud console and create a project (for example Automations).
- Under APIs & Services → Library, enable each API the automation uses — for example Google Sheets API, Gmail API, Google Drive API.
- Set up the OAuth consent screen (Google Auth Platform): app name, support email, and — while the app is in Testing — add your own Google account as a test user.
- Go to Credentials → Create credentials → OAuth client ID, choose Web application, and add the redirect URL your automation platform shows you (in n8n it's shown as OAuth Redirect URL in the Google credential window). It must match exactly.
- Copy the Client ID and Client secret into your platform's Google credential and click Sign in with Google.
Good to know:
- While your consent screen is in Testing, Google sign-ins expire after about 7 days. For automations that should keep running, publish the app (for internal tools, Google may not require a full review).
- For server-to-server jobs, a service account is an alternative: create one under Credentials, download its JSON key, and share the Sheet or Drive folder with the service account's email address.
Meta (Facebook Pages and Instagram)
Used for things like replying to comments, reading messages or posting to a Page.
- Your Instagram account must be a professional (business or creator) account and, for most automations, linked to a Facebook Page.
- At developers.facebook.com, create an app and add the products your automation needs (for example Facebook Login for Business or Instagram).
- Use the Graph API Explorer to generate a user access token with the permissions the automation lists (such as
pages_show_list,pages_read_engagement,instagram_basic). - Exchange it for a long-lived token, then get your Page access token from it. Paste that into your platform's Facebook/Meta credential.
Good to know:
- Tokens from the Graph API Explorer are short-lived. Use the long-lived Page token for automations.
- While your app is in development mode it only works with accounts that have a role on the app. Using it with other people's Pages or accounts requires Meta's App Review.
Something not connecting? See Troubleshooting.