How do I get these?
You only do this once. It gives the app permission to send mail through your Zoho account.
1. Create a Self Client
Go to api-console.zoho.com → Add Client → Self Client → Create. Copy the Client ID and Client Secret into the boxes above.
2. Generate a code
In that Self Client open the Generate Code tab. For Scope enter:
ZohoMail.messages.CREATE,ZohoMail.accounts.READ
Set duration to 10 minutes, add any description, click Create, pick your mail account if asked, and copy the code (it expires quickly).
3. Swap the code for a refresh token
Run this once, replacing the three placeholders. The code expires in ~10 minutes and is single-use, so do it right after generating it.
macOS / Linux (Terminal):
curl -X POST "https://accounts.zoho.com/oauth/v2/token" \
-d "grant_type=authorization_code" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "code=THE_CODE_FROM_STEP_2"
Windows (PowerShell) — use curl.exe and keep it on ONE line (plain curl in PowerShell won't work):
curl.exe -X POST "https://accounts.zoho.com/oauth/v2/token" -d "grant_type=authorization_code" -d "client_id=YOUR_CLIENT_ID" -d "client_secret=YOUR_CLIENT_SECRET" -d "code=THE_CODE_FROM_STEP_2"
The JSON reply contains refresh_token — paste that into Zoho API refresh token above. Leave Account ID blank; the app looks it up automatically.
Not on .com? If your account is zoho.eu / zoho.in / etc., use that domain for both the console and the token URL, and set Zoho accounts host above to match (e.g. https://accounts.zoho.eu). Then press Test on your account to confirm.