# Gmail Integration via LowCodeAPI
**Last Updated**: February 10, 2026
## Overview
Email service
**Categories:**
- {'id': 'google-suites', 'name': 'Google Suites'}
## Base Endpoint
https://api.lowcodeapi.com/gmail
**Important**: Always include the provider name in the URL path after `api.lowcodeapi.com/`
## Authentication
**Type:** OAUTH2.0
**Official Documentation:** https://developers.google.com/gmail
## URL Format (Important)
LowCodeAPI supports two URL formats. **Always try the New Format first**, then fall back to Old Format if needed.
### New Format (Priority)
- Path parameters stay in the URL path
- Do NOT include path parameters as query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/{id}?api_token=XXX`
### Old Format (Fallback)
- Path parameters become query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/id?id={id}&api_token=XXX`
### Decision Flow for AI Agents
1. Always use **New Format** first - keep path parameters in the URL path
2. If you get a 404 or error, try **Old Format** with sanitized path
3. Log which format worked for future requests to this provider
## API Categories
## Common Endpoints
### Batch requests
**Method:** POST
**LowCodeAPI Path:** /batch
**New Format URL:**
https://api.lowcodeapi.com/gmail/batch?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/batch?api_token=YOUR_API_TOKEN
**Request Body:**
| Field | Type | Description |
|-------|------|-------------|
| requests | array | |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/gmail/batch?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/guides/batch
### Send email
**Method:** POST
**LowCodeAPI Path:** /gmail/v1/users/{userId}/messages/send
**New Format URL:**
https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/messages/send?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/v1/users/userId/messages/send?userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| userId | string | |
**Request Body:**
| Field | Type | Description |
|-------|------|-------------|
| raw | string | |
| snippet | string | |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/messages/send?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send,https://developers.google.com/apps-script/guides/services/quotas,
https://developers.google.com/gmail/api/reference/quota
### Send email with attachement
**Method:** POST
**LowCodeAPI Path:** /upload/gmail/v1/users/{userId}/messages/send
**New Format URL:**
https://api.lowcodeapi.com/gmail/upload/gmail/v1/users/{userId}/messages/send?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/upload/v1/users/userId/messages/send?userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| userId | string | |
**Request Body:**
| Field | Type | Description |
|-------|------|-------------|
| payload | object | |
| raw | string | |
| snippet | string | |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/gmail/upload/gmail/v1/users/{userId}/messages/send?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users.messages/send,https://developers.google.com/gmail/api/guides/uploads,https://developers.google.com/apps-script/guides/services/quotas,
https://developers.google.com/gmail/api/reference/quota
### Gets the current user's Gmail profile
**Method:** GET
**LowCodeAPI Path:** /gmail/v1/users/{userId}/profile
**New Format URL:**
https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/profile?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/v1/users/userId/profile?userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| userId | string | |
**Example Request (New Format):**
```bash
curl -X GET 'https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/profile?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users/getProfile
### User mailbox push notification receiver
**Method:** POST
**LowCodeAPI Path:** /gmail/v1/users/{userId}/stop
**New Format URL:**
https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/stop?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/v1/users/userId/stop?userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| userId | string | |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/stop?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users/stop
### Configure push notification for user mailbox
**Method:** POST
**LowCodeAPI Path:** /gmail/v1/users/{userId}/watch
**New Format URL:**
https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/watch?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/v1/users/userId/watch?userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| userId | string | |
**Request Body:**
| Field | Type | Description |
|-------|------|-------------|
| labelFilterAction | enum | |
| labelFilterBehavior | enum | |
| labelIds[] | string | |
| topicName | string | |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/watch?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users/watch
### Mailbox change history list
**Method:** GET
**LowCodeAPI Path:** /gmail/v1/users/{userId}/history
**New Format URL:**
https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/history?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/v1/users/userId/history?userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| userId | string | |
**Query Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| historyTypes | enum | |
| labelId | string | |
| maxResults | integer | |
| pageToken | string | |
| startHistoryId | string | |
**Example Request (New Format):**
```bash
curl -X GET 'https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/history?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users.history/list
### Creates draft with DRAFT label
**Method:** POST
**LowCodeAPI Path:** /upload/gmail/v1/users/{userId}/drafts
**New Format URL:**
https://api.lowcodeapi.com/gmail/upload/gmail/v1/users/{userId}/drafts?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/v1/users/userId/drafts?userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| userId | string | |
**Example Request (New Format):**
```bash
curl -X POST 'https://api.lowcodeapi.com/gmail/upload/gmail/v1/users/{userId}/drafts?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create
### Deletes the specified draft
**Method:** DELETE
**LowCodeAPI Path:** /gmail/v1/users/{userId}/drafts/{id}
**New Format URL:**
https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/drafts/{id}?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/v1/users/userId/drafts/id?id={id}&userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| id | string | |
| userId | string | |
**Example Request (New Format):**
```bash
curl -X DELETE 'https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/drafts/{id}?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/delete
### Gets the specified draft
**Method:** GET
**LowCodeAPI Path:** /gmail/v1/users/{userId}/drafts/{id}
**New Format URL:**
https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/drafts/{id}?api_token=YOUR_API_TOKEN
**Old Format URL:**
https://api.lowcodeapi.com/gmail/v1/users/userId/drafts/id?id={id}&userId={userId}&api_token=YOUR_API_TOKEN
**Path Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| id | string | |
| userId | string | |
**Query Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| format | enum | |
**Example Request (New Format):**
```bash
curl -X GET 'https://api.lowcodeapi.com/gmail/gmail/v1/users/{userId}/drafts/{id}?api_token=YOUR_API_TOKEN'
```
**Official Documentation:** https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/get
## Usage Examples
### Example 1: Basic API Request
```bash
# List resources - no path parameters needed
curl -X GET "https://api.lowcodeapi.com/gmail/v1/resources?api_token=YOUR_API_TOKEN"
```
### Example 2: Request with Path Parameters
```bash
# Get specific resource by ID
curl -X GET "https://api.lowcodeapi.com/gmail/v1/resources/{RESOURCE_ID}?api_token=YOUR_API_TOKEN"
```
### Example 3: Create or Update Resource
```bash
# Create a new resource
curl -X POST "https://api.lowcodeapi.com/gmail/v1/resources?api_token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "New Resource", "description": "Description"}'
```
## Error Handling
LowCodeAPI returns standard HTTP status codes. Common errors:
| Status Code | Description |
|-------------|-------------|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters or request body |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Endpoint or resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Provider API error |
All error responses include error details:
```json
{
"data": {
"error": {
"message": "Error description",
"code": "ERROR_CODE"
}
}
}
```
## Complete Endpoint Reference
| Endpoint | Method | Category |
|----------|--------|----------|
| Batch requests | POST | Batch |
| Send email | POST | Send |
| Send email with attachement | POST | Send |
| Gets the current user's Gmail profile | GET | Users |
| User mailbox push notification receiver | POST | Users |
| Configure push notification for user mailbox | POST | Users |
| Mailbox change history list | GET | Users |
| Creates draft with DRAFT label | POST | Draft |
| Deletes the specified draft | DELETE | Draft |
| Gets the specified draft | GET | Draft |
| Lists the drafts in the user's mailbox | GET | Draft |
| Send draft to specified recipients | POST | Draft |
| Replaces a draft's content | PUT | Draft |
| Creates a new label | POST | Labels |
| Delete label, remove permanently | DELETE | Labels |
| Gets the specified label | GET | Labels |
| Lists all labels in the user's mailbox | GET | Labels |
| Patch the specified label | PATCH | Labels |
| Updates the specified label | PUT | Labels |
| Delete messages by message ID | POST | Messages |
| Label modification for specified messages | POST | Messages |
| Instantly erases specified message, permanently | DELETE | Messages |
| Gets the specified message. | GET | Messages |
| Message imported to user's mailbox | POST | Messages |
| Message insertion into user's mailbox | POST | Messages |
| Listing user's mailbox messages | GET | Messages |
| Message label modification | POST | Messages |
| Moves message to the trash | POST | Messages |
| Delete message from trash | POST | Messages |
| Gets the specified message attachment | GET | Messages |
| Retrieve auto-forwarding setting for account | GET | Settings |
| Gets IMAP settings | GET | Settings |
| Gets language settings | GET | Settings |
| Gets POP settings | GET | Settings |
| Gets vacation responder settings | GET | Settings |
| Account auto-forwarding setting updated | PUT | Settings |
| Updates IMAP settings | PUT | Settings |
| Updates language settings | PUT | Settings |
| Updates POP settings | PUT | Settings |
| Updates vacation responder settings | PUT | Settings |
| Adds a delegate | POST | Settings |
| Removes the specified delegate | DELETE | Settings |
| Gets the specified delegate | GET | Settings |
| Account delegates listing | GET | Settings |
| Creates a filter | POST | Settings |
| Instantly erases specified filter permanently | DELETE | Settings |
| Gets a filter | GET | Settings |
| Lists the message filters of a Gmail user | GET | Settings |
| Creates a forwarding address | POST | Settings |
| Deletes the specified forwarding address | DELETE | Settings |
| Gets the specified forwarding address | GET | Settings |
| Forwarding address list for specified account | GET | Settings |
| Creates a custom "from" send-as alias | POST | Settings |
| Deletes the specified send-as alias | DELETE | Settings |
| Gets the specified send-as alias | GET | Settings |
| Send-as aliases listed for account | GET | Settings |
| Patch the specified send-as alias | PATCH | Settings |
| Updates a send-as alias | PUT | Settings |
| Verify send-as alias with email | POST | Settings |
| S/MIME config deletion for send-as alias | DELETE | Settings |
| Gets S/MIME config for send-as alias | GET | Settings |
| Upload S/MIME config for send-as alias | POST | Settings |
| Lists S/MIME configs for send-as alias | GET | Settings |
| Default S/MIME config for send-as alias | POST | Settings |
| Gets the specified thread | GET | Thread |
| Lists the threads in the user's mailbox | GET | Thread |
| Modifies the labels applied to the thread | POST | Thread |
| Moves the specified thread to the trash | POST | Thread |
| Removes the specified thread from the trash | POST | Thread |
## API Definition Endpoints
You can fetch the complete API specification for this provider:
**New Format (OpenAPI spec):**
```bash
curl 'https://backend.lowcodeapi.com/gmail/openapi'
```
**Old Format (API definition):**
```bash
curl 'https://backend.lowcodeapi.com/gmail/definition'
```
## Response Format
All responses are wrapped in a `data` key:
```json
{
"data": {
// Actual response from provider (object or array)
}
}
```