POST
Create an export rule
Request · Response · Guide: Export rules
The rule shows up in the fileAI app too.The integration must be connected (GET /v1/export-connections). options takes the same settings the app saves for that integration and must match the integration’s optionsSchema (GET /v1/export-integrations); they are also checked against the integration before the rule is saved.

Authorizations

x-api-key
string
header
required

API key for authentication

Headers

Idempotency-Key
string
required

Required opaque key (max 255 chars, UUIDv4 recommended) making this request idempotent for 24h: a retry with the same key and body replays the original response with Idempotent-Replayed: true. Omitting it is a 400; reusing a key with a different body is a 422; retrying while the first request is still in flight is a 409.

Body

application/json
integration
enum<string>
required

Where the files go, as returned by GET /v1/export-integrations. The organization must have it connected.

Available options:
GoogleDrive,
GoogleSheets,
OneDrive,
SharePoint,
Xero,
Quickbooks,
Wafeq,
Odoo
Example:

"GoogleDrive"

folderIds
string[]
required

Folders whose files this rule exports (1 to 100).

Example:
options
object
required

Integration settings, in the same shape the fileAI app saves. They must match the integration's optionsSchema from GET /v1/export-integrations; unknown field names are rejected.

Example:
contactId
string | null

Only files from this contact, a contact in this workspace. Omit or null for any contact.

schemaId
string | null

Only files of this file type: the schema's blueprintId from GET /v1/schemas (not its id). The file type must be approved. Omit or null for any schema.

autoExport
boolean
default:false

Export matching files automatically once they are processed.

Response

The created rule.

id
string
required
Example:

"6630f1c2a1b2c3d4e5f60799"

integration
enum<string>
required
Available options:
GoogleDrive,
GoogleSheets,
OneDrive,
SharePoint,
Xero,
Quickbooks,
Wafeq,
Odoo
Example:

"GoogleDrive"

folderIds
string[]
required
Example:
contactId
string | null
required

null means any contact.

schemaId
string | null
required

The file type: a schema's blueprintId from GET /v1/schemas. null means any schema.

autoExport
boolean
required
Example:

true

options
object
required

Integration settings, as saved.

createdAt
string<date-time>
required
updatedAt
string<date-time>
required