SyncProvision workspace

Provision workspace

Point the agency at an Airbyte workspace and a BigQuery destination, either by CREATING them or by ADOPTING ones it already runs. Requires an agency key (ak_).

What repeats safely. The workspace is reused, never duplicated. A destination Mythic created is UPDATED IN PLACE, so re-running provision to change dataset, location or loading method repoints the same destination instead of leaving the previous one orphaned in Airbyte. A destination you ADOPTED is never modified or deleted — it is yours, and may serve your own pipelines; a later create-mode provision builds a separate Mythic-owned destination rather than rewriting yours. The response reports destination_reused so you can tell which happened.

Connections are unaffected either way: they reference the destination by id, and updating in place keeps that id.

Adopt what you already run. If the agency already syncs these platforms with its own Airbyte, pass airbyte_workspace_id + airbyte_destination_id (plus airbyte_client_id/ airbyte_client_secret when that setup is in the agency's own Airbyte org). Provisioning a second, independent workspace against the same BigQuery dataset produces duplicate rows, two sets of incremental cursor state that each believe they own the stream, and two Airbyte bills — and nothing errors. In CREATE mode the target dataset is checked for existing Airbyte-managed tables and the request is refused with 409 dataset_in_use unless confirm_shared_dataset: true.

Staging is optional, but all-or-nothing. Supply staging_bucket_name + hmac_key_access_id + hmac_key_secret together for GCS staging, or none of them for standard inserts. A partial set is rejected with 400 staging_incomplete.

Nothing is persisted by a failed provision that had no prior config: the row is rolled back, so GET /config keeps returning 404 not_configured rather than a permanently empty status: error config you cannot tell apart from a never-provisioned agency. Failures carry the underlying reason in the response — you should never have to read it back off GET /config.

curl -X POST "https://mythic-analytics.gulp.workers.dev/client/v1/airbyte/config/provision" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "airbyte_workspace_id": "4fed5b02-4acd-4111-95bc-f7d15153b362",
  "airbyte_destination_id": "613f34e2-bcc0-4bc5-ab3f-eeeff4647401",
  "airbyte_client_id": "example_string",
  "airbyte_client_secret": "example_string",
  "confirm_shared_dataset": true,
  "bigquery_project_id": "acme-analytics",
  "bigquery_dataset": "mythic_ads",
  "gcp_credentials_json": "example_string",
  "dataset_location": "US",
  "staging_bucket_name": "acme-airbyte-staging",
  "staging_bucket_path": "example_string",
  "hmac_key_access_id": "example_string",
  "hmac_key_secret": "example_string",
  "keep_files_in_gcs_bucket": "example_string"
}'
{
  "success": true,
  "data": {
    "workspace_id": "example_string",
    "destination_id": "example_string",
    "status": "active",
    "loading_method": "Standard",
    "destination_reused": true,
    "adopted": {
      "workspace": true,
      "destination": true,
      "airbyte_org": true
    },
    "notifications": {
      "registered": true,
      "changed": true,
      "url": "example_string",
      "events": [
        "failure",
        "success"
      ],
      "replaced": "example_string",
      "reason": "example_string"
    }
  }
}
POST
/config/provision
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Agency key as bearer token, format Bearer ak_.... Grants full read-write access scoped to the agency. Agency-wide scoped keys (mcp_ with no fixed location) are accepted too and need airbyte:read or airbyte:write; a client-bound mcp_ key gets 403 agency_key_required. See Using an mcp_ key over HTTP.

Agency key as bearer token, format Bearer ak_.... Grants full read-write access scoped to the agency. Agency-wide scoped keys (mcp_ with no fixed location) are accepted too and need airbyte:read or airbyte:write; a client-bound mcp_ key gets 403 agency_key_required. See Using an mcp_ key over HTTP.
Bearer Token
Bearer Tokenstring
Required

Location secret key as bearer token, format Bearer sk_.... Grants read-only access; the agency is resolved from the location. Write endpoints return 403.

Location secret key as bearer token, format Bearer sk_.... Grants read-only access; the agency is resolved from the location. Write endpoints return 403.
Content-Typestring
Required

The media type of the request body

Options: application/json
airbyte_workspace_idstring

ADOPT: an existing Airbyte workspace to create this agency's sources in, instead of creating a new one. Required alongside airbyte_destination_id — a destination can only be used by sources in its own workspace.

airbyte_destination_idstring

ADOPT: an existing BigQuery destination every connection writes through. This is what prevents two Airbyte workspaces syncing the same streams into the same dataset — duplicate rows, split incremental cursor state, and double Airbyte cost, none of which raises an error anywhere. Verified at provision time: a wrong id, or one in a different workspace, is rejected here rather than on the first connection. When supplied, bigquery_project_id, bigquery_dataset and gcp_credentials_json are not required.

airbyte_client_idstring

