Skip to main content

DocsREST API and MCP server

Authentication API

Endpoints, auth and live samples for Audience Builder, Connect Data and CRM sync.

Base URLhttps://us-farmvision-new-api.onrender.com

Authentication

Get Google Client ID

Returns the public Google OAuth client ID to load Google Sign-In with. The ID token you later send to /google must be issued for this client ID. clientId is an empty string when Google sign-in is not configured.

GEThttps://us-farmvision-new-api.onrender.com/api/v1/gtmscoop/auth/google-clientTry it

In this section

Authentication

No credentials

This route is what issues tokens for everything else, so it takes no auth header.

Parameters

This endpoint takes no parameters or request body.

Mounted at

/api/v1/gtmscoop/auth

GTM Scoop's own sign-in (Google, or email + one-time code), both ending in the same session; sign-in may be limited to approved company email domains (403). Tokens never appear in the JSON body: they come back as cookies (dnp_access_token, dnp_refresh_token, dnp_csrf_token), so either replay the cookies, adding an X-CSRF-Token header equal to data.csrfToken on POST/PUT/PATCH/DELETE, or send the dnp_access_token value as a Bearer token. Integrations should use an API key instead.

Try it in the playground

Signed out: 10 free tries a day with names hidden. Log in for live data.

Open playground

Related endpoints

All 9 endpoints in this section

None to sign in; /me takes a bearer token or the session cookies; /accept-subscription-agreement and /logout-all take a signed-in session only (API keys are refused).

MethodPathWhat it does
GET/api/v1/gtmscoop/auth/google-client

Get Google Client ID

Returns the public Google OAuth client ID to load Google Sign-In with. The ID token you later send to /google must be issued for this client ID. clientId is an empty string when Google sign-in is not configured.

POST/api/v1/gtmscoop/auth/google

Sign in with Google

Verifies a Google ID token and signs in, creating the account on first use. Sets the session cookies and returns the user plus csrfToken. 401 if the token is invalid, expired, for another client ID or for an unverified Google email; 403 if the account is deactivated or the email is already linked to a different Google account.

1 parameter
  • idToken (string, required) Google ID token (JWT) from Google Sign-In, issued for the client ID returned by /google-client.
POST/api/v1/gtmscoop/auth/otp/request

Request One-Time Code

Emails a six-digit sign-in code (valid 5 minutes by default) and returns the resend cooldown and expiry. Answers the same way whether or not the address has an account; inside the cooldown the previous code stays live and retryAfterMs is the time left. 400 for a malformed address or a disposable (throwaway) email domain; 502 if the email could not be sent; 5 requests per address and network per hour (429).

1 parameter
  • email (string, required) The address to send the code to. Must be a valid email, at most 254 characters.
POST/api/v1/gtmscoop/auth/otp/verify

Verify One-Time Code

Consumes the emailed code and signs in, creating the account on first use. Sets the session cookies and returns the user plus csrfToken. 400 for a disposable (throwaway) email domain; 401 for a wrong or expired code (five wrong tries void it); 403 if the account is deactivated.

2 parameters
  • email (string, required) The address the code was sent to.
  • code (string, required) The six-digit code from the email (sent as a string).
GET/api/v1/gtmscoop/auth/me

Get Current User

The signed-in account: profile, whether its email is verified, and the current CSRF token for cookie-based calls. Called with an API key, it returns the key owner's account.

Try Get Current User in the Playground
POST/api/v1/gtmscoop/auth/accept-subscription-agreement

Accept Subscription Agreement

Records that the account accepted the GoLeads Subscription Service Agreement, which the web app asks for before a first purchased-list download. Stored on the account, so it applies on every device; takes no body and is safe to repeat (each call re-stamps subscriptionAgreementAcceptedAt).

POST/api/v1/gtmscoop/auth/refresh-token

Refresh Session

Rotates the session using the dnp_refresh_token cookie (scoped to /api/v1/gtmscoop/auth; any body or Authorization header is ignored): sets new access, refresh and CSRF cookies and returns the user plus a new csrfToken. Each refresh token works once, and replaying one that was already rotated signs out every session on the account. 401 if the cookie is missing, expired or revoked, or the account is inactive; Bearer callers can instead pick up the renewed token from the X-New-Access-Token header any authenticated call returns when under 10 minutes remain.

POST/api/v1/gtmscoop/auth/logout

Sign Out

Ends the session named by the dnp_refresh_token and dnp_access_token cookies and clears all three session cookies. It reads cookies only (an Authorization header is ignored, so a Bearer-only client should use /logout-all) and always succeeds.

POST/api/v1/gtmscoop/auth/logout-all

Sign Out Everywhere

Signs out every session on the account, including the one making the call, clears this client's session cookies, and revokes every API key and connected MCP app (Claude, ChatGPT, Cursor, ...) on the account, so nothing a stolen session created keeps working. revokedKeys is how many were revoked; reconnect apps and create a new key afterwards. If the keys can't be revoked the answer is 500 with code API_KEYS_NOT_REVOKED and data.sessionsRevoked true: every session is still over, and the keys should be revoked under Account: API Keys.

Cookies on GTM Scoop

Essential cookies keep you signed in and the site secure, and are always on. Optional cookies (Google Analytics) help us understand how the site is used. They are on by default, except in the EU/EEA, the UK and Switzerland, where they stay off until you choose Accept All Cookies; choose Essential Cookies Only to turn them off. We do not use advertising cookies and we do not sell or share your personal information. The site works the same whichever you choose. We keep a record of your choice with the date, your IP address and the page you were on. Cookie Policy · Privacy Policy