> 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-operations/document-imports.md).

# Document Imports

Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts.

## GET /datamarts/{datamart\_id}/document\_imports/{document\_import\_id}/delta\_builder/configuration

> Get delta builder configuration for document import by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/delta_builder/configuration":{"get":{"parameters":[{"style":"simple","explode":false,"required":true,"schema":{"type":"integer","format":"int64"},"in":"path","name":"datamart_id"},{"schema":{"type":"integer","format":"int64"},"in":"path","name":"document_import_id","style":"simple","explode":false,"required":true}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DocumentImportDeltaBuilderConfigurationResource"}},"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":"getDeltaBuilderConfiguration","tags":["Document Imports"],"description":"","summary":"Get delta builder configuration for document import by id"}}},"components":{"schemas":{"DocumentImportDeltaBuilderConfigurationResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"document_import_id":{"type":"string","readOnly":false},"engine":{"$ref":"#/components/schemas/DeltaBuilderEngine"},"engine_version":{"type":"string","readOnly":true}},"required":["document_import_id","engine","engine_version","id"]},"DeltaBuilderEngine":{"type":"string","enum":["INTERNAL","DATA_WARE_HOUSE"],"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}/document\_imports/{document\_import\_id}/delta\_builder/configuration

> Create delta builder configuration for document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/delta_builder/configuration":{"post":{"description":"","parameters":[{"schema":{"type":"integer","format":"int64"},"required":true,"name":"datamart_id","in":"path","explode":false,"style":"simple"},{"explode":false,"schema":{"type":"integer","format":"int64"},"style":"simple","name":"document_import_id","required":true,"in":"path"}],"tags":["Document Imports"],"operationId":"createDeltaBuilderConfiguration","requestBody":{"description":"The Document Import to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentImportDeltaBuilderConfigurationResource"}}},"required":true},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DocumentImportDeltaBuilderConfigurationResource"}},"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"}},"summary":"Create delta builder configuration for document import"}}},"components":{"schemas":{"DocumentImportDeltaBuilderConfigurationResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"document_import_id":{"type":"string","readOnly":false},"engine":{"$ref":"#/components/schemas/DeltaBuilderEngine"},"engine_version":{"type":"string","readOnly":true}},"required":["document_import_id","engine","engine_version","id"]},"DeltaBuilderEngine":{"type":"string","enum":["INTERNAL","DATA_WARE_HOUSE"],"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"}}}}}}}
```

## PUT /datamarts/{datamart\_id}/document\_imports/{document\_import\_id}/delta\_builder/configuration

> Update delta builder configuration for document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/delta_builder/configuration":{"put":{"summary":"Update delta builder configuration for document import","operationId":"updateDeltaBuilderConfiguration","description":"","requestBody":{"description":"The Document Import to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentImportDeltaBuilderConfigurationResource"}}},"required":true},"tags":["Document Imports"],"parameters":[{"schema":{"type":"integer","format":"int64"},"explode":false,"style":"simple","name":"datamart_id","in":"path","required":true},{"style":"simple","explode":false,"in":"path","required":true,"name":"document_import_id","schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DocumentImportDeltaBuilderConfigurationResource"}},"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":{"DocumentImportDeltaBuilderConfigurationResource":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"document_import_id":{"type":"string","readOnly":false},"engine":{"$ref":"#/components/schemas/DeltaBuilderEngine"},"engine_version":{"type":"string","readOnly":true}},"required":["document_import_id","engine","engine_version","id"]},"DeltaBuilderEngine":{"type":"string","enum":["INTERNAL","DATA_WARE_HOUSE"],"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"}}}}}}}
```

## DELETE /datamarts/{datamart\_id}/document\_imports/{document\_import\_id}/delta\_builder/configuration

> Remove delta builder configuration for document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/delta_builder/configuration":{"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"}},"parameters":[{"explode":false,"required":true,"name":"datamart_id","schema":{"type":"integer","format":"int64"},"in":"path","style":"simple"},{"required":true,"style":"simple","in":"path","explode":false,"schema":{"type":"integer","format":"int64"},"name":"document_import_id"}],"operationId":"deleteDeltaBuilderConfiguration","tags":["Document Imports"],"summary":"Remove delta builder configuration for document import","description":""}}},"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}/document\_imports/{document\_import\_id}/executions/{id}/action

> Perform document import action on JobExecution

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/executions/{id}/action":{"post":{"parameters":[{"name":"datamart_id","style":"simple","required":true,"schema":{"type":"integer","format":"int64"},"explode":false,"in":"path"},{"name":"document_import_id","required":true,"style":"simple","in":"path","explode":false,"schema":{"type":"integer","format":"int64"}},{"style":"simple","required":true,"schema":{"type":"integer","format":"int64"},"explode":false,"name":"id","in":"path"}],"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":"performDocumentImportExecutionAction","summary":"Perform document import action on JobExecution","tags":["Document Imports"],"requestBody":{"description":"The action to perform","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MakeJobExecutionActionResource"}}},"required":true},"description":""}}},"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 /datasets/{dataset\_id}/document\_imports/{id}

> Get document import targeting a dataset by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datasets/{dataset_id}/document_imports/{id}":{"get":{"description":"","summary":"Get document import targeting a dataset by id","operationId":"getDatasetDocumentImport","tags":["Document Imports"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DocumentImportResource"}},"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":[{"in":"path","style":"simple","name":"dataset_id","schema":{"type":"integer","format":"int64"},"required":true,"explode":false},{"style":"simple","required":true,"explode":false,"schema":{"type":"integer","format":"int64"},"in":"path","name":"id"}]}}},"components":{"schemas":{"DocumentImportResource":{"discriminator":{"propertyName":"target_type","mapping":{"DATAMART":"#/components/schemas/DatamartDocumentImportResource","DATASET":"#/components/schemas/DatasetDocumentImportResource"}},"oneOf":[{"$ref":"#/components/schemas/DatamartDocumentImportResource"},{"$ref":"#/components/schemas/DatasetDocumentImportResource"}],"properties":{"target_type":{"type":"string","enum":["DATAMART","DATASET"]}},"required":["target_type"]},"DatamartDocumentImportResource":{"type":"object","properties":{"datafarm_key":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"encoding":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false}},"required":["datafarm_key","datamart_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"DocumentImportMimeType":{"type":"string","enum":["APPLICATION_X_NDJSON","TEXT_CSV"],"readOnly":false},"DocumentImportTargetType":{"type":"string","enum":["DATAMART","DATASET"],"readOnly":false},"JobExecPriorityForOrganizationAndDefinition":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"readOnly":false},"DocumentImportSourceType":{"type":"string","enum":["API","INPUT_STREAM_JOB"],"readOnly":false},"DocumentType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE","USER_SEGMENT","USER_CHOICE","USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DISSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DELETION","USER_DEVICE_POINTS_DELETION","USER_POINTS_DELETION"],"readOnly":false},"DatasetDocumentImportResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"dataset_id":{"type":"string","readOnly":false},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"encoding":{"type":"string","readOnly":false}},"required":["dataset_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"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}/document\_imports

> Search document imports

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Mediarithmics most used API","description":"These operations where flagged by mediarithmics teams as most useful."},{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports":{"get":{"description":"","summary":"Search document imports","operationId":"findDocumentImports","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentImportResource"}},"first_result":{"type":"integer"},"total":{"type":"integer"},"count":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"max_results":{"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"}},"parameters":[{"in":"path","required":true,"style":"simple","explode":false,"name":"datamart_id","schema":{"type":"integer","format":"int64"}},{"explode":true,"style":"form","schema":{"type":"integer","format":"int32"},"in":"query","description":"Offset from which the search must be performed","name":"first_result","required":false},{"name":"max_results","in":"query","required":false,"explode":true,"style":"form","description":"Number of maximum items that shall be return by this search","schema":{"type":"integer","format":"int32"}},{"name":"order_by","in":"query","required":false,"style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}},"description":"Fields used to order the result"},{"required":false,"name":"keywords","in":"query","schema":{"type":"string"},"style":"form","description":"The keywords to match with document import names","explode":true},{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentType"}},"style":"form","in":"query","explode":true,"description":"Document type of the import","required":false,"name":"document_types"},{"description":"Content Type. For now only \"application/x-ndjson\"","explode":true,"in":"query","schema":{"$ref":"#/components/schemas/DocumentImportMimeType"},"style":"form","required":false,"name":"content_type"},{"schema":{"type":"array","items":{"type":"integer","format":"int64"}},"description":"Imports in the result are labeled by all labels identified by this list","in":"query","style":"form","required":false,"name":"label_ids","explode":true}],"tags":["Document Imports","Mediarithmics most used API"]}}},"components":{"schemas":{"DocumentImportResource":{"discriminator":{"propertyName":"target_type","mapping":{"DATAMART":"#/components/schemas/DatamartDocumentImportResource","DATASET":"#/components/schemas/DatasetDocumentImportResource"}},"oneOf":[{"$ref":"#/components/schemas/DatamartDocumentImportResource"},{"$ref":"#/components/schemas/DatasetDocumentImportResource"}],"properties":{"target_type":{"type":"string","enum":["DATAMART","DATASET"]}},"required":["target_type"]},"DatamartDocumentImportResource":{"type":"object","properties":{"datafarm_key":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"encoding":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false}},"required":["datafarm_key","datamart_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"DocumentImportMimeType":{"type":"string","enum":["APPLICATION_X_NDJSON","TEXT_CSV"],"readOnly":false},"DocumentImportTargetType":{"type":"string","enum":["DATAMART","DATASET"],"readOnly":false},"JobExecPriorityForOrganizationAndDefinition":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"readOnly":false},"DocumentImportSourceType":{"type":"string","enum":["API","INPUT_STREAM_JOB"],"readOnly":false},"DocumentType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE","USER_SEGMENT","USER_CHOICE","USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DISSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DELETION","USER_DEVICE_POINTS_DELETION","USER_POINTS_DELETION"],"readOnly":false},"DatasetDocumentImportResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"dataset_id":{"type":"string","readOnly":false},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"encoding":{"type":"string","readOnly":false}},"required":["dataset_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"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}/document\_imports

> Create document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Mediarithmics most used API","description":"These operations where flagged by mediarithmics teams as most useful."},{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports":{"post":{"tags":["Document Imports","Mediarithmics most used API"],"parameters":[{"explode":false,"required":true,"style":"simple","schema":{"type":"integer","format":"int64"},"name":"datamart_id","in":"path"}],"requestBody":{"description":"The document import to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentImportResource"}}},"required":true},"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DocumentImportResource"}},"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"}},"description":"","operationId":"createDocumentImport","summary":"Create document import"}}},"components":{"schemas":{"DocumentImportResource":{"discriminator":{"propertyName":"target_type","mapping":{"DATAMART":"#/components/schemas/DatamartDocumentImportResource","DATASET":"#/components/schemas/DatasetDocumentImportResource"}},"oneOf":[{"$ref":"#/components/schemas/DatamartDocumentImportResource"},{"$ref":"#/components/schemas/DatasetDocumentImportResource"}],"properties":{"target_type":{"type":"string","enum":["DATAMART","DATASET"]}},"required":["target_type"]},"DatamartDocumentImportResource":{"type":"object","properties":{"datafarm_key":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"encoding":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false}},"required":["datafarm_key","datamart_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"DocumentImportMimeType":{"type":"string","enum":["APPLICATION_X_NDJSON","TEXT_CSV"],"readOnly":false},"DocumentImportTargetType":{"type":"string","enum":["DATAMART","DATASET"],"readOnly":false},"JobExecPriorityForOrganizationAndDefinition":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"readOnly":false},"DocumentImportSourceType":{"type":"string","enum":["API","INPUT_STREAM_JOB"],"readOnly":false},"DocumentType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE","USER_SEGMENT","USER_CHOICE","USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DISSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DELETION","USER_DEVICE_POINTS_DELETION","USER_POINTS_DELETION"],"readOnly":false},"DatasetDocumentImportResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"dataset_id":{"type":"string","readOnly":false},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"encoding":{"type":"string","readOnly":false}},"required":["dataset_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"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 /datasets/{dataset\_id}/document\_imports

> Search document imports targeting a dataset

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datasets/{dataset_id}/document_imports":{"get":{"tags":["Document Imports"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentImportResource"}},"count":{"type":"integer"},"max_results":{"type":"integer"},"total":{"type":"integer"},"first_result":{"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"}},"parameters":[{"required":true,"explode":false,"in":"path","style":"simple","name":"dataset_id","schema":{"type":"integer","format":"int64"}},{"required":false,"description":"Offset from which the search must be performed","in":"query","schema":{"type":"integer","format":"int32"},"explode":true,"style":"form","name":"first_result"},{"schema":{"type":"integer","format":"int32"},"name":"max_results","required":false,"in":"query","explode":true,"description":"Number of maximum items that shall be return by this search","style":"form"},{"name":"order_by","style":"form","in":"query","description":"Fields used to order the result","required":false,"schema":{"type":"array","items":{"type":"string"}},"explode":true},{"explode":true,"description":"The keywords to match with document import names","in":"query","name":"keywords","style":"form","schema":{"type":"string"},"required":false}],"description":"","summary":"Search document imports targeting a dataset","operationId":"findDatasetDocumentImports"}}},"components":{"schemas":{"DocumentImportResource":{"discriminator":{"propertyName":"target_type","mapping":{"DATAMART":"#/components/schemas/DatamartDocumentImportResource","DATASET":"#/components/schemas/DatasetDocumentImportResource"}},"oneOf":[{"$ref":"#/components/schemas/DatamartDocumentImportResource"},{"$ref":"#/components/schemas/DatasetDocumentImportResource"}],"properties":{"target_type":{"type":"string","enum":["DATAMART","DATASET"]}},"required":["target_type"]},"DatamartDocumentImportResource":{"type":"object","properties":{"datafarm_key":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"encoding":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false}},"required":["datafarm_key","datamart_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"DocumentImportMimeType":{"type":"string","enum":["APPLICATION_X_NDJSON","TEXT_CSV"],"readOnly":false},"DocumentImportTargetType":{"type":"string","enum":["DATAMART","DATASET"],"readOnly":false},"JobExecPriorityForOrganizationAndDefinition":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"readOnly":false},"DocumentImportSourceType":{"type":"string","enum":["API","INPUT_STREAM_JOB"],"readOnly":false},"DocumentType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE","USER_SEGMENT","USER_CHOICE","USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DISSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DELETION","USER_DEVICE_POINTS_DELETION","USER_POINTS_DELETION"],"readOnly":false},"DatasetDocumentImportResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"dataset_id":{"type":"string","readOnly":false},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"encoding":{"type":"string","readOnly":false}},"required":["dataset_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"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 /datasets/{dataset\_id}/document\_imports

> Create document import targeting a dataset

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datasets/{dataset_id}/document_imports":{"post":{"requestBody":{"description":"The document import to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentImportResource"}}},"required":true},"summary":"Create document import targeting a dataset","operationId":"createDatasetDocumentImport","parameters":[{"schema":{"type":"integer","format":"int64"},"style":"simple","explode":false,"required":true,"in":"path","name":"dataset_id"}],"tags":["Document Imports"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DocumentImportResource"}},"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"}},"description":""}}},"components":{"schemas":{"DocumentImportResource":{"discriminator":{"propertyName":"target_type","mapping":{"DATAMART":"#/components/schemas/DatamartDocumentImportResource","DATASET":"#/components/schemas/DatasetDocumentImportResource"}},"oneOf":[{"$ref":"#/components/schemas/DatamartDocumentImportResource"},{"$ref":"#/components/schemas/DatasetDocumentImportResource"}],"properties":{"target_type":{"type":"string","enum":["DATAMART","DATASET"]}},"required":["target_type"]},"DatamartDocumentImportResource":{"type":"object","properties":{"datafarm_key":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"encoding":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false}},"required":["datafarm_key","datamart_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"DocumentImportMimeType":{"type":"string","enum":["APPLICATION_X_NDJSON","TEXT_CSV"],"readOnly":false},"DocumentImportTargetType":{"type":"string","enum":["DATAMART","DATASET"],"readOnly":false},"JobExecPriorityForOrganizationAndDefinition":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"readOnly":false},"DocumentImportSourceType":{"type":"string","enum":["API","INPUT_STREAM_JOB"],"readOnly":false},"DocumentType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE","USER_SEGMENT","USER_CHOICE","USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DISSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DELETION","USER_DEVICE_POINTS_DELETION","USER_POINTS_DELETION"],"readOnly":false},"DatasetDocumentImportResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"dataset_id":{"type":"string","readOnly":false},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"encoding":{"type":"string","readOnly":false}},"required":["dataset_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"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 /datasets/{dataset\_id}/document\_imports/{document\_import\_id}/executions/{id}

> Get an execution created on the dataset document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datasets/{dataset_id}/document_imports/{document_import_id}/executions/{id}":{"get":{"parameters":[{"required":true,"schema":{"type":"integer","format":"int64"},"name":"dataset_id","explode":false,"in":"path","style":"simple"},{"in":"path","required":true,"explode":false,"schema":{"type":"integer","format":"int64"},"style":"simple","name":"document_import_id"},{"in":"path","required":true,"style":"simple","schema":{"type":"integer","format":"int64"},"name":"id","explode":false}],"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"}},"description":"","operationId":"getDatasetDocumentImportExecution","summary":"Get an execution created on the dataset document import","tags":["Document Imports"]}}},"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}/document\_imports/{document\_import\_id}/executions/{id}

> Get an execution created on the document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/executions/{id}":{"get":{"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"}},"summary":"Get an execution created on the document import","description":"","tags":["Document Imports"],"operationId":"getDocumentImportExecution","parameters":[{"explode":false,"style":"simple","required":true,"name":"datamart_id","in":"path","schema":{"type":"integer","format":"int64"}},{"schema":{"type":"integer","format":"int64"},"explode":false,"style":"simple","name":"document_import_id","in":"path","required":true},{"explode":false,"in":"path","required":true,"schema":{"type":"integer","format":"int64"},"style":"simple","name":"id"}]}}},"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}/document\_imports/{document\_import\_id}/delta\_builder/executions/{id}

> Get an execution created on the document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/delta_builder/executions/{id}":{"get":{"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"}},"parameters":[{"in":"path","schema":{"type":"integer","format":"int64"},"name":"datamart_id","explode":false,"required":true,"style":"simple"},{"required":true,"explode":false,"schema":{"type":"integer","format":"int64"},"name":"document_import_id","in":"path","style":"simple"},{"explode":false,"required":true,"in":"path","style":"simple","name":"id","schema":{"type":"integer","format":"int64"}}],"operationId":"getDocumentImportDeltaBuilderExecution","tags":["Document Imports"],"summary":"Get an execution created on the document import"}}},"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 /datasets/{dataset\_id}/document\_imports/{id}/executions

> List all executions created on the dataset document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datasets/{dataset_id}/document_imports/{id}/executions":{"get":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"first_result":{"type":"integer"},"max_results":{"type":"integer"},"count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/NewPublicJobExecutionResource"}},"total":{"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"}},"parameters":[{"in":"path","explode":false,"style":"simple","schema":{"type":"integer","format":"int64"},"name":"dataset_id","required":true},{"required":true,"in":"path","explode":false,"name":"id","schema":{"type":"integer","format":"int64"},"style":"simple"},{"style":"form","required":false,"schema":{"type":"integer","format":"int32"},"name":"first_result","explode":true,"description":"Offset from which the search must be performed","in":"query"},{"schema":{"type":"integer","format":"int32"},"explode":true,"in":"query","style":"form","required":false,"description":"Number of maximum items that shall be return by this search","name":"max_results"},{"explode":true,"style":"form","schema":{"type":"string"},"required":false,"in":"query","description":"Fields used to order the result","name":"order_by"},{"required":false,"in":"query","explode":true,"name":"status","style":"form","schema":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"description":"The status of the job (PENDING/RUNNING/SUCCEEDED/FAILED)"},{"in":"query","schema":{"type":"string"},"required":false,"description":"Individual job execution name (not necessarily unique)","name":"external_name","explode":true,"style":"form"}],"description":"","operationId":"listDatasetDocumentImportExecutions","tags":["Document Imports"],"summary":"List all executions created on the dataset document import"}}},"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 /datasets/{dataset\_id}/document\_imports/{id}/executions

> Post a file to start the job execution

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datasets/{dataset_id}/document_imports/{id}/executions":{"post":{"operationId":"createDatasetDocumentImportExecution","parameters":[{"style":"simple","name":"dataset_id","required":true,"schema":{"type":"integer","format":"int64"},"in":"path","explode":false},{"in":"path","explode":false,"required":true,"name":"id","schema":{"type":"integer","format":"int64"},"style":"simple"},{"name":"external_name","in":"query","style":"form","schema":{"type":"string"},"required":false,"explode":true}],"description":"","tags":["Document Imports"],"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"}},"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"array","items":{"type":"string","format":"binary"}}}}},"text/csv":{"schema":{"type":"string"}}}},"summary":"Post a file to start the job execution"}}},"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}/document\_imports/{document\_import\_id}/delta\_builder/executions

