# Data Pools

## List Data Pools

> Retrieves a paginated list of data pools. Can be filtered by \`name\`.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"DataPoolListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DataPool"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"DataPool":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"description":{"type":"string"},"data_pool_template_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PaginationMeta":{"type":"object","properties":{"current_page":{"type":"integer"},"from":{"type":"integer","nullable":true},"last_page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"to":{"type":"integer","nullable":true},"total":{"type":"integer"}}},"PaginationLinks":{"type":"object","properties":{"first":{"type":"string","format":"uri"},"last":{"type":"string","format":"uri"},"prev":{"type":"string","format":"uri","nullable":true},"next":{"type":"string","format":"uri","nullable":true}}}}},"paths":{"/api/v1/data-pool":{"get":{"summary":"List Data Pools","description":"Retrieves a paginated list of data pools. Can be filtered by `name`.","parameters":[{"name":"filter[name]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by name."},{"name":"filter[id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by id."},{"name":"filter[,]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by ,."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: name, description"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: created_at"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Page number for pagination."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"Number of results per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataPoolListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Data Pools"]}}}}
```

## Create Data Pool

> Creates a new data pool.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"DataPoolResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DataPool"}}},"DataPool":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"description":{"type":"string"},"data_pool_template_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"DataPoolStoreRequest":{"type":"object","properties":{"description":{"type":"string","maxLength":255,"nullable":true},"name":{"type":"string","minLength":3,"maxLength":100}},"required":["name"]}}},"paths":{"/api/v1/data-pool":{"post":{"summary":"Create Data Pool","description":"Creates a new data pool.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataPoolResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataPoolStoreRequest"}}}},"tags":["Data Pools"],"parameters":[]}}}}
```

## Get Data Pool

> Retrieves the details of a specific data pool.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"DataPoolResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DataPool"}}},"DataPool":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"description":{"type":"string"},"data_pool_template_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}},"paths":{"/api/v1/data-pool/{data_pool}":{"get":{"summary":"Get Data Pool","description":"Retrieves the details of a specific data pool.","parameters":[{"name":"data_pool","in":"path","required":true,"schema":{"type":"string"},"description":"The data pool identifier."},{"name":"filter[name]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by name."},{"name":"filter[id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by id."},{"name":"filter[,]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by ,."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: name, description"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: created_at"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Page number for pagination."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"Number of results per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataPoolResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Data Pools"]}}}}
```

## Update Data Pool

> Updates an existing data pool.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"DataPoolResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DataPool"}}},"DataPool":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"description":{"type":"string"},"data_pool_template_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"DataPoolUpdateRequest":{"type":"object","properties":{"description":{"type":"string","maxLength":255,"nullable":true},"name":{"type":"string","minLength":3,"maxLength":100}}}}},"paths":{"/api/v1/data-pool/{data_pool}":{"put":{"summary":"Update Data Pool","description":"Updates an existing data pool.","parameters":[{"name":"data_pool","in":"path","required":true,"schema":{"type":"string"},"description":"The data pool identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataPoolResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataPoolUpdateRequest"}}}},"tags":["Data Pools"]}}}}
```

## Delete Data Pool

> Permanently deletes a specific data pool.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v1/data-pool/{data_pool}":{"delete":{"summary":"Delete Data Pool","description":"Permanently deletes a specific data pool.","parameters":[{"name":"data_pool","in":"path","required":true,"schema":{"type":"string"},"description":"The data pool identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Data Pools"]}}}}
```

## List Data Pool Deduped Data

> Retrieves a paginated list of deduped data records for a specific data pool. Can be filtered by \`flow\_id\`, \`flow\_run\_id\`, \`step\_id\`, \`entity\_type\_id\`, \`value\`, \`created\_before\`, and \`created\_after\`.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"DataPoolListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DataPool"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"DataPool":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"description":{"type":"string"},"data_pool_template_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"PaginationMeta":{"type":"object","properties":{"current_page":{"type":"integer"},"from":{"type":"integer","nullable":true},"last_page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"to":{"type":"integer","nullable":true},"total":{"type":"integer"}}},"PaginationLinks":{"type":"object","properties":{"first":{"type":"string","format":"uri"},"last":{"type":"string","format":"uri"},"prev":{"type":"string","format":"uri","nullable":true},"next":{"type":"string","format":"uri","nullable":true}}}}},"paths":{"/api/v1/data-pool/{data_pool}/deduped-data":{"get":{"summary":"List Data Pool Deduped Data","description":"Retrieves a paginated list of deduped data records for a specific data pool. Can be filtered by `flow_id`, `flow_run_id`, `step_id`, `entity_type_id`, `value`, `created_before`, and `created_after`.","parameters":[{"name":"data_pool","in":"path","required":true,"schema":{"type":"string"},"description":"The data pool identifier."},{"name":"filter[flow_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by flow_id."},{"name":"filter[flow_run_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by flow_run_id."},{"name":"filter[step_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by step_id."},{"name":"filter[entity_type_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by entity_type_id."},{"name":"filter[value]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by value."},{"name":"filter[created_before]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by created_before."},{"name":"filter[created_after]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by created_after."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: flow, flowRun, flowStep, entityType, dataPool"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: created_at, id"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Page number for pagination."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"Number of results per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataPoolListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Data Pools"]}}}}
```

## Download Data Pool Deduped Data

> Triggers the download of de-dupe data for a specific data pool. A CSV file is generated and added to the file downloads section in the Patchworks dashboard.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}}},"paths":{"/api/v1/data-pool/{data_pool}/deduped-data/download":{"get":{"summary":"Download Data Pool Deduped Data","description":"Triggers the download of de-dupe data for a specific data pool. A CSV file is generated and added to the file downloads section in the Patchworks dashboard.","parameters":[{"name":"data_pool","in":"path","required":true,"schema":{"type":"string"},"description":"The data pool identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Data Pools"]}}}}
```

## Import Data Pool Deduped Data

> Imports de-dupe values into a specific data pool from a CSV file containing \`value\` and \`entity\_type\_id\` headers. All records in the import file are added as new items, and any existing items in the data pool are left unchanged.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"DataPoolImportImportRequest":{"type":"object","properties":{"deduped_data_file":{"type":"string"}},"required":["deduped_data_file"]}}},"paths":{"/api/v1/data-pool/{data_pool}/deduped-data/import":{"post":{"summary":"Import Data Pool Deduped Data","description":"Imports de-dupe values into a specific data pool from a CSV file containing `value` and `entity_type_id` headers. All records in the import file are added as new items, and any existing items in the data pool are left unchanged.","parameters":[{"name":"data_pool","in":"path","required":true,"schema":{"type":"string"},"description":"The data pool identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataPoolImportImportRequest"}}}},"tags":["Data Pools"]}}}}
```

## Delete Deduped Data Record

> Deletes specific records from a data pool.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Data Pools"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v1/data-pool/{id}/deduped-data/delete-records":{"delete":{"summary":"Delete Deduped Data Record","description":"Deletes specific records from a data pool.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The unique identifier of the id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Data Pools"]}}}}
```
