Skip to content
Start here

Create integration

client.zeroTrust.casb.integrations.create(IntegrationCreateParams { account_id, application, credentials, 5 more } params, RequestOptionsoptions?): IntegrationCreateResponse { id, application, auth_method, 11 more }
POST/accounts/{account_id}/one/integrations

Creates a new integration for the specified application. Integration creation with OAuth is not supported by API at the moment. For other auth methods, use GET /v2/applications/{application_id}/credential-guide to see the required credential structure and example payloads for each vendor.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
params: IntegrationCreateParams { account_id, application, credentials, 5 more }
account_id: string

Path param: Cloudflare account identifier.

application: "ANTHROPIC" | "AWS" | "BITBUCKET" | 12 more

Body param: Vendor/application slug (e.g., GOOGLE_WORKSPACE).

  • ANTHROPIC - ANTHROPIC
  • AWS - AWS
  • BITBUCKET - BITBUCKET
  • BOX - BOX
  • CONFLUENCE - CONFLUENCE
  • DROPBOX - DROPBOX
  • GITHUB - GITHUB
  • GOOGLE_CLOUD_PLATFORM - GOOGLE_CLOUD_PLATFORM
  • GOOGLE_WORKSPACE - GOOGLE_WORKSPACE
  • JIRA - JIRA
  • MICROSOFT_INTERNAL - MICROSOFT_INTERNAL
  • OPENAI - OPENAI
  • SALESFORCE - SALESFORCE
  • SERVICENOW - SERVICENOW
  • SLACK - SLACK
One of the following:
"ANTHROPIC"
"AWS"
"BITBUCKET"
"BOX"
"CONFLUENCE"
"DROPBOX"
"GITHUB"
"GOOGLE_CLOUD_PLATFORM"
"GOOGLE_WORKSPACE"
"JIRA"
"MICROSOFT_INTERNAL"
"OPENAI"
"SALESFORCE"
"SERVICENOW"
"SLACK"
credentials: Record<string, unknown>

Body param: Credentials for the integration.

name: string

Body param: Name of the integration.

maxLength256
minLength1
auth_method?: string | null

Body param: Authentication method slug (uses default if omitted).

minLength1
dlp_profiles?: Array<string>

Body param: List of DLP profile IDs to associate.

permissions?: Array<string>

Body param: List of permission scopes (uses policy defaults if empty).

use_cases?: Array<"casb" | "ces" | "auto_remediation">

Body param: List of use case or feature slugs to enroll (e.g., [‘casb’, ‘ces’, ‘auto_remediation’]).

One of the following:
"casb"
"ces"
"auto_remediation"
ReturnsExpand Collapse
IntegrationCreateResponse { id, application, auth_method, 11 more }

The requested item.

id: string

Integration ID.

formatuuid
application: Record<string, string | null>
auth_method: Record<string, string> | null

The integration’s authentication method.

created: string

When the integration was created.

formatdate-time
credentials_expiry: string

Credentials expiry time.

formatdate-time
dlp_profiles: Array<string>

DLP Profiles enabled for the integration.

health_details: Array<Record<string, unknown>>

Health details with remediation hints.

is_paused: boolean

Whether the user paused the integration.

last_hydrated: string

Last time the integration was hydrated.

formatdate-time
name: string

Name of the integration.

status: string

Integration status.

updated: string

When the integration was last updated.

formatdate-time
use_cases: Array<Record<string, unknown>>

Use cases enabled for the integration.

Create integration

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const integration = await client.zeroTrust.casb.integrations.create({
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
  application: 'GOOGLE_WORKSPACE',
  credentials: { admin_email: 'admin@corp.com' },
  name: 'My Google Workspace',
  auth_method: 'service_account',
  dlp_profiles: ['e91a2360-da51-4fdf-9711-bcdecd462614'],
  permissions: ['https://www.googleapis.com/auth/drive.readonly'],
  use_cases: ['casb', 'ces'],
});