> List all execution created on the document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/delta_builder/executions":{"get":{"parameters":[{"explode":false,"style":"simple","name":"datamart_id","required":true,"schema":{"type":"integer","format":"int64"},"in":"path"},{"style":"simple","in":"path","required":true,"schema":{"type":"integer","format":"int64"},"explode":false,"name":"document_import_id"},{"required":false,"description":"Offset from which the search must be performed","explode":true,"schema":{"type":"integer","format":"int32"},"name":"first_result","style":"form","in":"query"},{"name":"max_results","style":"form","in":"query","required":false,"explode":true,"schema":{"type":"integer","format":"int32"},"description":"Number of maximum items that shall be return by this search"},{"in":"query","style":"form","description":"Fields used to order the result","schema":{"type":"string"},"required":false,"explode":true,"name":"order_by"},{"style":"form","name":"status","schema":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"required":false,"explode":true,"description":"The status of the job (PENDING/RUNNING/SUCCEEDED/FAILED)","in":"query"},{"description":"Individual job execution name (not necessarily unique)","schema":{"type":"string"},"style":"form","name":"external_name","explode":true,"in":"query","required":false}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NewPublicJobExecutionResource"}},"first_result":{"type":"integer"},"total":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"max_results":{"type":"integer"},"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":["Document Imports"],"description":"","operationId":"listDocumentImportDeltaBuilderExecutions","summary":"List all execution created on the document import"}}},"components":{"schemas":{"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"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},"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}/document\_imports/{document\_import\_id}/delta\_builder/executions

> Post a file to start the job execution

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{document_import_id}/delta_builder/executions":{"post":{"parameters":[{"schema":{"type":"integer","format":"int64"},"explode":false,"name":"datamart_id","in":"path","required":true,"style":"simple"},{"schema":{"type":"integer","format":"int64"},"required":true,"name":"document_import_id","style":"simple","in":"path","explode":false}],"tags":["Document Imports"],"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"}},"summary":"Post a file to start the job execution","requestBody":{"description":"Informations to create delta execution","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentImportDeltaBuilderLaunchResource"}}},"required":true},"operationId":"createDocumentImportDeltaBuilderExecution"}}},"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"]},"DocumentImportDeltaBuilderLaunchResource":{"type":"object","properties":{"from_version":{"type":"string","readOnly":false},"file_pattern":{"type":"string","readOnly":false},"identifier":{"$ref":"#/components/schemas/DeltaBuilderLaunchIdentifierType"},"to_version":{"type":"string","readOnly":false},"dry_run":{"type":"boolean","default":false,"readOnly":false}},"required":["identifier","to_version"]},"DeltaBuilderLaunchIdentifierType":{"type":"string","enum":["USER_ACCOUNT","USER_AGENT"],"readOnly":false}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## GET /organisations/{organisation\_id}/document\_imports

> Search document imports of an organisation, regardless of their target (datamart or dataset)

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/organisations/{organisation_id}/document_imports":{"get":{"tags":["Document Imports"],"operationId":"findOrganisationDocumentImports","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"max_results":{"type":"integer"},"total":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentImportResource"}},"first_result":{"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"}},"summary":"Search document imports of an organisation, regardless of their target (datamart or dataset)","description":"","parameters":[{"required":true,"explode":false,"schema":{"type":"integer","format":"int64"},"name":"organisation_id","style":"simple","in":"path"},{"schema":{"type":"integer","format":"int32"},"description":"Offset from which the search must be performed","style":"form","explode":true,"in":"query","required":false,"name":"first_result"},{"style":"form","description":"Number of maximum items that shall be return by this search","required":false,"schema":{"type":"integer","format":"int32"},"name":"max_results","in":"query","explode":true},{"required":false,"in":"query","explode":true,"style":"form","description":"Fields used to order the result","name":"order_by","schema":{"type":"array","items":{"type":"string"}}},{"explode":true,"description":"The keywords to match with document import names","style":"form","required":false,"name":"keywords","schema":{"type":"string"},"in":"query"},{"name":"target_type","explode":true,"description":"Restrict the result to document imports targeting the given resource type(s)","schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentImportTargetType"}},"in":"query","style":"form","required":false},{"explode":true,"schema":{"type":"array","items":{"type":"integer","format":"int64"}},"description":"Restrict datamart-targeted results to the given datamart id(s); imports targeting a dataset are unaffected by this filter","required":false,"name":"datamart_ids","in":"query","style":"form"},{"description":"Restrict dataset-targeted results to the given dataset id(s); imports targeting a datamart are unaffected by this filter","schema":{"type":"array","items":{"type":"integer","format":"int64"}},"in":"query","name":"dataset_ids","style":"form","required":false,"explode":true},{"description":"Document type of the import","schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentType"}},"required":false,"explode":true,"in":"query","style":"form","name":"document_types"},{"required":false,"style":"form","in":"query","explode":true,"description":"Content Type of the import","name":"content_type","schema":{"$ref":"#/components/schemas/DocumentImportMimeType"}},{"name":"label_ids","schema":{"type":"array","items":{"type":"integer","format":"int64"}},"required":false,"in":"query","description":"Imports in the result are labeled by all labels identified by this list","style":"form","explode":true}]}}},"components":{"schemas":{"DocumentImportResource":{"discriminator":{"propertyName":"target_type","mapping":{"DATAMART":"#/components/schemas/DatamartDocumentImportResource","DATASET":"#/components/schemas/DatasetDocumentImportResource"}},"oneOf":[{"$ref":"#/components/schemas/DatamartDocumentImportResource"},{"$ref":"#/components/schemas/DatasetDocumentImportResource"}],"properties":{"target_type":{"type":"string","enum":["DATAMART","DATASET"]}},"required":["target_type"]},"DatamartDocumentImportResource":{"type":"object","properties":{"datafarm_key":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"encoding":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false}},"required":["datafarm_key","datamart_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"DocumentImportMimeType":{"type":"string","enum":["APPLICATION_X_NDJSON","TEXT_CSV"],"readOnly":false},"DocumentImportTargetType":{"type":"string","enum":["DATAMART","DATASET"],"readOnly":false},"JobExecPriorityForOrganizationAndDefinition":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"readOnly":false},"DocumentImportSourceType":{"type":"string","enum":["API","INPUT_STREAM_JOB"],"readOnly":false},"DocumentType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE","USER_SEGMENT","USER_CHOICE","USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DISSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DELETION","USER_DEVICE_POINTS_DELETION","USER_POINTS_DELETION"],"readOnly":false},"DatasetDocumentImportResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"dataset_id":{"type":"string","readOnly":false},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"encoding":{"type":"string","readOnly":false}},"required":["dataset_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"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}/document\_imports/{id}/executions

> List all execution created on the document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Mediarithmics most used API","description":"These operations where flagged by mediarithmics teams as most useful."},{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{id}/executions":{"get":{"tags":["Document Imports","Mediarithmics most used API"],"parameters":[{"name":"datamart_id","required":true,"explode":false,"schema":{"type":"integer","format":"int64"},"in":"path","style":"simple"},{"style":"simple","in":"path","explode":false,"schema":{"type":"integer","format":"int64"},"name":"id","required":true},{"required":false,"explode":true,"in":"query","name":"first_result","style":"form","description":"Offset from which the search must be performed","schema":{"type":"integer","format":"int32"}},{"name":"max_results","in":"query","required":false,"schema":{"type":"integer","format":"int32"},"style":"form","description":"Number of maximum items that shall be return by this search","explode":true},{"required":false,"schema":{"type":"string"},"name":"order_by","explode":true,"description":"Fields used to order the result","style":"form","in":"query"},{"description":"The status of the job (PENDING/RUNNING/SUCCEEDED/FAILED)","in":"query","explode":true,"required":false,"name":"status","schema":{"$ref":"#/components/schemas/JobExecutionPublicStatus"},"style":"form"},{"required":false,"description":"Individual job execution name (not necessarily unique)","name":"external_name","style":"form","in":"query","schema":{"type":"string"},"explode":true}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"max_results":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"first_result":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/NewPublicJobExecutionResource"}},"total":{"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"}},"operationId":"listDocumentImportExecutions","description":"","summary":"List all execution created on the document import"}}},"components":{"schemas":{"JobExecutionPublicStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED"],"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},"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}/document\_imports/{id}/executions

> Post a file to start the job execution

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Mediarithmics most used API","description":"These operations where flagged by mediarithmics teams as most useful."},{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{id}/executions":{"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"}},"summary":"Post a file to start the job execution","operationId":"createDocumentImportExecution","tags":["Document Imports","Mediarithmics most used API"],"parameters":[{"schema":{"type":"integer","format":"int64"},"in":"path","explode":false,"required":true,"style":"simple","name":"datamart_id"},{"in":"path","schema":{"type":"integer","format":"int64"},"explode":false,"name":"id","style":"simple","required":true},{"style":"form","required":false,"in":"query","schema":{"type":"string"},"name":"external_name","explode":true}],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"array","items":{"type":"string","format":"binary"}}}}},"application/x-ndjson":{"schema":{"type":"string"}},"text/csv":{"schema":{"type":"string"}}}}}}},"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}/document\_imports/{id}

