curl -X POST https://api.aiql.io/connectors/{connector_type}/connect \
-H "Authorization: Bearer $AIQL_API_KEY"{
"status": "connected",
"connection": {
"id": "<string>",
"connector_type": "<string>",
"name": "<string>",
"workspace_id": "<string>",
"credential_id": "<string>",
"config": {},
"change_token": "<string>",
"last_synced_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
},
"authorization_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Connect
curl -X POST https://api.aiql.io/connectors/{connector_type}/connect \
-H "Authorization: Bearer $AIQL_API_KEY"{
"status": "connected",
"connection": {
"id": "<string>",
"connector_type": "<string>",
"name": "<string>",
"workspace_id": "<string>",
"credential_id": "<string>",
"config": {},
"change_token": "<string>",
"last_synced_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
},
"authorization_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API key or UI session JWT passed as a Bearer token.
Headers
ID of the workspace the request operates on.
Path Parameters
Body
Display name for the new connection.
ID of a credential already known to aiql-api (from a previous OAuth connect) to reuse for this new connection, skipping the OAuth handshake. Optional for google-drive, sharepoint, and microsoft-teams; when omitted, those types instead return an authorization_url to complete the handshake.
Raw credential fields for aiql-api to encrypt and persist itself. Required for odoo (unless credential_id is given): {url, db, username, api_key}.
Connector-specific configuration: root_folder_id (google-drive); site_id, drive_id, include_shared_with_me, tenant_id (sharepoint); drive_id, include_shared_with_me, tenant_id (onedrive); user_filter, tenant_id (microsoft-teams, tenant_id required when starting a new OAuth handshake).
Where to send the user's browser after the OAuth handshake finishes (only used for google-drive, sharepoint, and microsoft-teams when no credential_id is given). The final callback redirects here with ?status=success|error&connection_id=... appended. When omitted, a static aiql-api-hosted confirmation page is shown instead.
Response
Successful Response
'connected' when the connection was created immediately (odoo, or an OAuth type reusing an existing credential_id). 'pending_authorization' when the caller must send the user's browser to authorization_url to finish connecting.
connected, pending_authorization Populated when status == 'connected'.
Show child attributes
Show child attributes
Populated when status == 'pending_authorization'. Open this URL in the user's browser (redirect or popup) to complete the OAuth handshake.
When authorization_url stops being valid.