Skip to main content
GET
https://sandbox.getcollate.io/api
/
v1
/
services
/
databaseServices
/
name
/
{fqn}
/
export
GET /v1/services/databaseServices/name/{fqn}/export
from metadata.sdk import configure
from metadata.sdk.entities import DatabaseServices

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# Synchronous export
csv_data = DatabaseServices.export_csv("snowflake_prod").execute()
print(csv_data)

# Async export
job = DatabaseServices.export_csv("snowflake_prod").execute_async()
print(f"Export job: {job}")

# Synchronous import (dry run first)
result = (
    DatabaseServices.import_csv("snowflake_prod")
    .with_data(csv_data)
    .set_dry_run(True)
    .execute()
)
print(f"Dry run result: {result}")

# Apply the import
result = (
    DatabaseServices.import_csv("snowflake_prod")
    .with_data(csv_data)
    .set_dry_run(False)
    .execute()
)

# Async import
result = (
    DatabaseServices.import_csv("snowflake_prod")
    .with_data(csv_data)
    .set_dry_run(False)
    .execute_async()
)
"name,displayName,description,owner,tags,domain\nanalytics,Analytics Database,Central analytics warehouse,team:data-engineering,Tier.Tier1,,"

Import & Export

Export database service metadata (databases, schemas, owners, tags) to CSV and import changes back. Supports both synchronous and asynchronous operations.

Export to CSV

GET /v1/services/databaseServices/name/{fqn}/export
fqn
string
required
Fully qualified name of the database service (e.g., snowflake_prod).

Export Async

GET /v1/services/databaseServices/name/{fqn}/exportAsync Returns a job ID for large exports that can be polled for completion.

Import from CSV

PUT /v1/services/databaseServices/name/{fqn}/import
fqn
string
required
Fully qualified name of the database service.
dryRun
boolean
default:"true"
If true, validates the CSV without applying changes. Set to false to apply.

Import Async

PUT /v1/services/databaseServices/name/{fqn}/importAsync For large imports, use the async variant which returns a job ID.
GET /v1/services/databaseServices/name/{fqn}/export
from metadata.sdk import configure
from metadata.sdk.entities import DatabaseServices

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# Synchronous export
csv_data = DatabaseServices.export_csv("snowflake_prod").execute()
print(csv_data)

# Async export
job = DatabaseServices.export_csv("snowflake_prod").execute_async()
print(f"Export job: {job}")

# Synchronous import (dry run first)
result = (
    DatabaseServices.import_csv("snowflake_prod")
    .with_data(csv_data)
    .set_dry_run(True)
    .execute()
)
print(f"Dry run result: {result}")

# Apply the import
result = (
    DatabaseServices.import_csv("snowflake_prod")
    .with_data(csv_data)
    .set_dry_run(False)
    .execute()
)

# Async import
result = (
    DatabaseServices.import_csv("snowflake_prod")
    .with_data(csv_data)
    .set_dry_run(False)
    .execute_async()
)
"name,displayName,description,owner,tags,domain\nanalytics,Analytics Database,Central analytics warehouse,team:data-engineering,Tier.Tier1,,"

Returns

Export returns CSV text with headers and rows for each child entity. Import returns a summary of changes applied (or validation results for dry run).

Error Handling

CodeError TypeDescription
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission for import/export
404NOT_FOUNDDatabase service with given FQN does not exist
400BAD_REQUESTInvalid CSV format or content