> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/api-reference/datamart-management/replications.md).

# Replications

Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:

* UserPoints
* UserActivities
* UserSegments
* UserProfiles
* UserAccounts
* UserEmails
* Merge events

Supports initial synchronization of existing data.

Relevant documentation:

* [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)

## GET /datamarts/{datamart\_id}/replication\_job\_executions

> List all datamart replication job executions from a given datamart

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replication_job_executions":{"get":{"tags":["Replications"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"max_results":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/NewPublicJobExecutionResource"}},"first_result":{"type":"integer"},"count":{"type":"integer"},"status":{"type":"string","enum":["ok"]}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"listDatamartReplicationJobExecutions","parameters":[{"name":"datamart_id","explode":false,"schema":{"type":"integer","format":"int64"},"required":true,"style":"simple","in":"path"},{"style":"form","description":"Offset from which the search must be performed","name":"first_result","in":"query","schema":{"type":"integer","format":"int32"},"explode":true,"required":false},{"name":"max_results","in":"query","schema":{"type":"integer","format":"int32"},"style":"form","required":false,"description":"Number of maximum items that shall be return by this search","explode":true},{"explode":true,"required":false,"style":"form","description":"Fields used to order the result","in":"query","name":"order_by","schema":{"type":"string"}},{"style":"form","schema":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"required":false,"name":"status","in":"query","explode":true,"description":"The status of the job (PENDING/RUNNING/SUCCEEDED/FAILED)"}],"description":"","summary":"List all datamart replication job executions from a given datamart"}}},"components":{"schemas":{"NewPublicJobExecutionResource":{"allOf":[{"$ref":"#/components/schemas/NewReadOnlyPublicJobExecutionResource"},{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"start_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"job_type":{"type":"string","readOnly":false},"num_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"community_id":{"type":"string","readOnly":true},"completed_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"max_retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"parameters":{"type":"string","readOnly":false},"result":{"type":"string","readOnly":false},"duration":{"$ref":"#/components/schemas/Duration"},"cancel_status":{"$ref":"#/components/schemas/CancelStatus"},"is_retryable":{"type":"boolean","default":false,"readOnly":false},"status":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"user_id":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":false},"erroneous_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"permalink_uri":{"type":"string","readOnly":false},"debug":{"type":"string","readOnly":false},"external_name":{"type":"string","readOnly":false}},"required":["creation_date","id","is_retryable","job_type","permalink_uri","retry_count","status"]}]},"NewReadOnlyPublicJobExecutionResource":{"type":"object"},"Duration":{"type":"number","description":"a length of time in milliseconds"},"CancelStatus":{"type":"string","enum":["REQUESTED","IN_PROGRESS","CANCELED","ABORTED"],"readOnly":false},"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /datamarts/{datamart\_id}/replication\_job\_executions

> Create a datamart replication job execution

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replication_job_executions":{"post":{"operationId":"createDatamartReplicationJobExecution","tags":["Replications"],"parameters":[{"style":"simple","in":"path","name":"datamart_id","schema":{"type":"integer","format":"int64"},"explode":false,"required":true}],"requestBody":{"description":"The job execution creation resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatamartReplicationJobExecutionCreationPublicResource"}}},"required":false},"summary":"Create a datamart replication job execution","description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/NewPublicJobExecutionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"DatamartReplicationJobExecutionCreationPublicResource":{"type":"object","properties":{"replication_ids":{"type":"array","items":{"type":"string","readOnly":false},"readOnly":false}}},"NewPublicJobExecutionResource":{"allOf":[{"$ref":"#/components/schemas/NewReadOnlyPublicJobExecutionResource"},{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"start_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"job_type":{"type":"string","readOnly":false},"num_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"community_id":{"type":"string","readOnly":true},"completed_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"max_retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"parameters":{"type":"string","readOnly":false},"result":{"type":"string","readOnly":false},"duration":{"$ref":"#/components/schemas/Duration"},"cancel_status":{"$ref":"#/components/schemas/CancelStatus"},"is_retryable":{"type":"boolean","default":false,"readOnly":false},"status":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"user_id":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":false},"erroneous_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"permalink_uri":{"type":"string","readOnly":false},"debug":{"type":"string","readOnly":false},"external_name":{"type":"string","readOnly":false}},"required":["creation_date","id","is_retryable","job_type","permalink_uri","retry_count","status"]}]},"NewReadOnlyPublicJobExecutionResource":{"type":"object"},"Duration":{"type":"number","description":"a length of time in milliseconds"},"CancelStatus":{"type":"string","enum":["REQUESTED","IN_PROGRESS","CANCELED","ABORTED"],"readOnly":false},"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /datamarts/{datamart\_id}/replication\_job\_executions/{id}/action

