Provision
Automatically provision a well-known drive integration (Google Drive or OneDrive) with pre-configured OAuth settings. This is an idempotent endpoint — if an integration of the requested type already exists, it returns the existing one.
POST /api/integrations/provision
Provision or retrieve a drive integration by type.
Authentication: Required
Permissions:
- If an integration of the requested type already exists, any authenticated user with
integrations.readcan retrieve it. - If no integration exists yet, the user must also have
integrationCreationpermission to create one. Otherwise a403is returned.
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
driverType | string | Yes | The drive type to provision. Must be googledrive or onedrive. |
Example Request:
{
"driverType": "googledrive"
}
Response (201 Created): When a new integration is provisioned.
{
"id": "abc123",
"type": "googledrive",
"name": "Google Drive",
"imageUrl": "/images/icons/integrations/googledrive.svg",
"clientId": "entrinsik_google_drive",
"shared": true,
"ownerId": "admin"
}
Response (200 OK): When an existing integration of the requested type is found.
{
"id": "abc123",
"type": "googledrive",
"name": "Google Drive",
"shared": true
}
Error Responses:
| Status | Description |
|---|---|
400 | Invalid or missing driverType |
403 | No integration exists and user lacks integrationCreation permission |
Idempotent
This endpoint is safe to call multiple times. The first call creates the integration; subsequent calls return the existing one. This makes it ideal for on-demand provisioning from features like the Drive Upload job action.