托管OAuth连接100+ API(Google Workspace、Microsoft 365、GitHub、Notion、Slack、Airtable、HubSpot等),适用于用户需要...
Passthrough proxy for direct access to third-party APIs using managed OAuth connections, provided by Maton. The API gateway lets you call native API endpoints directly.
bash
# Native Slack API call
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'channel': 'C0123456', 'text': 'Hello from gateway!'}).encode()
req = urllib.request.Request('https://gateway.maton.ai/slack/api/chat.postMessage', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
text
https://gateway.maton.ai/{app}/{native-api-path}
Replace {app} with the service name and {native-api-path} with the actual API endpoint path.
IMPORTANT: The URL path MUST start with the connection's app name (eg. /google-mail/...). This prefix tells the gateway which app connection to use. For example, the native Gmail API path starts with gmail/v1/, so full paths look like /google-mail/gmail/v1/users/me/messages.
All requests require the Maton API key in the Authorization header:
text
Authorization: Bearer $MATON_API_KEY
The API gateway automatically injects the appropriate OAuth token for the target service.
Environment Variable: You can set your API key as the MATON_API_KEY environment variable:
bash
export MATON_API_KEY="YOUR_API_KEY"
Connection management uses a separate base URL: https://ctrl.maton.ai
bash
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=slack&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Query Parameters (optional):
app - Filter by service name (e.g., slack, hubspot, salesforce)status - Filter by connection status ( ACTIVE, PENDING, FAILED)Response:
json
{
"connections": [
{
"connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
"status": "ACTIVE",
"creation_time": "2025-12-08T07:20:53.488460Z",
"last_updated_time": "2026-01-31T20:03:32.593153Z",
"url": "https://connect.maton.ai/?session_token=5e9...",
"app": "slack",
"method": "OAUTH2",
"metadata": {}
}
]
}
bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'slack'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Request Body:
app (required) - Service name (e.g., slack, notion)method (optional) - Connection method ( API_KEY, BASIC, OAUTH1, OAUTH2, MCP)bash
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
json
{
"connection": {
"connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
"status": "ACTIVE",
"creation_time": "2025-12-08T07:20:53.488460Z",
"last_updated_time": "2026-01-31T20:03:32.593153Z",
"url": "https://connect.maton.ai/?session_token=5e9...",
"app": "slack",
"metadata": {}
}
}
Open the returned URL in a browser to complete OAuth.
bash
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple connections for the same app, you can specify which connection to use by adding the Maton-Connection header with the connection ID:
bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'channel': 'C0123456', 'text': 'Hello!'}).encode()
req = urllib.request.Request('https://gateway.maton.ai/slack/api/chat.postMessage', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
req.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If omitted, the gateway uses the default (oldest) active connection for that app.
ServiceApp NameBase URL ProxiedActiveCampaignactive-campaign``{account}.api-us1.comAcuity Schedulingacuity-scheduling``acuityscheduling.comAirtableairtable``api.airtable.comApolloapollo``api.apollo.ioAsanaasana``app.asana.comAttioattio``api.attio.comBasecampbasecamp``3.basecampapi.comBaserowbaserow``api.baserow.iobeehiivbeehiiv``api.beehiiv.comBoxbox``api.box.comBrevobrevo``api.brevo.comBrave Searchbrave-search``api.search.brave.comBufferbuffer``api.buffer.comCalendlycalendly``api.calendly.comCal.comcal-com``api.cal.comCallRailcallrail``api.callrail.comChargebeechargebee``{subdomain}.chargebee.comClickFunnelsclickfunnels``{subdomain}.myclickfunnels.comClickSendclicksend``rest.clicksend.comClickUpclickup``api.clickup.comClockifyclockify``api.clockify.meCodacoda``coda.ioConfluenceconfluence``api.atlassian.comCompanyCamcompanycam``api.companycam.comCognito Formscognito-forms``www.cognitoforms.comConstant Contactconstant-contact``api.cc.emailDropboxdropbox``api.dropboxapi.comDropbox Businessdropbox-business``api.dropboxapi.comElevenLabselevenlabs``api.elevenlabs.ioEventbriteeventbrite``www.eventbriteapi.comExaexa``api.exa.aifal.aifal-ai``queue.fal.runFathomfathom``api.fathom.aiFirecrawlfirecrawl``api.firecrawl.devFirebasefirebase``firebase.googleapis.comFirefliesfireflies``api.fireflies.aiGetResponsegetresponse``api.getresponse.comGrafanagrafanaUser's Grafana instanceGitHubgithub``api.github.comGumroadgumroad``api.gumroad.comGranola MCPgranola``mcp.granola.aiGoogle Adsgoogle-ads``googleads.googleapis.comGoogle BigQuerygoogle-bigquery``bigquery.googleapis.comGoogle Analytics Admingoogle-analytics-admin``analyticsadmin.googleapis.comGoogle Analytics Datagoogle-analytics-data``analyticsdata.googleapis.comGoogle Calendargoogle-calendar``www.googleapis.comGoogle Classroomgoogle-classroom``classroom.googleapis.comGoogle Contactsgoogle-contacts``people.googleapis.comGoogle Docsgoogle-docs``docs.googleapis.comGoogle Drivegoogle-drive``www.googleapis.comGoogle Formsgoogle-forms``forms.googleapis.comGmailgoogle-mail``gmail.googleapis.comGoogle Merchantgoogle-merchant``merchantapi.googleapis.comGoogle Meetgoogle-meet``meet.googleapis.comGoogle Playgoogle-play``androidpublisher.googleapis.comGoogle Search Consolegoogle-search-console``www.googleapis.comGoogle Sheetsgoogle-sheets``sheets.googleapis.comGoogle Slidesgoogle-slides``slides.googleapis.comGoogle Tasksgoogle-tasks``tasks.googleapis.comGoogle Workspace Admingoogle-workspace-admin``admin.googleapis.comHubSpothubspot``api.hubapi.comInstantlyinstantly``api.instantly.aiJirajira``api.atlassian.comJobberjobber``api.getjobber.comJotFormjotform``api.jotform.comKagglekaggle``api.kaggle.comKeapkeap``api.infusionsoft.comKibanakibanaUser's Kibana instanceKitkit``api.kit.comKlaviyoklaviyo``a.klaviyo.comLemlistlemlist``api.lemlist.comLinearlinear``api.linear.appLinkedInlinkedin``api.linkedin.comMailchimpmailchimp``{dc}.api.mailchimp.comMailerLitemailerlite``connect.mailerlite.comMailgunmailgun``api.mailgun.netManyChatmanychat``api.manychat.comManusmanus``api.manus.aiMicrosoft Excelmicrosoft-excel``graph.microsoft.comMicrosoft Teamsmicrosoft-teams``graph.microsoft.comMicrosoft To Domicrosoft-to-do``graph.microsoft.comMonday.commonday``api.monday.comMotionmotion``api.usemotion.comNetlifynetlify``api.netlify.comNotionnotion``api.notion.comNotion MCPnotion``mcp.notion.comOneNoteone-note``graph.microsoft.comOneDriveone-drive``graph.microsoft.comOutlookoutlook``graph.microsoft.comPDF.copdf-co``api.pdf.coPipedrivepipedrive``api.pipedrive.comPodiopodio``api.podio.comPostHogposthog``{subdomain}.posthog.comQuickBooksquickbooks``quickbooks.api.intuit.comQuoquo``api.openphone.comReductoreducto``platform.reducto.aiResendresend``api.resend.comSalesforcesalesforce``{instance}.salesforce.comSentrysentry``{subdomain}.sentry.ioSharePointsharepoint``graph.microsoft.comSignNowsignnow``api.signnow.comSlackslack``slack.comSnapchatsnapchat``adsapi.snapchat.comSquaresquareup``connect.squareup.comSquarespacesquarespace``api.squarespace.comSunsama MCPsunsamaMCP serverStripestripe``api.stripe.comSysteme.iosysteme``api.systeme.ioTallytally``api.tally.soTavilytavily``api.tavily.comTelegramtelegram``api.telegram.orgTickTickticktick``api.ticktick.comTodoisttodoist``api.todoist.comToggl Tracktoggl-track``api.track.toggl.comTrellotrello``api.trello.comTwiliotwilio``api.twilio.comTwenty CRMtwenty``api.twenty.comTypeformtypeform``api.typeform.comUnbounceunbounce``api.unbounce.comVimeovimeo``api.vimeo.comWATIwati``{tenant}.wati.ioWhatsApp Businesswhatsapp-business``graph.facebook.comWooCommercewoocommerce``{store-url}/wp-json/wc/v3WordPress.comwordpress``public-api.wordpress.comWrikewrike``www.wrike.comXeroxero``api.xero.comYouTubeyoutube``www.googleapis.comZoho Biginzoho-bigin``www.zohoapis.comZoho Bookingszoho-bookings``www.zohoapis.comZoho Bookszoho-books``www.zohoapis.comZoho Calendarzoho-calendar``calendar.zoho.comZoho CRMzoho-crm``www.zohoapis.comZoho Inventoryzoho-inventory``www.zohoapis.comZoho Mailzoho-mail``mail.zoho.comZoho Peoplezoho-people``people.zoho.comZoho Projectszoho-projects``projectsapi.zoho.comZoho Recruitzoho-recruit``recruit.zoho.com
See references/ for detailed routing guides per provider:
bash
# Native Slack API: POST https://slack.com/api/chat.postMessage
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'channel': 'C0123456', 'text': 'Hello!'}).encode()
req = urllib.request.Request('https://gateway.maton.ai/slack/api/chat.postMessage', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json; charset=utf-8')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
# Native HubSpot API: POST https://api.hubapi.com/crm/v3/objects/contacts
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'properties': {'email': 'john@example.com', 'firstname': 'John', 'lastname': 'Doe'}}).encode()
req = urllib.request.Request('https://gateway.maton.ai/hubspot/crm/v3/objects/contacts', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
# Native Sheets API: GET https://sheets.googleapis.com/v4/spreadsheets/{id}/values/{range}
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/google-sheets/v4/spreadsheets/122BS1sFN2RKL8AOUQjkLdubzOwgqzPT64KfZ2rvYI4M/values/Sheet1!A1:B2')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
# Native Salesforce API: GET https://{instance}.salesforce.com/services/data/v64.0/query?q=...
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/salesforce/services/data/v64.0/query?q=SELECT+Id,Name+FROM+Contact+LIMIT+10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
# Native Airtable API: GET https://api.airtable.com/v0/meta/bases/{id}/tables
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/airtable/v0/meta/bases/appgqan2NzWGP5sBK/tables')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
# Native Notion API: POST https://api.notion.com/v1/data_sources/{id}/query
python <<'EOF'
import urllib.request, os, json
data = json.dumps({}).encode()
req = urllib.request.Request('https://gateway.maton.ai/notion/v1/data_sources/23702dc5-9a3b-8001-9e1c-000b5af0a980/query', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
req.add_header('Notion-Version', '2025-09-03')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
# Native Stripe API: GET https://api.stripe.com/v1/customers
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/stripe/v1/customers?limit=10')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
javascript
const response = await fetch('https://gateway.maton.ai/slack/api/chat.postMessage', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
},
body: JSON.stringify({ channel: 'C0123456', text: 'Hello!' })
});
python
import os
import requests
response = requests.post(
'https://gateway.maton.ai/slack/api/chat.postMessage',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
json={'channel': 'C0123456', 'text': 'Hello!'}
)
StatusMeaning400Missing connection for the requested app401Invalid or missing Maton API key429Rate limited (10 requests/second per account)500Internal Server Error4xx/5xxPassthrough error from the target API
Errors from the target API are passed through with their original status codes and response bodies.
MATON_API_KEY environment variable is set:bash
echo $MATON_API_KEY
bash
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
/google-mail/. For example:https://gateway.maton.ai/google-mail/gmail/v1/users/me/messageshttps://gateway.maton.ai/gmail/v1/users/me/messagesbash
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=google-mail&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
A 500 error may indicate an expired OAuth token. Try creating a new connection via the Connection Management section above and completing OAuth authorization. If the new connection is "ACTIVE", delete the old connection to ensure the gateway uses the new one.
fields[], sort[], records[]), use the -g flag to disable glob parsingjq, environment variables may not expand correctly in some shells, which can cause "Invalid API key" errorsUse native API docs: Refer to each service's official API documentation for endpoint paths and parameters.
Headers are forwarded: Custom headers (except Host and Authorization) are forwarded to the target API.
Query params work: URL query parameters are passed through to the target API.
All HTTP methods supported: GET, POST, PUT, PATCH, DELETE are all supported.
QuickBooks special case: Use :realmId in the path and it will be replaced with the connected realm ID.