Create Custom Criteria
To create custom criteria using the Create Custom Criteria API, the syntax is:
POST https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom
Only proceed with the following steps after you have read the warning above and are comfortable creating new custom criteria that cannot subsequently be deleted from the UI.
-
Verify
TENANT_ID
andAPI_KEY
for Create custom criteria reference the Postman environment variables established earlier. Use the image below for comparison. -
Add your Body as raw JSON that defines the location of your custom criteria CSV file. Use the example provided in the Create Custom Criteria API documentation as a template, supplying your
environmentId
and other values as necessary. For this example, we use LAST_PURCHASED as the key. -
Send the request and observe the response, which contains the details of the custom criteria you just created.
-
To verify your custom criteria has been created, navigate within Adobe Target to Recommendations > Criteria and search for your criteria by name, or use the List Custom Criteria API in the next step.
In this case, we have an error. Let’s investigate the error by examining the custom criteria more closely, using the List Custom Criteria API.
List Custom Criteria
To retrieve a list of all your custom criteria along with details for each, use the List Custom Criteria API. The syntax is:
GET https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom
- Verify
TENANT_ID
andAPI_KEY
as before, and send the request. In the response, note the custom criteria ID, as well as details regarding the error message noted earlier.
In this case, the error occurred because the server information is incorrect, meaning Target is unable to access the CSV file containing the custom criteria definition. Let’s edit the custom criteria to correct this.
Edit Custom Criteria
To change the details of a custom criteria definition, use the Edit Custom Criteria API. The syntax is:
POST https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom/:criteriaId
-
Verify
TENANT_ID
andAPI_KEY
, as before.
-
Specify the criteria ID of the (single) custom criteria you would like to edit.
-
In the Body, supply updated JSON with the correct server information. (For this step, specify FTP access to a server you can access.)
-
Send the request and note the response.
Let’s verify the success of the updated custom criteria, using the Get Custom Criteria API.
Get Custom Criteria
To view custom criteria details for a specific custom criteria, use the Get Custom Criteria API. The syntax is:
GET https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom/:criteriaId
- Specify the criteria ID of the custom criteria whose details you would like to get. Send the request, and review the response.
- Verify success. (In our case, verify there are no further FTP errors.)
- (Optional) Verify the update reflects accurately in the UI.
Delete Custom Criteria
Using the criteria ID noted earlier, delete your custom criteria, using the Delete Custom Criteria API. The syntax is:
DELETE https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom/:criteriaId
-
Specify the criteria ID of the (single) custom criteria you would like to delete. Click Send.
-
Verify the criteria has been deleted using Get Custom Criteria.
In this case, the expected 404 error indicates the deleted criteria cannot be found.
Congratulations! You are now able to create, list, edit, delete, and get details on custom criteria, using the Recommendations API. In the next section, you will use the Target Delivery API to retrieve recommendations.
Personalization & Experiementation Excellence with Recommendations and AI
Adobe Customer Success Webinars
Tuesday, Mar 4, 4:00 PM UTC
Adobe Target innovations, including GenAI, and best practices on AI-powered personalization and experimentation at scale.
RegisterAdobe Target at Summit
Register for these developer sessions:
- Put the Customer at the Center and Build Relationships That Last a Lifetime (attend online)
- Get Inspired and Scale Faster with Generative Experiments
- B2B Transformation Series: "No Limits" Digital Marketing at GE HealthCare
- How to Scale and Transform Your Organization to Omnichannel Communications
- Do it Best Leverages the Adobe Platform to Drive Growth for Independents
Connect with Experience League at Summit!
Get front-row access to top sessions, hands-on activities, and networking—wherever you are!
Learn more