console.log(integration.id);
{
  "errors": [],
  "messages": [],
  "result": {
    "application": {
      "category": "Productivity",
      "display_name": "Google Workspace",
      "logo": "https://dash.cloudflare.com/v2/static/google_workspace.png"
    },
    "auth_method": {
      "display_name": "OAuth 2.0",
      "id": "oauth"
    },
    "authorization_link": {
      "components": {
        "client_id": "abc",
        "instance_name": "example"
      },
      "link": "https://example.cloudflare.com/authorize"
    },
    "created": "2025-01-01T00:00:00Z",
    "credentials_expiry": "2026-01-01T00:00:00Z",
    "dlp_profiles": [
      "e91a2360-da51-4fdf-9711-bcdecd462614"
    ],
    "health_details": [],
    "id": "019d2e6a-d995-7185-afbd-4feead9e42ec",
    "is_paused": false,
    "last_hydrated": "2025-04-10T08:30:00Z",
    "name": "My Google Workspace",
    "status": "Healthy",
    "updated": "2025-04-10T08:30:00Z",
    "use_cases": [
      {
        "description": "Discover and secure SaaS applications",
        "features": [
          {
            "description": "Automatically remediate security issues (requires write permissions)",
            "id": "auto_remediation",
            "is_enabled": true,
            "name": "Auto Remediation",
            "permissions": [
              {
                "display_name": "Manage users",
                "scope": "https://www.googleapis.com/auth/admin.directory.user",
                "status": "granted"
              }
            ]
          }
        ],
        "id": "casb",
        "is_enabled": true,
        "name": "Cloud Access Security Broker",
        "permissions": [
          {
            "display_name": "Drive (Read Only)",
            "scope": "https://www.googleapis.com/auth/drive.readonly",
            "status": "granted"
          },
          {
            "display_name": "Gmail (Read Only)",
            "scope": "https://www.googleapis.com/auth/gmail.readonly",
            "status": "missing"
          }
        ]
      },
      {
        "description": "Protect against email-based threats",
        "features": [],
        "id": "ces",
        "is_enabled": false,
        "name": "Cloud Email Security",
        "permissions": []
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "errors": [],
  "messages": [],
  "result": {
    "application": {
      "category": "Productivity",
      "display_name": "Google Workspace",
      "logo": "https://dash.cloudflare.com/v2/static/google_workspace.png"
    },
    "auth_method": {
      "display_name": "OAuth 2.0",
      "id": "oauth"
    },
    "authorization_link": {
      "components": {
        "client_id": "abc",
        "instance_name": "example"
      },
      "link": "https://example.cloudflare.com/authorize"
    },
    "created": "2025-01-01T00:00:00Z",
    "credentials_expiry": "2026-01-01T00:00:00Z",
    "dlp_profiles": [
      "e91a2360-da51-4fdf-9711-bcdecd462614"
    ],
    "health_details": [],
    "id": "019d2e6a-d995-7185-afbd-4feead9e42ec",
    "is_paused": false,
    "last_hydrated": "2025-04-10T08:30:00Z",
    "name": "My Google Workspace",
    "status": "Healthy",
    "updated": "2025-04-10T08:30:00Z",
    "use_cases": [
      {
        "description": "Discover and secure SaaS applications",
        "features": [
          {
            "description": "Automatically remediate security issues (requires write permissions)",
            "id": "auto_remediation",
            "is_enabled": true,
            "name": "Auto Remediation",
            "permissions": [
              {
                "display_name": "Manage users",
                "scope": "https://www.googleapis.com/auth/admin.directory.user",
                "status": "granted"
              }
            ]
          }
        ],
        "id": "casb",
        "is_enabled": true,
        "name": "Cloud Access Security Broker",
        "permissions": [
          {
            "display_name": "Drive (Read Only)",
            "scope": "https://www.googleapis.com/auth/drive.readonly",
            "status": "granted"
          },
          {
            "display_name": "Gmail (Read Only)",
            "scope": "https://www.googleapis.com/auth/gmail.readonly",
            "status": "missing"
          }
        ]
      },
      {
        "description": "Protect against email-based threats",
        "features": [],
        "id": "ces",
        "is_enabled": false,
        "name": "Cloud Email Security",
        "permissions": []
      }
    ]
  },
  "success": true
}