ADOPT: your own Airbyte application client id. Required when the workspace/destination you are adopting lives in YOUR Airbyte org rather than Mythic's — Mythic's credentials cannot see it. Must be sent with airbyte_client_secret. Stored and used for every subsequent Airbyte call for this agency.

airbyte_client_secretstring

Paired with airbyte_client_id. Encrypted at rest; never returned.

confirm_shared_datasetboolean

CREATE mode only. Before creating a destination, Mythic lists the target dataset and refuses with 409 dataset_in_use if it already holds Airbyte-managed tables (_airbyte*, or tables named like streams we would write) — that collision is otherwise completely silent. Set true to proceed anyway.

bigquery_project_idstring
Required

Destination BigQuery project ID.

bigquery_datasetstring
Required

Destination BigQuery dataset.

gcp_credentials_jsonstring
Required

GCP service-account credentials JSON, as a string. Encrypted at rest; never returned by the API.

dataset_locationstring

BigQuery dataset location. Defaults to US.

staging_bucket_namestring

GCS bucket for staged loads. ALL-OR-NOTHING: supply this together with hmac_key_access_id and hmac_key_secret to use GCS staging, or omit every staging_/hmac_ field to use standard inserts, which need no bucket and no HMAC key. A partial set is rejected with 400 staging_incomplete naming what is missing.

staging_bucket_pathstring

Path prefix within the staging bucket. Defaults to staging.

hmac_key_access_idstring

GCS HMAC key access ID. This is an interoperability credential created FOR a service account (gcloud storage hmac create SA_EMAIL) — not the service-account key itself. Required for GCS staging, together with the secret.

hmac_key_secretstring

HMAC key secret. Required for GCS staging, together with the access ID.

keep_files_in_gcs_bucketstring

Airbyte staging-file retention option. GCS staging only.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Agency key as bearer token, format Bearer ak_.... Grants full read-write access scoped to the agency. Agency-wide scoped keys (mcp_ with no fixed location) are accepted too and need airbyte:read or airbyte:write; a client-bound mcp_ key gets 403 agency_key_required. See Using an mcp_ key over HTTP.

header
Authorizationstring
Required

Bearer token. Location secret key as bearer token, format Bearer sk_.... Grants read-only access; the agency is resolved from the location. Write endpoints return 403.

Body

application/json
airbyte_workspace_idstring

ADOPT: an existing Airbyte workspace to create this agency's sources in, instead of creating a new one. Required alongside airbyte_destination_id — a destination can only be used by sources in its own workspace.

Example:
4fed5b02-4acd-4111-95bc-f7d15153b362
airbyte_destination_idstring

ADOPT: an existing BigQuery destination every connection writes through. This is what prevents two Airbyte workspaces syncing the same streams into the same dataset — duplicate rows, split incremental cursor state, and double Airbyte cost, none of which raises an error anywhere. Verified at provision time: a wrong id, or one in a different workspace, is rejected here rather than on the first connection. When supplied, bigquery_project_id, bigquery_dataset and gcp_credentials_json are not required.

Example:
613f34e2-bcc0-4bc5-ab3f-eeeff4647401
airbyte_client_idstring

ADOPT: your own Airbyte application client id. Required when the workspace/destination you are adopting lives in YOUR Airbyte org rather than Mythic's — Mythic's credentials cannot see it. Must be sent with airbyte_client_secret. Stored and used for every subsequent Airbyte call for this agency.

airbyte_client_secretstring

Paired with airbyte_client_id. Encrypted at rest; never returned.

confirm_shared_datasetboolean

CREATE mode only. Before creating a destination, Mythic lists the target dataset and refuses with 409 dataset_in_use if it already holds Airbyte-managed tables (_airbyte*, or tables named like streams we would write) — that collision is otherwise completely silent. Set true to proceed anyway.

bigquery_project_idstring
Required

Destination BigQuery project ID.

Example:
acme-analytics
bigquery_datasetstring
Required

Destination BigQuery dataset.

Example:
mythic_ads
gcp_credentials_jsonstring
Required

GCP service-account credentials JSON, as a string. Encrypted at rest; never returned by the API.

dataset_locationstring

BigQuery dataset location. Defaults to US.

Example:
US
staging_bucket_namestring

GCS bucket for staged loads. ALL-OR-NOTHING: supply this together with hmac_key_access_id and hmac_key_secret to use GCS staging, or omit every staging_/hmac_ field to use standard inserts, which need no bucket and no HMAC key. A partial set is rejected with 400 staging_incomplete naming what is missing.

Example:
acme-airbyte-staging
staging_bucket_pathstring

Path prefix within the staging bucket. Defaults to staging.

hmac_key_access_idstring

GCS HMAC key access ID. This is an interoperability credential created FOR a service account (gcloud storage hmac create SA_EMAIL) — not the service-account key itself. Required for GCS staging, together with the secret.

hmac_key_secretstring

HMAC key secret. Required for GCS staging, together with the access ID.

keep_files_in_gcs_bucketstring

Airbyte staging-file retention option. GCS staging only.

Responses

successboolean
dataobject