# Deleting Profiles From Real Time Segments If required, for business reasons or to comply with privacy laws like GDPR or CCPA, you can delete profiles that are stored in real-time segments. The mechanism for accomplishing this is to create a workflow that calls a profile deletion API with a table of profiles to be deleted. Here are steps for accomplishing this: 1. Create a table that contains one or more profiles that you want to delete from a real-time segment. 2. Create a workflow task that passes the table of profiles to a deletion API that deletes the profiles it contains from the real-time segment 3. Consult the Premium Audit Log to confirm the delete operations were successful. ## Creating a Table of Profiles to Delete from a Real-time Parent Segment You can create a table of profiles to delete from the real-time parent segment either manually in the [TD Console](/products/customer-data-platform/data-workbench/databases/creating-or-viewing-tables) or by using the [TD Toolbelt](/products/customer-data-platform/data-workbench/databases/creating-or-viewing-tables#using-td-toolbelt). When using a query to create the table, query the database that was used to create the real-time segment you want to delete from. ## Creating the Workflow to Delete Profiles from a Real-time Parent Segment After you have created a table of profiles to delete from your real-time parent segment, create a workflow that will call the profile deletion API. You can create the workflow using either the [TD console](/products/customer-data-platform/data-workbench/workflows/getting-started-with-treasure-workflow) or the [TD Toolbelt](/products/customer-data-platform/data-workbench/workflows/getting-started-with-treasure-workflow#using-td-toolbelt). After creating the workflow, here is an example of how to configure it. ```yaml +create_rt_profile_delete_internal_db: td_ddl>: create_databases: [rt_profile_delete_internal_container] database: rt_profile_delete_internal_container ### ### RT PROFILE DELETE INTERNAL ### +rt_profile_delete_profile: td>: database: rt_profile_delete_internal_container query: | SELECT key || ':' || value FROM profiles_to_be_deleted; result_url: | { "type": "rest", "method": "POST", "authorization": "${secret:td.apikey}", "endpoint": "${reactor_importer_endpoint}/internal/bulk-delete-internal", "headers": "{\"x-reactor-instance-name\": \"${reactor_instance}\"}", "parallelism": ${parallelism}, "page_size": ${page_size} } ``` In the example above note the following: * On the FROM line you specify the table you created that contains the profiles you want to delete * On the "endpoint" line specify the endpoint of the region where your real-time data is stored. After you have configured the workflow, run it to delete the profiles. ### Real-time Parent Segment Delete Endpoints The profile deletion API cannot be called directly. It must be specified in the workflow configuration you create to delete profiles from a real-time segment. Here are the region-specific endpoints to include in the workflow configuration. | Region | Endpoint | | --- | --- | | US (aws) | [https://bulk-storage-importer-api-production-aws-us-east-1.internal.treasuredata.com](https://bulk-storage-importer-api-production-aws-us-east-1.internal.treasuredata.com/) | | Japan (aws-tokyo) | [https://bulk-storage-importer-api-production-aws-tokyo-ap-northeast-1.internal.treasuredata.com](https://bulk-storage-importer-api-production-aws-tokyo-ap-northeast-1.internal.treasuredata.com/) | | Europe (eu01) | [https://bulk-storage-importer-api-production-eu01-eu-central-1.internal.treasuredata.com](https://bulk-storage-importer-api-production-eu01-eu-central-1.internal.treasuredata.com/) | | Asia-Pacific (ap03) | [https://bulk-storage-importer-api-production-ap03-ap-northeast-1.internal.treasuredata.com](https://bulk-storage-importer-api-production-ap03-ap-northeast-1.internal.treasuredata.com/) | ## Consulting the Audit Log to Confirm Profile Deletion from Real-time Parent Segment After you have successfully run the workflow, you can consult the Premium Audit logs to determine if the profiles contained in your table were deleted.