> Perform an action on the datamart replication job execution

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replication_job_executions/{id}/action":{"post":{"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/NewPublicJobExecutionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"performDatamartReplicationJobExecutionAction","requestBody":{"description":"The action to perform","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MakeJobExecutionActionResource"}}},"required":true},"parameters":[{"schema":{"type":"integer","format":"int64"},"in":"path","required":true,"name":"datamart_id","explode":false,"style":"simple"},{"required":true,"schema":{"type":"integer","format":"int64"},"style":"simple","explode":false,"name":"id","in":"path"}],"summary":"Perform an action on the datamart replication job execution","tags":["Replications"]}}},"components":{"schemas":{"NewPublicJobExecutionResource":{"allOf":[{"$ref":"#/components/schemas/NewReadOnlyPublicJobExecutionResource"},{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"start_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"job_type":{"type":"string","readOnly":false},"num_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"community_id":{"type":"string","readOnly":true},"completed_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"max_retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"parameters":{"type":"string","readOnly":false},"result":{"type":"string","readOnly":false},"duration":{"$ref":"#/components/schemas/Duration"},"cancel_status":{"$ref":"#/components/schemas/CancelStatus"},"is_retryable":{"type":"boolean","default":false,"readOnly":false},"status":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"user_id":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":false},"erroneous_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"permalink_uri":{"type":"string","readOnly":false},"debug":{"type":"string","readOnly":false},"external_name":{"type":"string","readOnly":false}},"required":["creation_date","id","is_retryable","job_type","permalink_uri","retry_count","status"]}]},"NewReadOnlyPublicJobExecutionResource":{"type":"object"},"Duration":{"type":"number","description":"a length of time in milliseconds"},"CancelStatus":{"type":"string","enum":["REQUESTED","IN_PROGRESS","CANCELED","ABORTED"],"readOnly":false},"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]},"MakeJobExecutionActionResource":{"type":"object","properties":{"action":{"$ref":"#/components/schemas/JobExecutionAction"}},"required":["action"]},"JobExecutionAction":{"type":"string","enum":["CANCEL"],"readOnly":false}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /datamarts/{datamart\_id}/replication\_job\_executions/{id}

> Find a datamart replication execution from a given datamart

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replication_job_executions/{id}":{"get":{"parameters":[{"name":"datamart_id","in":"path","schema":{"type":"integer","format":"int64"},"required":true,"explode":false,"style":"simple"},{"style":"simple","required":true,"explode":false,"in":"path","name":"id","schema":{"type":"integer","format":"int64"}}],"description":"","summary":"Find a datamart replication execution from a given datamart","operationId":"getDatamartReplicationJobExecution","tags":["Replications"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/NewPublicJobExecutionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"NewPublicJobExecutionResource":{"allOf":[{"$ref":"#/components/schemas/NewReadOnlyPublicJobExecutionResource"},{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":false},"start_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"job_type":{"type":"string","readOnly":false},"num_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"community_id":{"type":"string","readOnly":true},"completed_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"max_retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"parameters":{"type":"string","readOnly":false},"result":{"type":"string","readOnly":false},"duration":{"$ref":"#/components/schemas/Duration"},"cancel_status":{"$ref":"#/components/schemas/CancelStatus"},"is_retryable":{"type":"boolean","default":false,"readOnly":false},"status":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"creation_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"user_id":{"type":"string","readOnly":false},"id":{"type":"string","readOnly":false},"erroneous_tasks":{"type":"integer","format":"int64","default":0,"readOnly":false},"retry_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"permalink_uri":{"type":"string","readOnly":false},"debug":{"type":"string","readOnly":false},"external_name":{"type":"string","readOnly":false}},"required":["creation_date","id","is_retryable","job_type","permalink_uri","retry_count","status"]}]},"NewReadOnlyPublicJobExecutionResource":{"type":"object"},"Duration":{"type":"number","description":"a length of time in milliseconds"},"CancelStatus":{"type":"string","enum":["REQUESTED","IN_PROGRESS","CANCELED","ABORTED"],"readOnly":false},"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /datamarts/{datamart\_id}/replications/{replication\_id}/initial\_config\_script

> Get replication initial config script

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replications/{replication_id}/initial_config_script":{"get":{"responses":{"200":{"description":"Success !","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"description":"","tags":["Replications"],"parameters":[{"name":"datamart_id","required":true,"in":"path","schema":{"type":"string"},"explode":false,"style":"simple"},{"name":"replication_id","style":"simple","explode":false,"schema":{"type":"string"},"in":"path","required":true}],"summary":"Get replication initial config script","operationId":"getInitialConfigScript"}}},"components":{"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```

## GET /datamarts/{datamart\_id}/replications

> Search datamart replications

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replications":{"get":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"max_results":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationResource"}},"first_result":{"type":"integer"},"total":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"count":{"type":"integer"}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["Replications"],"summary":"Search datamart replications","operationId":"findDatamartReplications","description":"","parameters":[{"in":"path","required":true,"explode":false,"schema":{"type":"string"},"name":"datamart_id","style":"simple"},{"style":"form","description":"Datamart replication name","in":"query","required":false,"name":"name","schema":{"type":"string"},"explode":true},{"name":"archived","in":"query","required":false,"description":"Retrieve archived campaigns","style":"form","explode":true,"schema":{"type":"boolean"}},{"name":"type","description":"Datamart replication type - GOOGLE_PUBSUB or AZURE_EVENT_HUBS","explode":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationType"}},"required":false,"in":"query","style":"form"},{"in":"query","description":"Datamart replication status","explode":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationStatus"}},"name":"status","required":false,"style":"form"},{"description":"Datamart replication version","name":"version","explode":true,"in":"query","schema":{"type":"integer","format":"int64"},"style":"form","required":false},{"schema":{"type":"boolean"},"explode":true,"style":"form","description":"Internal replication flag, set if the replication is used for internal process, with export to an external service provider","in":"query","name":"internal_replication","required":false},{"name":"keywords","schema":{"type":"string"},"in":"query","explode":true,"description":"Datamart replication find by name keywords","style":"form","required":false},{"description":"Offset from which the search must be performed","name":"first_result","style":"form","explode":true,"schema":{"type":"integer","format":"int32"},"required":false,"in":"query"},{"name":"max_results","description":"Number of maximum items that shall be return by this search","in":"query","style":"form","schema":{"type":"integer","format":"int32"},"required":false,"explode":true}]}}},"components":{"schemas":{"DatamartReplicationResource":{"discriminator":{"propertyName":"type","mapping":{"GOOGLE_PUBSUB":"#/components/schemas/PubSubReplicationResource","INTERNAL":"#/components/schemas/InternalReplicationResource","DATA_WAREHOUSE":"#/components/schemas/DataWarehouseReplicationResource","AZURE_EVENT_HUBS":"#/components/schemas/EventHubsReplicationResource"}},"oneOf":[{"$ref":"#/components/schemas/PubSubReplicationResource"},{"$ref":"#/components/schemas/InternalReplicationResource"},{"$ref":"#/components/schemas/DataWarehouseReplicationResource"},{"$ref":"#/components/schemas/EventHubsReplicationResource"}],"properties":{"type":{"type":"string","enum":["GOOGLE_PUBSUB","INTERNAL","DATA_WAREHOUSE","AZURE_EVENT_HUBS"]}},"required":["type"]},"PubSubReplicationResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"credentials_uri":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"project_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"name":{"type":"string","readOnly":false},"version":{"readOnly":false,"default":0,"format":"int64","type":"integer"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"topic_id":{"type":"string","readOnly":false}},"required":["creation_ts","credentials_uri","datamart_id","id","internal_replication","name","project_id","replication_filters","status","topic_id","version"]},"DatamartReplicationStatus":{"type":"string","enum":["PAUSED","ACTIVE","ERROR"],"readOnly":false},"DatamartReplicationFilterResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"document":{"$ref":"#/components/schemas/DatamartReplicationDocumentType"},"filter":{"type":"string","readOnly":false},"replication_id":{"type":"string","readOnly":false},"schema_type_name":{"type":"string","readOnly":false}},"required":["document","id","replication_id"]},"DatamartReplicationDocumentType":{"type":"string","enum":["USER_ACCOUNT","USER_EMAIL","USER_EMAIL_PROVIDER","USER_PROFILE","USER_DEVICE_TECHNICAL_ID","USER_DEVICE_POINT","USER_AGENT_PROVIDER","USER_POINT","USER_POINT_PARENT","USER_POINT_SYSTEM_LOG","USER_SEGMENT","USER_ML_FUNCTION","USER_CHOICE","USER_SCENARIO","USER_PLATFORM_ACTIVITY","USER_ACTIVITY","USER_EVENT","USER_COMPUTED_FIELD","USER_COMPUTED_FIELD_STATE","NONE"],"readOnly":false},"InternalReplicationResource":{"allOf":[{"$ref":"#/components/schemas/InternalReplicationCommonResource"},{"type":"object","properties":{"initial_config_status":{"$ref":"#/components/schemas/DatamartReplicationInitialConfigStatus"},"last_state_refresh_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"state_max_log_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"credentials_uri":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"name":{"type":"string","readOnly":false},"connector_type":{"$ref":"#/components/schemas/ReplicationConnectorType"},"version":{"default":0,"format":"int64","readOnly":false,"type":"integer"},"id":{"type":"string","readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["connector_type","creation_ts","credentials_uri","datamart_id","id","initial_config_status","name","replication_filters","status","version"]}]},"InternalReplicationCommonResource":{"type":"object"},"DatamartReplicationInitialConfigStatus":{"type":"string","enum":["WAITING_FOR_TABLE_CREATION","COMPLETED"],"readOnly":false},"ReplicationConnectorType":{"type":"string","enum":["CLICKHOUSE","KAFKA_SINK"],"readOnly":false},"DataWarehouseReplicationResource":{"type":"object","properties":{"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"bucket_name":{"type":"string","readOnly":false},"connector_type":{"$ref":"#/components/schemas/ReplicationConnectorType"},"initial_config_status":{"$ref":"#/components/schemas/DatamartReplicationInitialConfigStatus"},"schema_name":{"type":"string","readOnly":true},"log_refresh_frequency":{"type":"string","readOnly":false},"last_state_refresh_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"data_warehouse_id":{"type":"string","readOnly":true},"name":{"type":"string","readOnly":false},"schema_id":{"type":"string","readOnly":false},"state_max_log_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"version":{"type":"integer","readOnly":false,"default":0,"format":"int64"},"database_name":{"type":"string","readOnly":true},"database_id":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"engine_type":{"$ref":"#/components/schemas/DataWarehouseEngineType"},"id":{"type":"string","readOnly":true}},"required":["bucket_name","connector_type","creation_ts","data_warehouse_id","database_id","database_name","datamart_id","engine_type","id","initial_config_status","internal_replication","name","replication_filters","schema_id","schema_name","status","version"]},"DataWarehouseEngineType":{"type":"string","enum":["BIG_QUERY","POSTGRES","SNOWFLAKE","DUCK_DB"],"readOnly":false},"EventHubsReplicationResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"event_hub_name":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"id":{"type":"string","readOnly":true},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"version":{"readOnly":false,"default":0,"format":"int64","type":"integer"},"datamart_id":{"type":"string","readOnly":false},"credentials_uri":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false}},"required":["creation_ts","credentials_uri","datamart_id","event_hub_name","id","internal_replication","name","replication_filters","status","version"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]},"DatamartReplicationType":{"type":"string","enum":["GOOGLE_PUBSUB","AZURE_EVENT_HUBS","INTERNAL","DATA_WAREHOUSE"],"readOnly":false}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /datamarts/{datamart\_id}/replications

> Create datamart replication

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replications":{"post":{"operationId":"createDatamartReplication","requestBody":{"description":"The Replication to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatamartReplicationResource"}}},"required":true},"tags":["Replications"],"summary":"Create datamart replication","description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DatamartReplicationResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"schema":{"type":"string"},"required":true,"in":"path","explode":false,"style":"simple","name":"datamart_id"}]}}},"components":{"schemas":{"DatamartReplicationResource":{"discriminator":{"propertyName":"type","mapping":{"GOOGLE_PUBSUB":"#/components/schemas/PubSubReplicationResource","INTERNAL":"#/components/schemas/InternalReplicationResource","DATA_WAREHOUSE":"#/components/schemas/DataWarehouseReplicationResource","AZURE_EVENT_HUBS":"#/components/schemas/EventHubsReplicationResource"}},"oneOf":[{"$ref":"#/components/schemas/PubSubReplicationResource"},{"$ref":"#/components/schemas/InternalReplicationResource"},{"$ref":"#/components/schemas/DataWarehouseReplicationResource"},{"$ref":"#/components/schemas/EventHubsReplicationResource"}],"properties":{"type":{"type":"string","enum":["GOOGLE_PUBSUB","INTERNAL","DATA_WAREHOUSE","AZURE_EVENT_HUBS"]}},"required":["type"]},"PubSubReplicationResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"credentials_uri":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"project_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"name":{"type":"string","readOnly":false},"version":{"readOnly":false,"default":0,"format":"int64","type":"integer"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"topic_id":{"type":"string","readOnly":false}},"required":["creation_ts","credentials_uri","datamart_id","id","internal_replication","name","project_id","replication_filters","status","topic_id","version"]},"DatamartReplicationStatus":{"type":"string","enum":["PAUSED","ACTIVE","ERROR"],"readOnly":false},"DatamartReplicationFilterResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"document":{"$ref":"#/components/schemas/DatamartReplicationDocumentType"},"filter":{"type":"string","readOnly":false},"replication_id":{"type":"string","readOnly":false},"schema_type_name":{"type":"string","readOnly":false}},"required":["document","id","replication_id"]},"DatamartReplicationDocumentType":{"type":"string","enum":["USER_ACCOUNT","USER_EMAIL","USER_EMAIL_PROVIDER","USER_PROFILE","USER_DEVICE_TECHNICAL_ID","USER_DEVICE_POINT","USER_AGENT_PROVIDER","USER_POINT","USER_POINT_PARENT","USER_POINT_SYSTEM_LOG","USER_SEGMENT","USER_ML_FUNCTION","USER_CHOICE","USER_SCENARIO","USER_PLATFORM_ACTIVITY","USER_ACTIVITY","USER_EVENT","USER_COMPUTED_FIELD","USER_COMPUTED_FIELD_STATE","NONE"],"readOnly":false},"InternalReplicationResource":{"allOf":[{"$ref":"#/components/schemas/InternalReplicationCommonResource"},{"type":"object","properties":{"initial_config_status":{"$ref":"#/components/schemas/DatamartReplicationInitialConfigStatus"},"last_state_refresh_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"state_max_log_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"credentials_uri":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"name":{"type":"string","readOnly":false},"connector_type":{"$ref":"#/components/schemas/ReplicationConnectorType"},"version":{"default":0,"format":"int64","readOnly":false,"type":"integer"},"id":{"type":"string","readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["connector_type","creation_ts","credentials_uri","datamart_id","id","initial_config_status","name","replication_filters","status","version"]}]},"InternalReplicationCommonResource":{"type":"object"},"DatamartReplicationInitialConfigStatus":{"type":"string","enum":["WAITING_FOR_TABLE_CREATION","COMPLETED"],"readOnly":false},"ReplicationConnectorType":{"type":"string","enum":["CLICKHOUSE","KAFKA_SINK"],"readOnly":false},"DataWarehouseReplicationResource":{"type":"object","properties":{"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"bucket_name":{"type":"string","readOnly":false},"connector_type":{"$ref":"#/components/schemas/ReplicationConnectorType"},"initial_config_status":{"$ref":"#/components/schemas/DatamartReplicationInitialConfigStatus"},"schema_name":{"type":"string","readOnly":true},"log_refresh_frequency":{"type":"string","readOnly":false},"last_state_refresh_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"data_warehouse_id":{"type":"string","readOnly":true},"name":{"type":"string","readOnly":false},"schema_id":{"type":"string","readOnly":false},"state_max_log_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"version":{"type":"integer","readOnly":false,"default":0,"format":"int64"},"database_name":{"type":"string","readOnly":true},"database_id":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"engine_type":{"$ref":"#/components/schemas/DataWarehouseEngineType"},"id":{"type":"string","readOnly":true}},"required":["bucket_name","connector_type","creation_ts","data_warehouse_id","database_id","database_name","datamart_id","engine_type","id","initial_config_status","internal_replication","name","replication_filters","schema_id","schema_name","status","version"]},"DataWarehouseEngineType":{"type":"string","enum":["BIG_QUERY","POSTGRES","SNOWFLAKE","DUCK_DB"],"readOnly":false},"EventHubsReplicationResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"event_hub_name":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"id":{"type":"string","readOnly":true},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"version":{"readOnly":false,"default":0,"format":"int64","type":"integer"},"datamart_id":{"type":"string","readOnly":false},"credentials_uri":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false}},"required":["creation_ts","credentials_uri","datamart_id","event_hub_name","id","internal_replication","name","replication_filters","status","version"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /datamarts/{datamart\_id}/replications/{replication\_id}

> Get datamart replication by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replications/{replication_id}":{"get":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DatamartReplicationResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"schema":{"type":"string"},"style":"simple","explode":false,"name":"datamart_id","required":true,"in":"path"},{"name":"replication_id","explode":false,"in":"path","style":"simple","schema":{"type":"string"},"required":true},{"in":"query","schema":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationStatus"}},"explode":true,"required":false,"description":"Datamart replication status","style":"form","name":"status"}],"tags":["Replications"],"operationId":"getDatamartReplication","summary":"Get datamart replication by id","description":""}}},"components":{"schemas":{"DatamartReplicationResource":{"discriminator":{"propertyName":"type","mapping":{"GOOGLE_PUBSUB":"#/components/schemas/PubSubReplicationResource","INTERNAL":"#/components/schemas/InternalReplicationResource","DATA_WAREHOUSE":"#/components/schemas/DataWarehouseReplicationResource","AZURE_EVENT_HUBS":"#/components/schemas/EventHubsReplicationResource"}},"oneOf":[{"$ref":"#/components/schemas/PubSubReplicationResource"},{"$ref":"#/components/schemas/InternalReplicationResource"},{"$ref":"#/components/schemas/DataWarehouseReplicationResource"},{"$ref":"#/components/schemas/EventHubsReplicationResource"}],"properties":{"type":{"type":"string","enum":["GOOGLE_PUBSUB","INTERNAL","DATA_WAREHOUSE","AZURE_EVENT_HUBS"]}},"required":["type"]},"PubSubReplicationResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"credentials_uri":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"project_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"name":{"type":"string","readOnly":false},"version":{"readOnly":false,"default":0,"format":"int64","type":"integer"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"topic_id":{"type":"string","readOnly":false}},"required":["creation_ts","credentials_uri","datamart_id","id","internal_replication","name","project_id","replication_filters","status","topic_id","version"]},"DatamartReplicationStatus":{"type":"string","enum":["PAUSED","ACTIVE","ERROR"],"readOnly":false},"DatamartReplicationFilterResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"document":{"$ref":"#/components/schemas/DatamartReplicationDocumentType"},"filter":{"type":"string","readOnly":false},"replication_id":{"type":"string","readOnly":false},"schema_type_name":{"type":"string","readOnly":false}},"required":["document","id","replication_id"]},"DatamartReplicationDocumentType":{"type":"string","enum":["USER_ACCOUNT","USER_EMAIL","USER_EMAIL_PROVIDER","USER_PROFILE","USER_DEVICE_TECHNICAL_ID","USER_DEVICE_POINT","USER_AGENT_PROVIDER","USER_POINT","USER_POINT_PARENT","USER_POINT_SYSTEM_LOG","USER_SEGMENT","USER_ML_FUNCTION","USER_CHOICE","USER_SCENARIO","USER_PLATFORM_ACTIVITY","USER_ACTIVITY","USER_EVENT","USER_COMPUTED_FIELD","USER_COMPUTED_FIELD_STATE","NONE"],"readOnly":false},"InternalReplicationResource":{"allOf":[{"$ref":"#/components/schemas/InternalReplicationCommonResource"},{"type":"object","properties":{"initial_config_status":{"$ref":"#/components/schemas/DatamartReplicationInitialConfigStatus"},"last_state_refresh_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"state_max_log_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"credentials_uri":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"name":{"type":"string","readOnly":false},"connector_type":{"$ref":"#/components/schemas/ReplicationConnectorType"},"version":{"default":0,"format":"int64","readOnly":false,"type":"integer"},"id":{"type":"string","readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["connector_type","creation_ts","credentials_uri","datamart_id","id","initial_config_status","name","replication_filters","status","version"]}]},"InternalReplicationCommonResource":{"type":"object"},"DatamartReplicationInitialConfigStatus":{"type":"string","enum":["WAITING_FOR_TABLE_CREATION","COMPLETED"],"readOnly":false},"ReplicationConnectorType":{"type":"string","enum":["CLICKHOUSE","KAFKA_SINK"],"readOnly":false},"DataWarehouseReplicationResource":{"type":"object","properties":{"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"bucket_name":{"type":"string","readOnly":false},"connector_type":{"$ref":"#/components/schemas/ReplicationConnectorType"},"initial_config_status":{"$ref":"#/components/schemas/DatamartReplicationInitialConfigStatus"},"schema_name":{"type":"string","readOnly":true},"log_refresh_frequency":{"type":"string","readOnly":false},"last_state_refresh_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"data_warehouse_id":{"type":"string","readOnly":true},"name":{"type":"string","readOnly":false},"schema_id":{"type":"string","readOnly":false},"state_max_log_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"version":{"type":"integer","readOnly":false,"default":0,"format":"int64"},"database_name":{"type":"string","readOnly":true},"database_id":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"engine_type":{"$ref":"#/components/schemas/DataWarehouseEngineType"},"id":{"type":"string","readOnly":true}},"required":["bucket_name","connector_type","creation_ts","data_warehouse_id","database_id","database_name","datamart_id","engine_type","id","initial_config_status","internal_replication","name","replication_filters","schema_id","schema_name","status","version"]},"DataWarehouseEngineType":{"type":"string","enum":["BIG_QUERY","POSTGRES","SNOWFLAKE","DUCK_DB"],"readOnly":false},"EventHubsReplicationResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"event_hub_name":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"id":{"type":"string","readOnly":true},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"version":{"readOnly":false,"default":0,"format":"int64","type":"integer"},"datamart_id":{"type":"string","readOnly":false},"credentials_uri":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false}},"required":["creation_ts","credentials_uri","datamart_id","event_hub_name","id","internal_replication","name","replication_filters","status","version"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## PUT /datamarts/{datamart\_id}/replications/{replication\_id}

> Update a datamart replication

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replications/{replication_id}":{"put":{"operationId":"updateDatamartReplication","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DatamartReplicationResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"style":"simple","required":true,"name":"datamart_id","schema":{"type":"string"},"explode":false,"in":"path"},{"style":"simple","required":true,"explode":false,"name":"replication_id","schema":{"type":"string"},"in":"path"}],"summary":"Update a datamart replication","tags":["Replications"],"requestBody":{"description":"The datamart replication to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatamartReplicationResource"}}},"required":true},"description":""}}},"components":{"schemas":{"DatamartReplicationResource":{"discriminator":{"propertyName":"type","mapping":{"GOOGLE_PUBSUB":"#/components/schemas/PubSubReplicationResource","INTERNAL":"#/components/schemas/InternalReplicationResource","DATA_WAREHOUSE":"#/components/schemas/DataWarehouseReplicationResource","AZURE_EVENT_HUBS":"#/components/schemas/EventHubsReplicationResource"}},"oneOf":[{"$ref":"#/components/schemas/PubSubReplicationResource"},{"$ref":"#/components/schemas/InternalReplicationResource"},{"$ref":"#/components/schemas/DataWarehouseReplicationResource"},{"$ref":"#/components/schemas/EventHubsReplicationResource"}],"properties":{"type":{"type":"string","enum":["GOOGLE_PUBSUB","INTERNAL","DATA_WAREHOUSE","AZURE_EVENT_HUBS"]}},"required":["type"]},"PubSubReplicationResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"credentials_uri":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"project_id":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"name":{"type":"string","readOnly":false},"version":{"readOnly":false,"default":0,"format":"int64","type":"integer"},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"topic_id":{"type":"string","readOnly":false}},"required":["creation_ts","credentials_uri","datamart_id","id","internal_replication","name","project_id","replication_filters","status","topic_id","version"]},"DatamartReplicationStatus":{"type":"string","enum":["PAUSED","ACTIVE","ERROR"],"readOnly":false},"DatamartReplicationFilterResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"document":{"$ref":"#/components/schemas/DatamartReplicationDocumentType"},"filter":{"type":"string","readOnly":false},"replication_id":{"type":"string","readOnly":false},"schema_type_name":{"type":"string","readOnly":false}},"required":["document","id","replication_id"]},"DatamartReplicationDocumentType":{"type":"string","enum":["USER_ACCOUNT","USER_EMAIL","USER_EMAIL_PROVIDER","USER_PROFILE","USER_DEVICE_TECHNICAL_ID","USER_DEVICE_POINT","USER_AGENT_PROVIDER","USER_POINT","USER_POINT_PARENT","USER_POINT_SYSTEM_LOG","USER_SEGMENT","USER_ML_FUNCTION","USER_CHOICE","USER_SCENARIO","USER_PLATFORM_ACTIVITY","USER_ACTIVITY","USER_EVENT","USER_COMPUTED_FIELD","USER_COMPUTED_FIELD_STATE","NONE"],"readOnly":false},"InternalReplicationResource":{"allOf":[{"$ref":"#/components/schemas/InternalReplicationCommonResource"},{"type":"object","properties":{"initial_config_status":{"$ref":"#/components/schemas/DatamartReplicationInitialConfigStatus"},"last_state_refresh_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"state_max_log_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"credentials_uri":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"name":{"type":"string","readOnly":false},"connector_type":{"$ref":"#/components/schemas/ReplicationConnectorType"},"version":{"default":0,"format":"int64","readOnly":false,"type":"integer"},"id":{"type":"string","readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true}},"required":["connector_type","creation_ts","credentials_uri","datamart_id","id","initial_config_status","name","replication_filters","status","version"]}]},"InternalReplicationCommonResource":{"type":"object"},"DatamartReplicationInitialConfigStatus":{"type":"string","enum":["WAITING_FOR_TABLE_CREATION","COMPLETED"],"readOnly":false},"ReplicationConnectorType":{"type":"string","enum":["CLICKHOUSE","KAFKA_SINK"],"readOnly":false},"DataWarehouseReplicationResource":{"type":"object","properties":{"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"bucket_name":{"type":"string","readOnly":false},"connector_type":{"$ref":"#/components/schemas/ReplicationConnectorType"},"initial_config_status":{"$ref":"#/components/schemas/DatamartReplicationInitialConfigStatus"},"schema_name":{"type":"string","readOnly":true},"log_refresh_frequency":{"type":"string","readOnly":false},"last_state_refresh_date":{"type":"integer","format":"int64","default":0,"readOnly":true},"data_warehouse_id":{"type":"string","readOnly":true},"name":{"type":"string","readOnly":false},"schema_id":{"type":"string","readOnly":false},"state_max_log_date":{"type":"integer","format":"int64","default":0,"readOnly":false},"version":{"type":"integer","readOnly":false,"default":0,"format":"int64"},"database_name":{"type":"string","readOnly":true},"database_id":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"engine_type":{"$ref":"#/components/schemas/DataWarehouseEngineType"},"id":{"type":"string","readOnly":true}},"required":["bucket_name","connector_type","creation_ts","data_warehouse_id","database_id","database_name","datamart_id","engine_type","id","initial_config_status","internal_replication","name","replication_filters","schema_id","schema_name","status","version"]},"DataWarehouseEngineType":{"type":"string","enum":["BIG_QUERY","POSTGRES","SNOWFLAKE","DUCK_DB"],"readOnly":false},"EventHubsReplicationResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"event_hub_name":{"type":"string","readOnly":false},"status":{"$ref":"#/components/schemas/DatamartReplicationStatus"},"id":{"type":"string","readOnly":true},"internal_replication":{"type":"boolean","default":false,"readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"version":{"readOnly":false,"default":0,"format":"int64","type":"integer"},"datamart_id":{"type":"string","readOnly":false},"credentials_uri":{"type":"string","readOnly":false},"replication_filters":{"type":"array","items":{"$ref":"#/components/schemas/DatamartReplicationFilterResource"},"readOnly":false}},"required":["creation_ts","credentials_uri","datamart_id","event_hub_name","id","internal_replication","name","replication_filters","status","version"]},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /datamarts/{datamart\_id}/replications/{replication\_id}

> Delete the datamart replication

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replications/{replication_id}":{"delete":{"responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"summary":"Delete the datamart replication","parameters":[{"in":"path","name":"datamart_id","explode":false,"schema":{"type":"string"},"required":true,"style":"simple"},{"required":true,"style":"simple","explode":false,"name":"replication_id","schema":{"type":"string"},"in":"path"}],"tags":["Replications"],"description":"","operationId":"removeDatamartReplication"}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```

## POST /datamarts/{datamart\_id}/replications/{replication\_id}/credentials

> Upload datamart replication credentials

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Replications","description":"Operations related to **Replications** for completely replicating the data stream collected in a Datamart to external destinations (Data Warehouse, Data Lake) through Google Pub/Sub. Replicates update and delete operations for:\n- UserPoints\n- UserActivities\n- UserSegments\n- UserProfiles\n- UserAccounts\n- UserEmails\n- Merge events\n\nSupports initial synchronization of existing data.\n\nRelevant documentation:\n- [Datamart replication](https://developer.mediarithmics.io/advanced-usages/exporting-your-data/datamart-replication)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/replications/{replication_id}/credentials":{"post":{"parameters":[{"style":"simple","name":"datamart_id","required":true,"schema":{"type":"string"},"in":"path","explode":false},{"style":"simple","name":"replication_id","explode":false,"in":"path","required":true,"schema":{"type":"string"}}],"summary":"Upload datamart replication credentials","tags":["Replications"],"description":"","responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"requestBody":{"content":{"multipart/form-data":{},"application/json":{"schema":{"$ref":"#/components/schemas/DatamartReplicationCredentialsResource"}}}},"operationId":"uploadDatamartReplicationCredentials"}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]},"DatamartReplicationCredentialsResource":{"discriminator":{"propertyName":"type","mapping":{"HMAC":"#/components/schemas/Hmac","OBJECT_STORAGE":"#/components/schemas/ObjectStorage1"}},"oneOf":[{"$ref":"#/components/schemas/Hmac"},{"$ref":"#/components/schemas/ObjectStorage1"}],"properties":{"type":{"type":"string","enum":["HMAC","OBJECT_STORAGE"]}},"required":["type"]},"Hmac":{"type":"object","properties":{"key":{"type":"string","readOnly":false},"secret":{"type":"string","readOnly":false}},"required":["key","secret"]},"ObjectStorage1":{"type":"object","properties":{"secret_key":{"type":"string","readOnly":false},"access_key":{"type":"string","readOnly":false},"protocol":{"$ref":"#/components/schemas/S3Protocol"},"endpoint":{"type":"string","readOnly":false},"s3_prefix":{"type":"string","readOnly":false}},"required":["access_key","protocol","secret_key"]},"S3Protocol":{"type":"string","enum":["GS","S3"],"readOnly":false}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/api-reference/datamart-management/replications.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
