Skip to content

API reference: Compliance bundle export

The compliance bundle export API exports compliance bundle definitions as portable JSON and imports them into the current Arbitex instance. Use it to share compliance bundles across organizations, migrate bundles between environments, or archive bundle definitions for compliance documentation.

This API is separate from the full org config backup (/api/admin/orgs/{org_id}/config/export). It operates on individual compliance bundles and supports conflict resolution modes.

All endpoints require admin authentication.

Base path: /api/admin/compliance-bundles-export


MethodPathDescription
GET/api/admin/compliance-bundles-export/{bundle_id}Export a single compliance bundle
GET/api/admin/compliance-bundles-export/Export all compliance bundles
POST/api/admin/compliance-bundles-export/Import compliance bundles

FieldTypeDescription
namestringBundle name (unique per org)
descriptionstring | nullOptional description
regulatory_frameworkstringRegulatory framework code, e.g. "SOC2", "HIPAA", "GDPR"
versionstringBundle definition version
enabledbooleanWhether the bundle is currently active
seed_rule_mappingsarray of stringsEntity type strings mapped to DLP rule associations
exported_atstringISO 8601 timestamp of the export
export_versionstringSchema version of the export envelope

GET /api/admin/compliance-bundles-export/{bundle_id}

Section titled “GET /api/admin/compliance-bundles-export/{bundle_id}”

Export a single compliance bundle by its UUID.

Authentication: Admin Bearer token

Path parameters:

ParameterTypeDescription
bundle_idUUIDThe compliance bundle’s UUID

Response 200 OK:

{
"name": "SOC2-Type-II",
"description": "SOC 2 Type II compliance bundle — trust service criteria",
"regulatory_framework": "SOC2",
"version": "1.2",
"enabled": true,
"seed_rule_mappings": [
"credit_card",
"ssn",
"bank_account",
"driver_license"
],
"exported_at": "2026-03-12T14:30:00.123456Z",
"export_version": "1.0"
}

Response 404 Not Found:

{ "detail": "Compliance bundle not found" }

Export all compliance bundles for the organization as a JSON array. Suitable for bulk archival or migrating all bundles to another instance.

Authentication: Admin Bearer token

Response 200 OK: Array of BundleExportResponse objects.

[
{
"name": "SOC2-Type-II",
"regulatory_framework": "SOC2",
"version": "1.2",
"enabled": true,
"seed_rule_mappings": ["credit_card", "ssn"],
"exported_at": "2026-03-12T14:30:00.123456Z",
"export_version": "1.0"
},
{
"name": "HIPAA-PHI",
"regulatory_framework": "HIPAA",
"version": "2.0",
"enabled": true,
"seed_rule_mappings": ["name", "dob", "medical_record"],
"exported_at": "2026-03-12T14:30:00.123456Z",
"export_version": "1.0"
}
]

Returns an empty array if no bundles exist.


POST /api/admin/compliance-bundles-export/

Section titled “POST /api/admin/compliance-bundles-export/”

Import one or more compliance bundles from an exported JSON payload. The request body is an array of BundleExportResponse objects (the same format returned by the GET endpoints).

Authentication: Admin Bearer token

Query parameters:

ParameterTypeDefaultDescription
modestring"skip"Conflict resolution: "skip" or "replace"

Conflict resolution modes:

ModeBehavior
skipIf a bundle with the same name already exists, skip it. The existing bundle is not modified.
replaceIf a bundle with the same name already exists, overwrite it with the imported definition.

Request body: Array of BundleExportResponse objects.

[
{
"name": "SOC2-Type-II",
"description": "SOC 2 Type II compliance bundle",
"regulatory_framework": "SOC2",
"version": "1.2",
"enabled": true,
"seed_rule_mappings": ["credit_card", "ssn", "bank_account"],
"exported_at": "2026-03-12T14:30:00Z",
"export_version": "1.0"
}
]

Response 200 OK — ImportSummaryResponse:

FieldTypeDescription
createdintegerNumber of new bundles created
skippedintegerNumber of bundles skipped due to name conflicts
replacedintegerNumber of existing bundles overwritten
created_namesarray of stringsNames of newly created bundles
skipped_namesarray of stringsNames of skipped bundles
replaced_namesarray of stringsNames of replaced bundles
{
"created": 2,
"skipped": 1,
"replaced": 0,
"created_names": ["SOC2-Type-II", "GDPR-Standard"],
"skipped_names": ["HIPAA-PHI"],
"replaced_names": []
}

Response 422 Unprocessable Entity: Payload validation failed. The detail field contains a list of validation errors.

Validation checks include:

  • name must be a non-empty string
  • regulatory_framework must be one of the canonical framework codes (e.g. SOC2, HIPAA, GDPR, PCI-DSS, ISO27001)
  • seed_rule_mappings entries must be valid entity type strings from the canonical taxonomy
  • version must be a non-empty string

Migrate all bundles from one org to another

Section titled “Migrate all bundles from one org to another”
Terminal window
# Export from source org
curl -s \
-H "Authorization: Bearer ${SOURCE_ADMIN_TOKEN}" \
"https://api.arbitex.ai/api/admin/compliance-bundles-export/" \
> bundles.json
# Import into destination org (replace existing if names conflict)
curl -s -X POST \
-H "Authorization: Bearer ${DEST_ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
-d @bundles.json \
"https://api.arbitex.ai/api/admin/compliance-bundles-export/?mode=replace"
Terminal window
# Look up bundle ID first
BUNDLE_ID=$(curl -s \
-H "Authorization: Bearer ${ADMIN_TOKEN}" \
"https://api.arbitex.ai/api/admin/compliance-bundles" \
| jq -r '.[] | select(.name == "SOC2-Type-II") | .id')
# Export it
curl -s \
-H "Authorization: Bearer ${ADMIN_TOKEN}" \
"https://api.arbitex.ai/api/admin/compliance-bundles-export/${BUNDLE_ID}" \
> soc2-bundle.json