Dataset expiration endpoint
The /ttl
endpoint in the Data Hygiene API allows you to schedule expiration dates for datasets in Adobe Experience Platform.
A dataset expiration is only a timed-delayed delete operation. The dataset is not protected in the interim, so it may be be deleted by other means before its expiry is reached.
At any time before the dataset-delete is actually initiated, you can cancel the expiration or modify its trigger time. After cancelling a dataset expiration, you can reopen it by setting a new expiry.
Once the dataset deletion is initiated, its expiration job will be marked as executing
, and it may not be further altered. The dataset itself may be recoverable for up to seven days, but only through a manual process initiated through an Adobe service request. As the request executes, the data lake, Identity Service, and Real-Time Customer Profile begin separate processes to remove the dataset’s contents from their respective services. Once the data is deleted from all three services, the expiration is marked as completed
.
Advanced Data Lifecycle Management supports dataset deletions through the dataset expiration endpoint and ID deletions (row-level data) using primary identities via the workorder endpoint. You can also manage dataset expirations and record deletions through the Platform UI. See the linked documentation for more information.
Getting started
The endpoint used in this guide is part of the Data Hygiene API. Before continuing, please review the API guide for information on required headers for CRUD operations, error messages, Postman collections, and how to read sample API calls.
x-sandbox-name: {SANDBOX_NAME}
header.List dataset expirations list
You can list all dataset expirations for your organization by making a GET request. Query parameters can be used to filter the response for appropriate results.
API format
GET /ttl?{QUERY_PARAMETERS}
{QUERY_PARAMETERS}
&
characters. Common parameters include limit
and page
for pagination purposes. For a full list of supported query parameters, refer to the appendix section.Request
curl -X GET \
https://platform.adobe.io/data/core/hygiene/ttl?updatedToDate=2021-08-01&author=LIKE%20%25Jane%20Doe%25 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response lists the resulting dataset expirations. The following example has been truncated for space.
ttlId
in the response is also referred to as the {DATASET_EXPIRATION_ID}
. They both refer to the unique identifier for the dataset expiration.{
"results": [
{
"ttlId": "SD-b16c8b48-a15a-45c8-9215-587ea89369bf",
"datasetId": "629bd9125b31471b2da7645c",
"datasetName": "Sample Acme dataset",
"sandboxName": "hygiene-beta",
"imsOrg": "A2A5*EF06164773A8A49418C@AdobeOrg",
"status": "pending",
"expiry": "2050-01-01T00:00:00Z",
"updatedAt": "2023-06-09T16:52:44.136028Z",
"updatedBy": "Jane Doe <jdoe@adobe.com> 77A51F696282E48C0A494 012@64d18d6361fae88d49412d.e"
}
],
"current_page": 0,
"total_pages": 1,
"total_count": 1
}
total_count
results
Look up a dataset expiration lookup
To lookup a dataset expiration, make a GET request with either the {DATASET_ID}
or the {DATASET_EXPIRATION_ID}
.
{DATASET_EXPIRATION_ID}
is referred to as the ttlId
in the response. They both refer to the unique identifier for the dataset expiration.API format
GET /ttl/{DATASET_ID}?include=history
GET /ttl/{DATASET_EXPIRATION_ID}
{DATASET_ID}
{DATASET_EXPIRATION_ID}
Request
The following request looks up the expiration details for dataset 62759f2ede9e601b63a2ee14
:
curl -X GET \
https://platform.adobe.io/data/core/hygiene/ttl/62759f2ede9e601b63a2ee14 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns the details of the dataset expiration.
{
"ttlId": "SD-c8c75921-2416-4be7-9cfd-9ab01de66c5f",
"datasetId": "62759f2ede9e601b63a2ee14",
"datasetName": "XtVRwq9-38734",
"sandboxName": "prod",
"imsOrg": "A2A5*EF06164773A8A49418C@AdobeOrg",
"status": "pending",
"expiry": "2024-12-31T23:59:59Z",
"updatedAt": "2024-05-11T15:12:40.393115Z",
"updatedBy": "Jane Doe <jdoe@adobe.com> 77A51F696282E48C0A494 012@64d18d6361fae88d49412d.e",
"displayName": "Delete Acme Data before 2025",
"description": "The Acme information in this dataset is licensed for our use through the end of 2024."
}
ttlId
datasetId
datasetName
sandboxName
imsOrg
status
expiry
updatedAt
updatedBy
displayName
description
Catalog expiry tags
When using the Catalog API to look up dataset details, if the dataset has an active expiration it will be listed under tags.adobe/hygiene/ttl
.
The following JSON represents a truncated response for a dataset’s details from Catalog, which an expiration value of 32503680000000
. The tag’s value encodes the expiry as an integer number of milliseconds since the beginning of the Unix epoch.
{
"63212313c308d51b997858ba": {
"name": "Test Dataset",
"description": "A piecrust promise, made to be broken",
"imsOrg": "0FCC747E56F59C747F000101@AdobeOrg",
"sandboxId": "8dc51b90-d0f9-11e9-b164-ed6a398c8b35",
"tags": {
"adobe/hygiene/ttl": [ "32503680000000" ],
...
},
...
}
}
Create a dataset expiration create
To ensure that data is removed from the system after a specified period, schedule an expiration for a specific dataset by providing the dataset ID and the expiry date and time in ISO 8601 format.
To create a dataset expiration, perform a POST request as shown below and provide the values mentioned below within the payload.
API format
POST /ttl
Request
curl -X POST \
https://platform.adobe.io/data/core/hygiene/ttl \
-H `Authorization: Bearer {ACCESS_TOKEN}`
-H `x-gw-ims-org-id: {ORG_ID}`
-H `x-api-key: {API_KEY}`
-H `Accept: application/json`
-d {
"datasetId": "5b020a27e7040801dedbf46e",
"expiry": "2030-12-31T23:59:59Z"
"displayName": "Delete Acme Data before 2025",
"description": "The Acme information in this dataset is licensed for our use through the end of 2024."
}
datasetId
expiry
Required A date and time in ISO 8601 format. If the string has no explicit time zone offset, the time zone is assumed to be UTC. The lifespan of data within the system is set according to the provided expiry value.
Note:
- The request will fail if a dataset expiration already exists for the dataset.
- This date and time must be at least 24 hours in the future.
displayName
description
Response
A successful response returns an HTTP 201 (Created) status and the new state of the dataset expiration.
{
"ttlId": "SD-c8c75921-2416-4be7-9cfd-9ab01de66c5f",
"datasetId": "5b020a27e7040801dedbf46e",
"datasetName": "Acme licensed data",
"sandboxName": "prod",
"imsOrg": "{ORG_ID}",
"status": "pending",
"expiry": "2030-12-31T23:59:59Z",
"updatedAt": "2021-08-19T11:14:16Z",
"updatedBy": "Jane Doe <jdoe@adobe.com> 77A51F696282E48C0A494 012@64d18d6361fae88d49412d.e",
"displayName": "Delete Acme Data before 2031",
"description": "The Acme information in this dataset is licensed for our use through the end of 2030."
}
ttlId
datasetId
datasetName
sandboxName
imsOrg
status
expiry
updatedAt
updatedBy
displayName
description
A 400 (Bad Request) HTTP status occurs if a dataset expiration already exists for the dataset. An unsuccessful response returns a 404 (Not Found) HTTP status if no such dataset expiration exists (or you do not have access to the dataset).
Update a dataset expiration update
To update an expiration date for a dataset, use a PUT request and the ttlId
. You can update the displayName
, description
, and/or expiry
information.
API format
PUT /ttl/{DATASET_EXPIRATION_ID}
{DATASET_EXPIRATION_ID}
ttlId
in the response.Request
The following request reschedules a dataset expiration SD-c8c75921-2416-4be7-9cfd-9ab01de66c5f
to occur at the end of 2024 (Greenwich Mean Time). If the existing dataset expiration is found, that expiration is updated with the new expiry
value.
curl -X PUT \
https://platform.adobe.io/data/core/hygiene/ttl/SD-c8c75921-2416-4be7-9cfd-9ab01de66c5f \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-d '{
"expiry": "2024-12-31T23:59:59Z",
"displayName": "Delete Acme Data before 2025",
"description": "The Acme information in this dataset is licensed for our use through the end of 2024."
}'
expiry
displayName
description
Response
A successful response returns the new state of the dataset expiration and an HTTP status 200 (OK) if a pre-existing expiration was updated.
{
"ttlId": "SD-c8c75921-2416-4be7-9cfd-9ab01de66c5f",
"datasetId": "5b020a27e7040801dedbf46e",
"imsOrg": "A2A5*EF06164773A8A49418C@AdobeOrg",
"status": "pending",
"expiry": "2024-12-31T23:59:59Z",
"updatedAt": "2022-05-09T22:38:40.393115Z",
"updatedBy": "Jane Doe <jdoe@adobe.com> 77A51F696282E48C0A494 012@64d18d6361fae88d49412d.e",
"displayName": "Delete Acme Data before 2025",
"description": "The Acme information in this dataset is licensed for our use through the end of 2024."
}
ttlId
datasetId
imsOrg
status
expiry
updatedAt
updatedBy
An unsuccessful response returns a 404 (Not Found) HTTP status if no such dataset expiration exists.
Cancel a dataset expiration delete
You can cancel a dataset expiration by making a DELETE request.
pending
can be canceled. Attempting to cancel an expiration that has executed or is already canceled returns an HTTP 404 error.API format
DELETE /ttl/{EXPIRATION_ID}
{EXPIRATION_ID}
ttlId
of the dataset expiration that you want to cancel.Request
The following request cancels a dataset expiration with ID SD-b16c8b48-a15a-45c8-9215-587ea89369bf
:
curl -X DELETE \
https://platform.adobe.io/data/core/hygiene/ttl/SD-b16c8b48-a15a-45c8-9215-587ea89369bf \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns HTTP status 204 (No Content), and the expiration’s status
attribute is set to cancelled
.
Appendix
Accepted query parameters query-params
The following table outlines the available query parameters when listing dataset expirations:
description
, displayName
, and datasetName
parameters all contain the ability to searched for by LIKE values. This means that you can find scheduled dataset expirations named: “Name123”, “Name183”, “DisplayName1234” by searching for the string “Name1”.author
author
query parameter to find the person who most recently updated the dataset expiration. If no updates have been made since its creation, this will match the original creator of the expiration. This parameter matches expirations where the created_by
field corresponds to the search string.If the search string begins with
LIKE
or NOT LIKE
, the remainder is treated as an SQL search pattern. Otherwise, the entire search string is treated as a literal string that must exactly match the entire content of a created_by
field.author=LIKE %john%
, author=John Q. Public
datasetId
datasetId=62b3925ff20f8e1b990a7434
datasetName
datasetName=Acme
description
description=Handle expiration of Acme information through the end of 2024.
displayName
displayName=License Expiry
executedDate
/ executedFromDate
/ executedToDate
executedDate=2023-02-05T19:34:40.383615Z
expiryDate
2024-01-01
expiryToDate
/ expiryFromDate
expiryFromDate=2099-01-01&expiryToDate=2100-01-01
limit
limit=50
orderBy
orderBy
query parameter specifies the sorting order of the results returned by the API. Use it to arrange the data based on one or more fields, either in ascending (ASC) or descending (DESC) order. Use the + or - prefix to signify ASC, DESC respectively. The following values are accepted: displayName
, description
, datasetName
, id
, updatedBy
, updatedAt
, expiry
, status
.-datasetName
orgId
x-gw-ims-org-id
headers, and is ignored unless the request supplies a service token.orgId=885737B25DC460C50A49411B@AdobeOrg
page
page=3
sandboxName
x-sandbox-name
header. Use sandboxName=*
to include dataset expirations from all sandboxes.sandboxName=dev1
search
Matches expirations where the specified string is an exact match for the expiration ID, or is contained in any of these fields:
- author
- display name
- description
- display name
- dataset name
search=TESTING
status
status=pending,cancelled
ttlId
ttlID=SD-c8c75921-2416-4be7-9cfd-9ab01de66c5f
updatedDate
2024-01-01
updatedToDate
/ updatedFromDate
An expiration is considered updated on every edit, including when it is created, cancelled, or executed.
updatedDate=2022-01-01