> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# integrations

***

## Overview

Integrations module for calling integration methods.

This module provides access to integration methods for interacting with external services. Unlike the connectors module that gives you raw OAuth tokens, integrations provide pre-built functions that Base44 executes on your behalf.

### Integration Types

There are two types of integrations:

* **Built-in integrations** (`Core`): Pre-built functions provided by Base44 for common tasks such as AI-powered text generation, image creation, file uploads, and email. Access core integration methods using:
  ```
  base44.integrations.Core.FunctionName(params)
  ```

* **Custom workspace integrations** (`custom`): Pre-configured external APIs set up by workspace administrators. Workspace integration calls are proxied through Base44's backend, so credentials are never exposed to the frontend. Access custom workspace integration methods using:

  ```
  base44.integrations.custom.call(slug, operationId, params)
  ```

  > [!NOTE]
  >
  > To call a custom workspace integration, it must be pre-configured by a workspace administrator who imports an OpenAPI specification. Learn more about [custom workspace integrations](https://docs.base44.com/documentation/integrations/managing-workspace-integrations.md).

### Authentication Modes

This module is available to use with a client in all authentication modes:

* **Anonymous or User authentication** (`base44.integrations`): Integration methods are invoked with the current user's permissions. Anonymous users invoke methods without authentication, while authenticated users invoke methods with their authentication context.
* **Service role authentication** (`base44.asServiceRole.integrations`): Integration methods are invoked with the service role for backend code that needs elevated permissions.

#### Example

```typescript const response = await base44.integrations.Core.InvokeLLM({ theme={null}
  prompt: 'Explain quantum computing',
  model: 'gpt_5'
});
```

#### Example

```typescript const result = await base44.integrations.custom.call( theme={null}
  'github',
  'get:/repos/{owner}/{repo}',
  { pathParams: { owner: 'myorg', repo: 'myrepo' } }
);
```

## Core Integrations Methods

Core package containing built-in Base44 integration functions.

### InvokeLLM()

> **InvokeLLM**(`params`): `Promise`\<`string` | `object`>

Generate text or structured JSON data using AI models.

#### Parameters

**params** `InvokeLLMParams` *required*

Parameters for the LLM invocation

> [accordion] Properties
>
> **prompt** `string` *required*
>
> The prompt text to send to the model
>
> **model** `"gemini_3_8_flash" | "gpt_6_luna" | "claude-sonnet-5" | "claude_opus_5_5" | "gpt_6_sol" | "gpt_6_astra" | "claude_fable_5_1" | "glm_5_2" | "gemini_3_1_pro" | "gpt_5_4" | "claude_sonnet_4_6" | "claude_opus_4_6" | "claude_opus_4_7" | "claude_opus_4_8" | "claude_opus_5" | "gpt_5_6_terra" | "gpt_5_6_sol" | "gpt_5_6_luna"`
>
> Optionally specify a model to override the app-level model setting for this specific call.
>
> Options: `"gemini_3_8_flash"`, `"gpt_6_luna"`, `"claude-sonnet-5"`, `"claude_opus_5_5"`, `"gpt_6_sol"`, `"gpt_6_astra"`, `"claude_fable_5_1"`, `"glm_5_2"`, `"gemini_3_1_pro"`, `"gpt_5_4"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`, `"claude_opus_4_7"`, `"claude_opus_4_8"`, `"claude_opus_5"`, `"gpt_5_6_terra"`, `"gpt_5_6_sol"`, `"gpt_5_6_luna"`
>
> **add\_context\_from\_internet** `boolean`
>
> If set to `true`, the LLM will use Google Search, Maps, and News to gather real-time context before answering.
>
> **response\_json\_schema** `object`
>
> If you want structured data back, provide a [JSON schema object](https://json-schema.org/understanding-json-schema/reference/object) here. If provided, the function returns a JSON object; otherwise, it returns a string.
>
> **file\_urls** `string[]`
>
> A list of file URLs (uploaded via UploadFile) to provide as context/attachments to the LLM. Do not use this together with `add_context_from_internet`.

#### Returns

`Promise<string | object>`

Promise resolving to a string (when no schema provided) or an object (when schema provided).

#### Examples

```typescript Basic prompt theme={null}
const response = await base44.integrations.Core.InvokeLLM({
  prompt: "Write a haiku about coding."
});
```

```typescript Prompt with internet context theme={null}
const response = await base44.integrations.Core.InvokeLLM({
  prompt: "What is the current stock price of Wix and what was the latest major news about it?",
  add_context_from_internet: true
});
```

```typescript Structured JSON response theme={null}
const response = await base44.integrations.Core.InvokeLLM({
  prompt: "Analyze the sentiment of this review: 'The service was slow but the food was amazing.'",
  response_json_schema: {
    type: "object",
    properties: {
      sentiment: { type: "string", enum: ["positive", "negative", "mixed"] },
      score: { type: "number", description: "Score from 1-10" },
      key_points: { type: "array", items: { type: "string" } }
    }
  }
});
// Returns object: { sentiment: "mixed", score: 7, key_points: ["slow service", "amazing food"] }
```

***

### GenerateImage()

> **GenerateImage**(`params`): `Promise`\<`GenerateImageResult`>

Create AI-generated images from text prompts, optionally guided by reference images.

Images are generated as PNG files at approximately 1024px on the shorter side. The
exact dimensions vary by aspect ratio.

Pass `existing_image_urls` to edit an existing image or to guide the result
with reference images. To choose the model, aspect ratio, resolution, or
quality, use the [AI Gateway image endpoints](https://docs.base44.com/developers/references/sdk/getting-started/ai-gateway-images.md)
instead.

Prompts that violate the AI provider's content policy are refused.

#### Parameters

**params** `GenerateImageParams` *required*

Parameters for image generation

> [accordion] Properties
>
> **prompt** `string` *required*
>
> Description of the image to generate. When you pass `existing_image_urls`,
> describe what to do with the reference images instead.
>
> **existing\_image\_urls** `string[]`
>
> URLs of images to use as references, for example to edit an existing
> image, match a style, or add visual context. Images that can't be read are
> skipped. If none of them can be read, the request fails.

#### Returns

`GenerateImageResult`

Promise resolving to an object containing the URL of the generated PNG image.

> [accordion] Properties
>
> **url** `string` *required*
>
> URL of the generated image.

#### Examples

```typescript Generate an image from a text prompt theme={null}
const {url} = await base44.integrations.Core.GenerateImage({
  prompt: "A serene mountain landscape with a lake in the foreground"
});
console.log(url); // https://...generated_image.png
```

```typescript Edit an existing image theme={null}
const {url} = await base44.integrations.Core.GenerateImage({
  prompt: "Replace the background with a sunset beach",
  existing_image_urls: [productPhotoUrl]
});
```

***

### UploadFile()

> **UploadFile**(`params`): `Promise`\<`UploadFileResult`>

Upload files to public storage and get a URL.

#### Parameters

**params** `UploadFileParams` *required*

Parameters for file upload

> [accordion] Properties
>
> **file** `File` *required*
>
> The file object to upload.

#### Returns

`UploadFileResult`

Promise resolving to an object containing the uploaded file URL.

> [accordion] Properties
>
> **file\_url** `string` *required*
>
> URL of the uploaded file.

#### Example

```typescript Upload a file in React theme={null}
const handleFileUpload = async (event: React.ChangeEvent<HTMLInputElement>) => {
  const file = event.target.files?.[0];
  if (!file) return;

  const { file_url } = await base44.integrations.Core.UploadFile({ file });
  console.log(file_url); // https://...uploaded_file.pdf
};
```

***

### SendEmail()

> **SendEmail**(`params`): `Promise`\<`any`>

Send an email from your app.

You can always email registered users of your app. To email anyone else, the app needs a paid plan and a connected custom domain.

#### Parameters

**params** `SendEmailParams` *required*

Parameters for sending email. Set at least one of `body`, `html`, or `text`.

> [accordion] Properties
>
> **to** `string` *required*
>
> Recipient email address.
>
> **subject** `string` *required*
>
> Email subject line.
>
> **body** `string`
>
> HTML email body. The same as `html`, so set one or the other, not both.
>
> **html** `string`
>
> HTML email body. The same as `body`, so set one or the other, not both.
>
> **text** `string`
>
> Plain-text email body. On its own, it sends a plain-text email. Set it together with `body` or `html` to send both versions in one email, and the recipient's mail client shows whichever it prefers. Make sure both versions say the same thing.
>
> **from\_name** `string`
>
> The name of the sender. If omitted, the app's name is used.
>
> **attachments** `EmailAttachment[]`
>
> Files to attach. You can attach up to 5 files, up to 5 MB each and 10 MB in total. Set `filename` and exactly one of `file_url` or `content` on each file.
>
> > [accordion] Properties
> >
> > **filename** `string` *required*
> >
> > File name the recipient sees, including the extension. The supported extensions are `csv`, `docx`, `gif`, `ics`, `jpeg`, `jpg`, `md`, `pdf`, `png`, `txt`, `webp`, and `xlsx`.
> >
> > **file\_url** `string`
> >
> > A file your app already uploaded, such as the `file_url` returned by [`UploadFile()`](#uploadfile) or the `file_uri` returned by [`UploadPrivateFile()`](#uploadprivatefile). Files uploaded by other apps are rejected.
> >
> > **content** `string`
> >
> > Base64-encoded file contents, for a file your code generated.

#### Returns

`Promise<any>`

Promise resolving when the email is sent.

#### Examples

```typescript Send an HTML email with a plain-text version theme={null}
await base44.integrations.Core.SendEmail({
  to: "user@example.com",
  subject: "Your order has shipped",
  html: "<p>Your order <strong>#1234</strong> is on its way.</p>",
  text: "Your order #1234 is on its way.",
});
```

```typescript Attach a file your app uploaded theme={null}
const { file_url } = await base44.integrations.Core.UploadFile({ file });
await base44.integrations.Core.SendEmail({
  to: "user@example.com",
  subject: "Your invoice",
  html: "<p>Your invoice is attached.</p>",
  attachments: [{ filename: "invoice.pdf", file_url }],
});
```

***

### ExtractDataFromUploadedFile()

> **ExtractDataFromUploadedFile**(`params`): `Promise`\<`object`>

Extract structured data from uploaded files based on the specified schema.

Start by uploading the file to public storage using the [`UploadFile()`](#uploadfile) function. Then, use the `file_url` parameter to extract structured data from the uploaded file.

#### Parameters

**params** `ExtractDataFromUploadedFileParams` *required*

Parameters for data extraction

> [accordion] Properties
>
> **file\_url** `string` *required*
>
> The URL of the uploaded file to extract data from.
>
> **json\_schema** `object` *required*
>
> A [JSON schema object](https://json-schema.org/understanding-json-schema/reference/object) defining what data fields you want to extract.

#### Returns

`Promise<object>`

Promise resolving to the extracted data.

#### Examples

```typescript Extract data from an already uploaded file theme={null}
const result = await base44.integrations.Core.ExtractDataFromUploadedFile({
  file_url: "https://example.com/files/invoice.pdf",
  json_schema: {
    type: "object",
    properties: {
      invoice_number: { type: "string" },
      total_amount: { type: "number" },
      date: { type: "string" },
      vendor_name: { type: "string" }
    }
  }
});
console.log(result); // { invoice_number: "INV-12345", total_amount: 1250.00, ... }
```

```typescript Upload a file and extract data in React theme={null}
const handleFileExtraction = async (event: React.ChangeEvent<HTMLInputElement>) => {
  const file = event.target.files?.[0];
  if (!file) return;

  // First, upload the file
  const { file_url } = await base44.integrations.Core.UploadFile({ file });

  // Then extract structured data from it
  const result = await base44.integrations.Core.ExtractDataFromUploadedFile({
    file_url,
    json_schema: {
      type: "object",
      properties: {
        summary: {
          type: "string",
          description: "A brief summary of the file content"
        },
        keywords: {
          type: "array",
          items: { type: "string" }
        },
        document_type: {
          type: "string"
        }
      }
    }
  });
  console.log(result); // { summary: "...", keywords: [...], document_type: "..." }
};
```

***

### UploadPrivateFile()

> **UploadPrivateFile**(`params`): `Promise`\<`UploadPrivateFileResult`>

Upload files to private storage that requires a signed URL to access.

Create a signed URL to access uploaded files using the [`CreateFileSignedUrl()`](#createfilesignedurl) function.

#### Parameters

**params** `UploadPrivateFileParams` *required*

Parameters for private file upload

> [accordion] Properties
>
> **file** `File` *required*
>
> The file object to upload.

#### Returns

`UploadPrivateFileResult`

Promise resolving to an object with a `file_uri` used to create a signed URL to access the uploaded file.

> [accordion] Properties
>
> **file\_uri** `string` *required*
>
> URI of the uploaded private file, used to create a signed URL.

#### Examples

```typescript Upload a private file theme={null}
const { file_uri } = await base44.integrations.Core.UploadPrivateFile({ file });
console.log(file_uri); // "private/user123/document.pdf"
```

```typescript Upload a private file and create a signed URL theme={null}
const handlePrivateUpload = async (event: React.ChangeEvent<HTMLInputElement>) => {
  const file = event.target.files?.[0];
  if (!file) return;

  // Upload to private storage
  const { file_uri } = await base44.integrations.Core.UploadPrivateFile({ file });

  // Create a signed URL that expires in 1 hour (3600 seconds)
  const { signed_url } = await base44.integrations.Core.CreateFileSignedUrl({
    file_uri,
    expires_in: 3600
  });

  console.log(signed_url); // Temporary URL to access the private file
};
```

***

### CreateFileSignedUrl()

> **CreateFileSignedUrl**(`params`): `Promise`\<`CreateFileSignedUrlResult`>

Generate temporary access links for private files.

Start by uploading the file to private storage using the [`UploadPrivateFile()`](#uploadprivatefile) function. Then, use the `file_uri` parameter to create a signed URL to access the uploaded file.

#### Parameters

**params** `CreateFileSignedUrlParams` *required*

Parameters for creating signed URL

> [accordion] Properties
>
> **file\_uri** `string` *required*
>
> URI of the uploaded private file.
>
> **expires\_in** `number`
>
> How long the signed URL should be valid for, in seconds. Must be between `60` (1 minute) and `3600` (1 hour).

#### Returns

`CreateFileSignedUrlResult`

Promise resolving to an object with a temporary `signed_url`.

> [accordion] Properties
>
> **signed\_url** `string` *required*
>
> Temporary signed URL to access the private file.

#### Example

```typescript Create a signed URL for a private file theme={null}
const { signed_url } = await base44.integrations.Core.CreateFileSignedUrl({
  file_uri: "private/user123/document.pdf",
  expires_in: 1800 // URL expires in 30 minutes
});
console.log(signed_url); // https://...?signature=...
```

## Custom Integrations Methods

Module for calling custom pre-configured API integrations.
Custom integrations allow workspace administrators to connect any external API by importing an OpenAPI specification. Apps in the workspace can then call these integrations using this module.

### call()

> **call**(\
> `slug`,\
> `operationId`,\
> `params?`\
> ): `Promise`\<`CustomIntegrationCallResponse`>

Call a custom integration endpoint.

#### Parameters

> [accordion] Properties
>
> **slug** `string` *required*
>
> The integration's unique identifier, as defined by the workspace admin.
>
> **operationId** `string` *required*
>
> The endpoint in `method:path` format. For example, `"get:/contacts"`, or `"post:/users/{id}"`. The method is the HTTP verb in lowercase and the path matches the OpenAPI specification.
>
> **params** `CustomIntegrationCallParams`
>
> Optional parameters including payload, pathParams, and queryParams.

#### Returns

`Promise<CustomIntegrationCallResponse>`

Promise resolving to the integration call response.

#### Throws

* If slug is not provided.
* If operationId is not provided.
* If the integration or operation is not found (404).
* If the external API call fails (502).
* If the request times out (504).

#### Examples

```typescript Call a custom CRM integration theme={null}
const response = await base44.integrations.custom.call(
  "my-crm",
  "get:/contacts",
  { queryParams: { limit: 10 } }
);

if (response.success) {
  console.log("Contacts:", response.data);
}
```

```typescript Call with path params and request body theme={null}
const response = await base44.integrations.custom.call(
  "github",
  "post:/repos/{owner}/{repo}/issues",
  {
    pathParams: { owner: "myorg", repo: "myrepo" },
    payload: {
      title: "Bug report",
      body: "Something is broken"
    }
  }
);
```

## Type Definitions

### Core

> **Core**: `CoreIntegrations`

Core package containing built-in Base44 integration functions.

#### Example

```typescript Invoke an LLM theme={null}
const response = await base44.integrations.Core.InvokeLLM({
  prompt: 'Explain quantum computing',
  model: 'gpt-4'
});
```

### custom

> **custom**: `CustomIntegrationsModule`

Workspace integrations module for calling pre-configured external APIs.

#### Example

```typescript Call a custom integration theme={null}
const result = await base44.integrations.custom.call(
  'github',
  'get:/repos/{owner}/{repo}',
  { pathParams: { owner: 'myorg', repo: 'myrepo' } }
);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.