Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

API key passed as a Bearer token in the Authorization header.

Headers

AiQL-Workspace
string
required

ID of the workspace the request operates on.

Path Parameters

connector_type
string
required

Body

application/json
name
string
required

Display name for the new connection.

credential_id
string | null

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.

credential
Credential · object | null

Raw credential fields for aiql-api to encrypt and persist itself. Required for odoo (unless credential_id is given): {url, db, username, api_key}.

config
Config · object

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).

return_url
string | null

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

status
enum<string>
required

'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.

Available options:
connected,
pending_authorization
connection
Connection · object | null

Populated when status == 'connected'.

authorization_url
string | null

Populated when status == 'pending_authorization'. Open this URL in the user's browser (redirect or popup) to complete the OAuth handshake.

expires_at
string<date-time> | null

When authorization_url stops being valid.