> Get document import by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{id}":{"get":{"operationId":"getDocumentImport","tags":["Document Imports"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DocumentImportResource"}},"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"}},"description":"","summary":"Get document import by id","parameters":[{"required":true,"name":"datamart_id","explode":false,"in":"path","schema":{"type":"integer","format":"int64"},"style":"simple"},{"required":true,"in":"path","name":"id","schema":{"type":"integer","format":"int64"},"explode":false,"style":"simple"}]}}},"components":{"schemas":{"DocumentImportResource":{"discriminator":{"propertyName":"target_type","mapping":{"DATAMART":"#/components/schemas/DatamartDocumentImportResource","DATASET":"#/components/schemas/DatasetDocumentImportResource"}},"oneOf":[{"$ref":"#/components/schemas/DatamartDocumentImportResource"},{"$ref":"#/components/schemas/DatasetDocumentImportResource"}],"properties":{"target_type":{"type":"string","enum":["DATAMART","DATASET"]}},"required":["target_type"]},"DatamartDocumentImportResource":{"type":"object","properties":{"datafarm_key":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"encoding":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false}},"required":["datafarm_key","datamart_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"DocumentImportMimeType":{"type":"string","enum":["APPLICATION_X_NDJSON","TEXT_CSV"],"readOnly":false},"DocumentImportTargetType":{"type":"string","enum":["DATAMART","DATASET"],"readOnly":false},"JobExecPriorityForOrganizationAndDefinition":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"readOnly":false},"DocumentImportSourceType":{"type":"string","enum":["API","INPUT_STREAM_JOB"],"readOnly":false},"DocumentType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE","USER_SEGMENT","USER_CHOICE","USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DISSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DELETION","USER_DEVICE_POINTS_DELETION","USER_POINTS_DELETION"],"readOnly":false},"DatasetDocumentImportResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"dataset_id":{"type":"string","readOnly":false},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"encoding":{"type":"string","readOnly":false}},"required":["dataset_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"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}/document\_imports/{id}

> Update document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{id}":{"put":{"requestBody":{"description":"The Document Import to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentImportResource"}}},"required":true},"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/DocumentImportResource"}},"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"}},"summary":"Update document import","tags":["Document Imports"],"parameters":[{"in":"path","required":true,"name":"datamart_id","style":"simple","schema":{"type":"integer","format":"int64"},"explode":false},{"schema":{"type":"integer","format":"int64"},"name":"id","in":"path","required":true,"explode":false,"style":"simple"}],"operationId":"updateDocumentImport"}}},"components":{"schemas":{"DocumentImportResource":{"discriminator":{"propertyName":"target_type","mapping":{"DATAMART":"#/components/schemas/DatamartDocumentImportResource","DATASET":"#/components/schemas/DatasetDocumentImportResource"}},"oneOf":[{"$ref":"#/components/schemas/DatamartDocumentImportResource"},{"$ref":"#/components/schemas/DatasetDocumentImportResource"}],"properties":{"target_type":{"type":"string","enum":["DATAMART","DATASET"]}},"required":["target_type"]},"DatamartDocumentImportResource":{"type":"object","properties":{"datafarm_key":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"encoding":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false}},"required":["datafarm_key","datamart_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"DocumentImportMimeType":{"type":"string","enum":["APPLICATION_X_NDJSON","TEXT_CSV"],"readOnly":false},"DocumentImportTargetType":{"type":"string","enum":["DATAMART","DATASET"],"readOnly":false},"JobExecPriorityForOrganizationAndDefinition":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"readOnly":false},"DocumentImportSourceType":{"type":"string","enum":["API","INPUT_STREAM_JOB"],"readOnly":false},"DocumentType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE","USER_SEGMENT","USER_CHOICE","USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DISSOCIATION_DECLARATIONS","USER_IDENTIFIERS_DELETION","USER_DEVICE_POINTS_DELETION","USER_POINTS_DELETION"],"readOnly":false},"DatasetDocumentImportResource":{"type":"object","properties":{"name":{"type":"string","readOnly":false},"mime_type":{"$ref":"#/components/schemas/DocumentImportMimeType"},"document_type":{"$ref":"#/components/schemas/DocumentType"},"source_type":{"$ref":"#/components/schemas/DocumentImportSourceType"},"priority":{"$ref":"#/components/schemas/JobExecPriorityForOrganizationAndDefinition"},"target_type":{"$ref":"#/components/schemas/DocumentImportTargetType"},"dataset_id":{"type":"string","readOnly":false},"use_processing_pipeline":{"type":"boolean","default":false,"readOnly":false},"shuffle_lines":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"encoding":{"type":"string","readOnly":false}},"required":["dataset_id","document_type","encoding","id","mime_type","name","shuffle_lines","source_type","target_type","use_processing_pipeline"]},"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}/document\_imports/{id}

> Delete document import

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Document Imports","description":"Operations related to Document Imports, the mechanism to import large files containing customer data into Datamarts."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/document_imports/{id}":{"delete":{"tags":["Document Imports"],"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"}},"parameters":[{"in":"path","style":"simple","required":true,"name":"datamart_id","schema":{"type":"integer","format":"int64"},"explode":false},{"schema":{"type":"integer","format":"int64"},"required":true,"style":"simple","name":"id","explode":false,"in":"path"}],"operationId":"deleteDocumentImport","summary":"Delete document import","description":""}}},"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"]}}}}
```


---

# 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-operations/document-imports.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.
