Database Destinations

A Database Destination lets an Automation append rows to an existing table. Each destination references a credential in the Secret Store.

List Database Destinations

Endpoint

GET/database_destinations

Return Object

DatabaseDestination[]

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/database_destinations.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "workspace_id": 1,
    "name": "Orders",
    "provider": "snowflake",
    "config": "example",
    "secret_id": 1,
    "created_at": "2000-01-01T01:00:00Z",
    "updated_at": "2000-01-01T01:00:00Z"
  }
]

Show Database Destination

Endpoint

GET/database_destinations/{id}

Return Object

DatabaseDestination

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Request Parameters

ParameterDescription
id
int64
Required
Database Destination ID.

Example Request

curl https://app.files.com/api/rest/v1/database_destinations/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "workspace_id": 1,
  "name": "Orders",
  "provider": "snowflake",
  "config": "example",
  "secret_id": 1,
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Create Database Destination

Endpoint

POST/database_destinations

Return Object

DatabaseDestination

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Request Parameters

ParameterDefaultDescription
name
string
Required
Name of the destination.
provider
string
Required
Database provider.
Possible values: snowflake, bigquery, supabase, postgresql, mysql
config
object
Required
Provider settings for the destination. Use the schema matching provider. The connection address and table are fixed after creation.
secret_id
int64
Required
ID of a Secret in the same Workspace. Use a Token Secret for Snowflake, a service account Key/Value Secret for BigQuery, or a Username/Password Secret for a database login.
workspace_id
int64
0Workspace ID. 0 means the default workspace.

Example Request

curl https://app.files.com/api/rest/v1/database_destinations.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"name":"Orders","provider":"snowflake","config":{"account_identifier":"value","database_name":"value","schema_name":"value","table_name":"value"},"secret_id":1,"workspace_id":1}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "workspace_id": 1,
  "name": "Orders",
  "provider": "snowflake",
  "config": "example",
  "secret_id": 1,
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Update Database Destination

Endpoint

PATCH/database_destinations/{id}

Return Object

DatabaseDestination

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Request Parameters

ParameterDescription
id
int64
Required
Database Destination ID.
name
string
Name of the destination.
secret_id
int64
ID of a Secret in the same Workspace. Use a Token Secret for Snowflake, a service account Key/Value Secret for BigQuery, or a Username/Password Secret for a database login.
config
object
Provider settings for the destination. Use the schema matching provider. The connection address and table are fixed after creation.

Example Request

curl https://app.files.com/api/rest/v1/database_destinations/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"name":"Orders","secret_id":1,"config":{"account_identifier":"value","database_name":"value","schema_name":"value","table_name":"value"}}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "workspace_id": 1,
  "name": "Orders",
  "provider": "snowflake",
  "config": "example",
  "secret_id": 1,
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Delete Database Destination

Endpoint

DELETE/database_destinations/{id}

Return Object

No return value.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Request Parameters

ParameterDescription
id
int64
Required
Database Destination ID.

Example Request

curl https://app.files.com/api/rest/v1/database_destinations/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The DatabaseDestination Object

Some of the endpoints above return a DatabaseDestination object. The attributes of this object are listed below.

AttributeDescription
id
int64
Database Destination ID.
workspace_id
int64
Workspace ID. 0 means the default workspace.
name
string
Name of the destination.
provider
string
Database provider.
Possible values: snowflake, bigquery, supabase, postgresql, mysql
config
object
Provider settings for the destination. Use the schema matching provider. The connection address and table are fixed after creation.
secret_id
int64
ID of a Secret in the same Workspace. Use a Token Secret for Snowflake, a service account Key/Value Secret for BigQuery, or a Username/Password Secret for a database login.
created_at
date-time
When the destination was created.
updated_at
date-time
When the destination was last updated.

Example DatabaseDestination Object

{
  "id": 1,
  "workspace_id": 1,
  "name": "Orders",
  "provider": "snowflake",
  "config": "example",
  "secret_id": 1,
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

config

Value typeDescription
object