Optimizely Promotions API
The Promotions API from Optimizely — 12 operation(s) for promotions.
Operations 16
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Ask an LLM
“Which promotions are set up in the commerce admin?”
“Can I filter the promotions list to only live ones?”
Tell an agent
List all promotions.
Find promotions matching {filter}.
Ask an LLM
“How do I set up a new promotion with a promo code?”
“What's required to add a promotion, like name, display message and code?”
Tell an agent
Create promotion {name} with promo code {promoCode} and message {displayMessage}.
Add a promotion {name} that activates on {activateOn}.
GET
/api/v1/admin/Promotions({id})
Get a promotion · Returns the entity with the key from Promotions
#
Ask an LLM
“Can I pull up one promotion's details by its ID?”
“What are the activation dates and code for a particular promotion?”
Tell an agent
Show promotion {id}.
Get promotion {id} with {expand} expanded.
Ask an LLM
“How do I overwrite a promotion record completely?”
“Does a full replace of a promotion need the name, code and description again?”
Tell an agent
Replace promotion {id} with a full record named {name}.
Overwrite promotion {id} entirely using promo code {promoCode}.
Ask an LLM
“How do I permanently delete one promotion?”
“Can a promotion delete be guarded by an ETag check?”
Tell an agent destructive · confirm first
Delete promotion {id}.
Delete promotion {id} if its ETag is {etag}.
PATCH
/api/v1/admin/Promotions({id})
Update fields on a promotion · Update entity in EntitySet Promotions
#
Ask an LLM
“Can I change just the deactivation date of a promotion?”
“Is it possible to toggle a promotion live without resending everything?”
Tell an agent
Set promotion {id} to deactivate on {deactivateOn}.
Mark promotion {id} live status as {isLive}.
GET
/api/v1/admin/Promotions/Default.Default()
Get default values for a new promotion · Call operation Default
#
Ask an LLM
“What defaults does a newly created promotion start with?”
“Is there a blank promotion template to prefill a form?”
Tell an agent
Get the default promotion template.
Show prefilled defaults for a new promotion.
POST
/api/v1/admin/Promotions/Default.archive
Archive promotions via OData action · Call operation archive
#
Ask an LLM
“Can I archive a batch of promotions with the OData archive action?”
“How do I retire promotions without deleting them, using a POST call?”
Tell an agent
Archive promotions {ids} using the Default.archive action.
Run the archive action on promotions {ids}.
POST
/api/v1/admin/Promotions({id})/Default.results
Set results on a promotion via OData action · Call operation results
#
Ask an LLM
“How do I define what a promotion awards, like a discount result, through the OData action?”
“Can I post promotion results to a promotion by its ID?”
Tell an agent
Set the results of promotion {id} to {promotionResults} using the Default.results action.
Post promotion results for promotion {id} through the OData action.
POST
/api/v1/admin/promotions({key})/results
Set results on a promotion via route · Promotions set results by key
#
Ask an LLM
“Is there a plain /results route to set a promotion's results by key?”
“Can I update what a promotion awards using the key-based results path?”
Tell an agent
Set results for promotion {key} through the /results route.
Post to the results path of promotion {key}.
Ask an LLM
“Can I archive promotions with a DELETE to the archive route?”
“Which call archives several promotions by ID using the archive path?”
Tell an agent destructive · confirm first
Archive promotions {ids} through the /archive route.
Send promotions {ids} to archive with the DELETE archive endpoint.
Ask an LLM
“Can I permanently delete several promotions at once?”
“How do I bulk remove promotions by listing IDs?”
Tell an agent destructive · confirm first
Bulk delete promotions {ids}.
Permanently remove the promotions with IDs {ids}.
GET
/api/v1/admin/promotions({key})/customerorderpromotions({customerorderpromotionKey})
Get an order where a promotion was applied · Promotions get customer order promotion by key and customerorderpromotionkey
#
Ask an LLM
“Can I see a specific customer order application of a promotion?”
“Which order record shows a promotion being used?”
Tell an agent
Show order application {orderPromotion} of promotion {key}.
Get customer order promotion {orderPromotion} under promotion {key}.
GET
/api/v1/admin/promotions({key})/customproperties({custompropertyKey})
Get a custom property on a promotion · Promotions get custom property by key and custompropertykey
#
Ask an LLM
“Can I read a custom property stored on a promotion?”
“Where do extra custom fields for a promotion live?”
Tell an agent
Show custom property {property} on promotion {key}.
Get promotion {key}'s custom field {property}.
GET
/api/v1/admin/promotions({key})/promotionresults({promotionresultKey})
Get a result of a promotion · Promotions get promotion result by key and promotionresultkey
#
Ask an LLM
“What does a particular result of a promotion award?”
“Can I look up a single promotion result record?”
Tell an agent
Show result {result} of promotion {key}.
Get promotion result {result} for promotion {key}.
GET
/api/v1/admin/promotions({key})/websites({websiteKey})
Get a website a promotion runs on · Promotions get website by key and websitekey
#
Ask an LLM
“Which website is a promotion assigned to?”
“Can I view one website linked to a promotion?”
Tell an agent
Show website {website} linked to promotion {key}.
Get the site {website} where promotion {key} runs.