Skip to main content
Ця сторінка також доступна українською.

Overview

The new Connections endpoint provides a single API call to retrieve all of a user’s connected services — Google Ads accounts and Google Business Profile (GBP) locations — grouped by company. Before: the frontend had to call separate endpoints for Google Ads customers and GBP locations, often repeating requests per company (N+1 problem). After: one GET /api/v1/companies/me/connections call returns everything.

Endpoints

Both require a valid Authorization: Bearer <token> header.

Response format

Both endpoints return the same shape — a company object with two connection arrays. The “all connections” endpoint wraps it in a list.

CompanyWithConnections

integer
required
The company ID.
string
required
The company name.
string (ISO 8601)
required
When the company was created.
string (ISO 8601)
required
When the company was last updated.
GoogleAdsCustomer[]
required
Connected Google Ads accounts. Empty array if none.
GoogleBusinessLocation[]
required
Connected GBP locations. Empty array if none.

Example request and response

Response (200 OK):
Companies with no connections still appear in the response — their google_ads_customers and google_business_locations arrays are empty. This lets you show “No connections yet” UI without extra logic.

Single-company endpoint

To fetch connections for a specific company, use the company ID in the path:
Returns a single object (not an array):

What gets filtered out

The backend automatically excludes inactive or deleted resources. You do not need to filter on the frontend side. The following are excluded:

Caching

Responses are cached on the backend (Redis). You do not need to implement any caching logic on the frontend. The cache is automatically invalidated when:
  • A company is created, updated, or deleted
  • A member is added to or removed from a company
  • A Google Ads account or GBP location is linked / unlinked
This means calling the endpoint after any mutation will return fresh data.

Migration guide

If you are currently fetching Google Ads customers and GBP locations from separate endpoints:
1

Replace multiple calls with one

Replace individual calls to Google Ads and GBP endpoints with a single call to GET /api/v1/companies/me/connections.
2

Update your data model

The response groups connections under each company. Map your UI state accordingly:
3

Remove client-side filtering

The backend already filters out inactive / deleted resources. Remove any frontend is_active / is_deleted checks.
4

Remove client-side caching (optional)

If you had client-side caching for connection data, it can be simplified or removed since the backend now caches the response.