Google Profile
Overview
Each user in Rechat could have Google account. With this API section they can send access-request, verify-grant, revoke-access and get their Google account’s profile data.
Google Credential
A google_credential is a simple and small object that contains:
| Column | Type | Nullable |
|---|---|---|
| id | uuid | not null |
| user | uuid | not null |
| brand | uuid | not null |
| text | not null | |
| resource_name | text | not null |
| display_name | text | not null |
| first_name | text | |
| last_name | text | |
| photo | text | |
| scope | jsonb | |
| scope_summary | jsonb | |
| revoked | boolean | not null |
| created_at | timestamp with time zone | not null |
| updated_at | timestamp with time zone | not null |
| deleted_at | timestamp with time zone |
Resource Group ¶
Request to add google account ¶
Request to add google accountPOST/users/self/google
-
Valid scopes: [‘contacts’, ‘gmail.readonly’, ‘gmail.send’]
-
To redirect back user to an specific address, use
redirectkey to set your custom address.
Example URI
Body
{
"redirect": "http://localhost:3078/dashboard/contacts/",
"body": [
"contacts.readonly"
]
}200Body
{
"code": "OK",
"data": {
"url": "https://accounts.google.com/o/oauth2/v2/auth?client_id=&access_type=offline&scope=profile%20email%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcontacts%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcontacts.other.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.send%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.modify%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fbusiness.manage&state=80a227b2-29a0-11e7-b636-e4a7a08e15d4%3A%3A8399d1b0-2925-45b4-bb58-b367f43b23d7%3A%3Ahttp%3A%2F%2Flocalhost%3A3078%2Fdashboard%2Fcontacts%2F&prompt=consent%20select_account&include_granted_scopes=true&response_type=code&redirect_uri=",
"redirect": "http://localhost:3078/dashboard/contacts/",
"type": "google_auth_link"
}
}Request to get an specific google credential ¶
Request to get an specific google credentialGET/users/self/google/:id
Example URI
- id
string(required) Example: 0b80d6cf-e4f8-4f8f-ab93-0368a03ab289- associations
string(required) Example: google_credential.histories
200Body
{
"code": "OK",
"data": {
"type": "google_credential",
"id": "0b80d6cf-e4f8-4f8f-ab93-0368a03ab289",
"user": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "8399d1b0-2925-45b4-bb58-b367f43b23d7",
"email": "emailAddress",
"resource_name": "resourceName",
"display_name": "displayName",
"first_name": "firstName",
"last_name": "lastName",
"photo": "photo",
"messages_total": 100,
"threads_total": 101,
"history_id": 103,
"scope": [
"profile",
"email",
"https://www.googleapis.com/auth/contacts.readonly",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.send",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/calendar"
],
"revoked": false,
"created_at": "2026-05-15T19:09:54.030Z",
"updated_at": "2026-05-15T19:09:54.030Z",
"deleted_at": null,
"scope_summary": [
"profile",
"contacts.read",
"mail.read",
"mail.send",
"mail.modify",
"calendar"
],
"google_calendar": null,
"last_daily_sync": null,
"cgroups_sync_token": null,
"other_contacts_sync_token": null,
"people_apis_enabled": false,
"jobs": null,
"profile_image_url": "photo"
}
}Request to get user's all google credentials ¶
Request to get user's all google credentialsGET/users/self/google
Example URI
- associations
string(required) Example: google_credential.histories
200Body
{
"code": "OK",
"data": [
{
"type": "google_credential",
"id": "0b80d6cf-e4f8-4f8f-ab93-0368a03ab289",
"user": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "8399d1b0-2925-45b4-bb58-b367f43b23d7",
"email": "emailAddress",
"resource_name": "resourceName",
"display_name": "displayName",
"first_name": "firstName",
"last_name": "lastName",
"photo": "photo",
"messages_total": 100,
"threads_total": 101,
"history_id": 103,
"scope": [
"profile",
"email",
"https://www.googleapis.com/auth/contacts.readonly",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.send",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/calendar"
],
"revoked": false,
"created_at": "2026-05-15T19:09:54.030Z",
"updated_at": "2026-05-15T19:09:54.030Z",
"deleted_at": null,
"scope_summary": [
"profile",
"contacts.read",
"mail.read",
"mail.send",
"mail.modify",
"calendar"
],
"google_calendar": null,
"last_daily_sync": null,
"cgroups_sync_token": null,
"other_contacts_sync_token": null,
"people_apis_enabled": false,
"jobs": null,
"profile_image_url": "photo"
}
],
"info": {
"count": 1,
"total": 0
}
}Request to sync a google credential ¶
Request to sync a google credentialPOST/users/self/google/:id/sync
Example URI
- id
string(required) Example: 0b80d6cf-e4f8-4f8f-ab93-0368a03ab289
200Body
{
"code": "OK",
"data": {
"type": "google_credential",
"id": "0b80d6cf-e4f8-4f8f-ab93-0368a03ab289",
"user": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "8399d1b0-2925-45b4-bb58-b367f43b23d7",
"email": "emailAddress",
"resource_name": "resourceName",
"display_name": "displayName",
"first_name": "firstName",
"last_name": "lastName",
"photo": "photo",
"messages_total": 100,
"threads_total": 101,
"history_id": 103,
"scope": [
"profile",
"email",
"https://www.googleapis.com/auth/contacts.readonly",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.send",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/calendar"
],
"revoked": false,
"created_at": "2026-05-15T19:09:54.030Z",
"updated_at": "2026-05-15T19:09:54.030Z",
"deleted_at": null,
"scope_summary": [
"profile",
"contacts.read",
"mail.read",
"mail.send",
"mail.modify",
"calendar"
],
"google_calendar": null,
"last_daily_sync": null,
"cgroups_sync_token": null,
"other_contacts_sync_token": null,
"people_apis_enabled": false,
"jobs": null,
"profile_image_url": "photo"
}
}Request to delete a google credential ¶
Request to delete a google credentialDELETE/users/self/google/:id
Example URI
- id
string(required) Example: 0b80d6cf-e4f8-4f8f-ab93-0368a03ab289
200Body
{
"code": "OK",
"data": {
"type": "google_credential",
"id": "0b80d6cf-e4f8-4f8f-ab93-0368a03ab289",
"user": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "8399d1b0-2925-45b4-bb58-b367f43b23d7",
"email": "emailAddress",
"resource_name": "resourceName",
"display_name": "displayName",
"first_name": "firstName",
"last_name": "lastName",
"photo": "photo",
"messages_total": 100,
"threads_total": 101,
"history_id": 103,
"scope": [
"profile",
"email",
"https://www.googleapis.com/auth/contacts.readonly",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.send",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/calendar"
],
"revoked": false,
"created_at": "2026-05-15T19:09:54.030Z",
"updated_at": "2026-05-15T19:09:54.030Z",
"deleted_at": "2026-05-15T19:09:54.193Z",
"scope_summary": [
"profile",
"contacts.read",
"mail.read",
"mail.send",
"mail.modify",
"calendar"
],
"google_calendar": null,
"last_daily_sync": null,
"cgroups_sync_token": null,
"other_contacts_sync_token": null,
"people_apis_enabled": false,
"jobs": null,
"profile_image_url": "photo"
}
}Request to get list of remote google calendars ¶
Request to get list of remote google calendarsGET/users/google/:gcid/calendars
Example URI
- gcid
string(required) Example: 0b80d6cf-e4f8-4f8f-ab93-0368a03ab289
200Body
{
"code": "OK",
"data": {
"calendars": [
{
"id": "[email protected]",
"name": "[email protected]",
"description": null,
"timeZone": "Asia/Tehran",
"permission": "read.write",
"alreadySynced": true
},
{
"id": "[email protected]",
"name": "[email protected]",
"description": null,
"timeZone": "America/New_York",
"permission": "read.write",
"alreadySynced": false
}
],
"primaryCalendar": {
"id": "[email protected]",
"name": "Rechat",
"description": "rechat-cal-description",
"timeZone": "America/Chicago",
"permission": "read.write",
"alreadySynced": true
},
"isConfigured": true
}
}Request to config google calendars ¶
Request to config google calendarsPOST/users/google/:gcid/conf
Example URI
- gcid
string(required) Example: 0b80d6cf-e4f8-4f8f-ab93-0368a03ab289
Body
{
"toSync": [
"[email protected]"
]
}204Request to reconfig google calendars ¶
Request to reconfig google calendarsPOST/users/google/:gcid/conf
Example URI
- gcid
string(required) Example: 0b80d6cf-e4f8-4f8f-ab93-0368a03ab289
Body
{
"toSync": [
"en.usa#[email protected]"
],
"toStopSync": [
"[email protected]"
]
}204List Google Business Profile accounts ¶
List Google Business Profile accountsGET/users/google/:gcid/business-profile-accounts
Returns the Google Business Profile accounts available under the given Google credential, fetched live from Google. Used to populate the GBP picker UI before connecting a brand testimonial source via [PUT /brands/:id/testimonials/google].
The credential must belong to the authenticated user. Returns 412 GoogleBusinessProfileAuthenticationRequired when the credential does not include the business_profile scope; the web client should use this code to trigger the OAuth re-consent flow.
Example URI
- gcid
string(required) Example: f2ed88ad-7785-487c-9acb-0ed2339fdd59
200Body
{
"code": "OK",
"data": [
{
"type": "google_business_account",
"name": "accounts/111",
"account_name": "Acme Realty",
"account_type": "PERSONAL",
"role": "OWNER",
"verification_state": "VERIFIED"
}
],
"info": {
"count": 1,
"total": 0
}
}