1{
2  "version":"2.0",
3  "metadata":{
4    "apiVersion":"2018-05-22",
5    "endpointPrefix":"personalize-runtime",
6    "jsonVersion":"1.1",
7    "protocol":"rest-json",
8    "serviceFullName":"Amazon Personalize Runtime",
9    "serviceId":"Personalize Runtime",
10    "signatureVersion":"v4",
11    "signingName":"personalize",
12    "uid":"personalize-runtime-2018-05-22"
13  },
14  "operations":{
15    "GetActionRecommendations":{
16      "name":"GetActionRecommendations",
17      "http":{
18        "method":"POST",
19        "requestUri":"/action-recommendations"
20      },
21      "input":{"shape":"GetActionRecommendationsRequest"},
22      "output":{"shape":"GetActionRecommendationsResponse"},
23      "errors":[
24        {"shape":"InvalidInputException"},
25        {"shape":"ResourceNotFoundException"}
26      ],
27      "documentation":"<p>Returns a list of recommended actions in sorted in descending order by prediction score. Use the <code>GetActionRecommendations</code> API if you have a custom campaign that deploys a solution version trained with a PERSONALIZED_ACTIONS recipe. </p> <p>For more information about PERSONALIZED_ACTIONS recipes, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/nexts-best-action-recipes.html\">PERSONALIZED_ACTIONS recipes</a>. For more information about getting action recommendations, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/get-action-recommendations.html\">Getting action recommendations</a>.</p>",
28      "idempotent":true
29    },
30    "GetPersonalizedRanking":{
31      "name":"GetPersonalizedRanking",
32      "http":{
33        "method":"POST",
34        "requestUri":"/personalize-ranking"
35      },
36      "input":{"shape":"GetPersonalizedRankingRequest"},
37      "output":{"shape":"GetPersonalizedRankingResponse"},
38      "errors":[
39        {"shape":"InvalidInputException"},
40        {"shape":"ResourceNotFoundException"}
41      ],
42      "documentation":"<p>Re-ranks a list of recommended items for the given user. The first item in the list is deemed the most likely item to be of interest to the user.</p> <note> <p>The solution backing the campaign must have been created using a recipe of type PERSONALIZED_RANKING.</p> </note>",
43      "idempotent":true
44    },
45    "GetRecommendations":{
46      "name":"GetRecommendations",
47      "http":{
48        "method":"POST",
49        "requestUri":"/recommendations"
50      },
51      "input":{"shape":"GetRecommendationsRequest"},
52      "output":{"shape":"GetRecommendationsResponse"},
53      "errors":[
54        {"shape":"InvalidInputException"},
55        {"shape":"ResourceNotFoundException"}
56      ],
57      "documentation":"<p>Returns a list of recommended items. For campaigns, the campaign's Amazon Resource Name (ARN) is required and the required user and item input depends on the recipe type used to create the solution backing the campaign as follows:</p> <ul> <li> <p>USER_PERSONALIZATION - <code>userId</code> required, <code>itemId</code> not used</p> </li> <li> <p>RELATED_ITEMS - <code>itemId</code> required, <code>userId</code> not used</p> </li> </ul> <note> <p>Campaigns that are backed by a solution created using a recipe of type PERSONALIZED_RANKING use the API.</p> </note> <p> For recommenders, the recommender's ARN is required and the required item and user input depends on the use case (domain-based recipe) backing the recommender. For information on use case requirements see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/domain-use-cases.html\">Choosing recommender use cases</a>. </p>",
58      "idempotent":true
59    }
60  },
61  "shapes":{
62    "ActionID":{
63      "type":"string",
64      "max":256
65    },
66    "ActionList":{
67      "type":"list",
68      "member":{"shape":"PredictedAction"}
69    },
70    "Arn":{
71      "type":"string",
72      "max":256,
73      "pattern":"arn:([a-z\\d-]+):personalize:.*:.*:.+"
74    },
75    "AttributeName":{
76      "type":"string",
77      "max":150,
78      "pattern":"[A-Za-z\\d_]+"
79    },
80    "AttributeValue":{
81      "type":"string",
82      "max":1000,
83      "sensitive":true
84    },
85    "ColumnName":{
86      "type":"string",
87      "max":150
88    },
89    "ColumnNamesList":{
90      "type":"list",
91      "member":{"shape":"ColumnName"},
92      "max":99
93    },
94    "ColumnValue":{
95      "type":"string",
96      "max":20000
97    },
98    "Context":{
99      "type":"map",
100      "key":{"shape":"AttributeName"},
101      "value":{"shape":"AttributeValue"},
102      "max":150
103    },
104    "DatasetType":{
105      "type":"string",
106      "max":256
107    },
108    "ErrorMessage":{"type":"string"},
109    "FilterAttributeName":{
110      "type":"string",
111      "max":50,
112      "pattern":"[A-Za-z0-9_]+"
113    },
114    "FilterAttributeValue":{
115      "type":"string",
116      "max":1000,
117      "sensitive":true
118    },
119    "FilterValues":{
120      "type":"map",
121      "key":{"shape":"FilterAttributeName"},
122      "value":{"shape":"FilterAttributeValue"},
123      "max":25
124    },
125    "GetActionRecommendationsRequest":{
126      "type":"structure",
127      "members":{
128        "campaignArn":{
129          "shape":"Arn",
130          "documentation":"<p>The Amazon Resource Name (ARN) of the campaign to use for getting action recommendations. This campaign must deploy a solution version trained with a PERSONALIZED_ACTIONS recipe.</p>"
131        },
132        "userId":{
133          "shape":"UserID",
134          "documentation":"<p>The user ID of the user to provide action recommendations for.</p>"
135        },
136        "numResults":{
137          "shape":"NumResults",
138          "documentation":"<p>The number of results to return. The default is 5. The maximum is 100.</p>"
139        },
140        "filterArn":{
141          "shape":"Arn",
142          "documentation":"<p>The ARN of the filter to apply to the returned recommendations. For more information, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/filter.html\">Filtering Recommendations</a>.</p> <p>When using this parameter, be sure the filter resource is <code>ACTIVE</code>.</p>"
143        },
144        "filterValues":{
145          "shape":"FilterValues",
146          "documentation":"<p>The values to use when filtering recommendations. For each placeholder parameter in your filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma. </p> <p>For filter expressions that use an <code>INCLUDE</code> element to include actions, you must provide values for all parameters that are defined in the expression. For filters with expressions that use an <code>EXCLUDE</code> element to exclude actions, you can omit the <code>filter-values</code>. In this case, Amazon Personalize doesn't use that portion of the expression to filter recommendations.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/filter.html\">Filtering recommendations and user segments</a>.</p>"
147        }
148      }
149    },
150    "GetActionRecommendationsResponse":{
151      "type":"structure",
152      "members":{
153        "actionList":{
154          "shape":"ActionList",
155          "documentation":"<p>A list of action recommendations sorted in descending order by prediction score. There can be a maximum of 100 actions in the list. For information about action scores, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/how-action-recommendation-scoring-works.html\">How action recommendation scoring works</a>.</p>"
156        },
157        "recommendationId":{
158          "shape":"RecommendationID",
159          "documentation":"<p>The ID of the recommendation.</p>"
160        }
161      }
162    },
163    "GetPersonalizedRankingRequest":{
164      "type":"structure",
165      "required":[
166        "campaignArn",
167        "inputList",
168        "userId"
169      ],
170      "members":{
171        "campaignArn":{
172          "shape":"Arn",
173          "documentation":"<p>The Amazon Resource Name (ARN) of the campaign to use for generating the personalized ranking.</p>"
174        },
175        "inputList":{
176          "shape":"InputList",
177          "documentation":"<p>A list of items (by <code>itemId</code>) to rank. If an item was not included in the training dataset, the item is appended to the end of the reranked list. If you are including metadata in recommendations, the maximum is 50. Otherwise, the maximum is 500.</p>"
178        },
179        "userId":{
180          "shape":"UserID",
181          "documentation":"<p>The user for which you want the campaign to provide a personalized ranking.</p>"
182        },
183        "context":{
184          "shape":"Context",
185          "documentation":"<p>The contextual metadata to use when getting recommendations. Contextual metadata includes any interaction information that might be relevant when getting a user's recommendations, such as the user's current location or device type.</p>"
186        },
187        "filterArn":{
188          "shape":"Arn",
189          "documentation":"<p>The Amazon Resource Name (ARN) of a filter you created to include items or exclude items from recommendations for a given user. For more information, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/filter.html\">Filtering Recommendations</a>.</p>"
190        },
191        "filterValues":{
192          "shape":"FilterValues",
193          "documentation":"<p>The values to use when filtering recommendations. For each placeholder parameter in your filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma. </p> <p>For filter expressions that use an <code>INCLUDE</code> element to include items, you must provide values for all parameters that are defined in the expression. For filters with expressions that use an <code>EXCLUDE</code> element to exclude items, you can omit the <code>filter-values</code>.In this case, Amazon Personalize doesn't use that portion of the expression to filter recommendations.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/filter.html\">Filtering Recommendations</a>.</p>"
194        },
195        "metadataColumns":{
196          "shape":"MetadataColumns",
197          "documentation":"<p>If you enabled metadata in recommendations when you created or updated the campaign, specify metadata columns from your Items dataset to include in the personalized ranking. The map key is <code>ITEMS</code> and the value is a list of column names from your Items dataset. The maximum number of columns you can provide is 10.</p> <p> For information about enabling metadata for a campaign, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html#create-campaign-return-metadata\">Enabling metadata in recommendations for a campaign</a>. </p>"
198        }
199      }
200    },
201    "GetPersonalizedRankingResponse":{
202      "type":"structure",
203      "members":{
204        "personalizedRanking":{
205          "shape":"ItemList",
206          "documentation":"<p>A list of items in order of most likely interest to the user. The maximum is 500.</p>"
207        },
208        "recommendationId":{
209          "shape":"RecommendationID",
210          "documentation":"<p>The ID of the recommendation.</p>"
211        }
212      }
213    },
214    "GetRecommendationsRequest":{
215      "type":"structure",
216      "members":{
217        "campaignArn":{
218          "shape":"Arn",
219          "documentation":"<p>The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.</p>"
220        },
221        "itemId":{
222          "shape":"ItemID",
223          "documentation":"<p>The item ID to provide recommendations for.</p> <p>Required for <code>RELATED_ITEMS</code> recipe type.</p>"
224        },
225        "userId":{
226          "shape":"UserID",
227          "documentation":"<p>The user ID to provide recommendations for.</p> <p>Required for <code>USER_PERSONALIZATION</code> recipe type.</p>"
228        },
229        "numResults":{
230          "shape":"NumResults",
231          "documentation":"<p>The number of results to return. The default is 25. If you are including metadata in recommendations, the maximum is 50. Otherwise, the maximum is 500.</p>"
232        },
233        "context":{
234          "shape":"Context",
235          "documentation":"<p>The contextual metadata to use when getting recommendations. Contextual metadata includes any interaction information that might be relevant when getting a user's recommendations, such as the user's current location or device type.</p>"
236        },
237        "filterArn":{
238          "shape":"Arn",
239          "documentation":"<p>The ARN of the filter to apply to the returned recommendations. For more information, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/filter.html\">Filtering Recommendations</a>.</p> <p>When using this parameter, be sure the filter resource is <code>ACTIVE</code>.</p>"
240        },
241        "filterValues":{
242          "shape":"FilterValues",
243          "documentation":"<p>The values to use when filtering recommendations. For each placeholder parameter in your filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma. </p> <p>For filter expressions that use an <code>INCLUDE</code> element to include items, you must provide values for all parameters that are defined in the expression. For filters with expressions that use an <code>EXCLUDE</code> element to exclude items, you can omit the <code>filter-values</code>.In this case, Amazon Personalize doesn't use that portion of the expression to filter recommendations.</p> <p>For more information, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/filter.html\">Filtering recommendations and user segments</a>.</p>"
244        },
245        "recommenderArn":{
246          "shape":"Arn",
247          "documentation":"<p>The Amazon Resource Name (ARN) of the recommender to use to get recommendations. Provide a recommender ARN if you created a Domain dataset group with a recommender for a domain use case.</p>"
248        },
249        "promotions":{
250          "shape":"PromotionList",
251          "documentation":"<p>The promotions to apply to the recommendation request. A promotion defines additional business rules that apply to a configurable subset of recommended items.</p>"
252        },
253        "metadataColumns":{
254          "shape":"MetadataColumns",
255          "documentation":"<p>If you enabled metadata in recommendations when you created or updated the campaign or recommender, specify the metadata columns from your Items dataset to include in item recommendations. The map key is <code>ITEMS</code> and the value is a list of column names from your Items dataset. The maximum number of columns you can provide is 10.</p> <p> For information about enabling metadata for a campaign, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html#create-campaign-return-metadata\">Enabling metadata in recommendations for a campaign</a>. For information about enabling metadata for a recommender, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/creating-recommenders.html#create-recommender-return-metadata\">Enabling metadata in recommendations for a recommender</a>. </p>"
256        }
257      }
258    },
259    "GetRecommendationsResponse":{
260      "type":"structure",
261      "members":{
262        "itemList":{
263          "shape":"ItemList",
264          "documentation":"<p>A list of recommendations sorted in descending order by prediction score. There can be a maximum of 500 items in the list.</p>"
265        },
266        "recommendationId":{
267          "shape":"RecommendationID",
268          "documentation":"<p>The ID of the recommendation.</p>"
269        }
270      }
271    },
272    "InputList":{
273      "type":"list",
274      "member":{"shape":"ItemID"}
275    },
276    "InvalidInputException":{
277      "type":"structure",
278      "members":{
279        "message":{"shape":"ErrorMessage"}
280      },
281      "documentation":"<p>Provide a valid value for the field or parameter.</p>",
282      "error":{"httpStatusCode":400},
283      "exception":true
284    },
285    "ItemID":{
286      "type":"string",
287      "max":256
288    },
289    "ItemList":{
290      "type":"list",
291      "member":{"shape":"PredictedItem"}
292    },
293    "Metadata":{
294      "type":"map",
295      "key":{"shape":"ColumnName"},
296      "value":{"shape":"ColumnValue"}
297    },
298    "MetadataColumns":{
299      "type":"map",
300      "key":{"shape":"DatasetType"},
301      "value":{"shape":"ColumnNamesList"},
302      "max":1
303    },
304    "Name":{
305      "type":"string",
306      "max":63,
307      "min":1,
308      "pattern":"^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"
309    },
310    "NumResults":{
311      "type":"integer",
312      "min":0
313    },
314    "PercentPromotedItems":{
315      "type":"integer",
316      "max":100,
317      "min":1
318    },
319    "PredictedAction":{
320      "type":"structure",
321      "members":{
322        "actionId":{
323          "shape":"ActionID",
324          "documentation":"<p>The ID of the recommended action.</p>"
325        },
326        "score":{
327          "shape":"Score",
328          "documentation":"<p>The score of the recommended action. For information about action scores, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/how-action-recommendation-scoring-works.html\">How action recommendation scoring works</a>.</p>"
329        }
330      },
331      "documentation":"<p>An object that identifies an action.</p> <p>The API returns a list of <code>PredictedAction</code>s.</p>"
332    },
333    "PredictedItem":{
334      "type":"structure",
335      "members":{
336        "itemId":{
337          "shape":"ItemID",
338          "documentation":"<p>The recommended item ID.</p>"
339        },
340        "score":{
341          "shape":"Score",
342          "documentation":"<p>A numeric representation of the model's certainty that the item will be the next user selection. For more information on scoring logic, see <a>how-scores-work</a>.</p>"
343        },
344        "promotionName":{
345          "shape":"Name",
346          "documentation":"<p>The name of the promotion that included the predicted item.</p>"
347        },
348        "metadata":{
349          "shape":"Metadata",
350          "documentation":"<p>Metadata about the item from your Items dataset.</p>"
351        }
352      },
353      "documentation":"<p>An object that identifies an item.</p> <p>The and APIs return a list of <code>PredictedItem</code>s.</p>"
354    },
355    "Promotion":{
356      "type":"structure",
357      "members":{
358        "name":{
359          "shape":"Name",
360          "documentation":"<p>The name of the promotion.</p>"
361        },
362        "percentPromotedItems":{
363          "shape":"PercentPromotedItems",
364          "documentation":"<p>The percentage of recommended items to apply the promotion to.</p>"
365        },
366        "filterArn":{
367          "shape":"Arn",
368          "documentation":"<p>The Amazon Resource Name (ARN) of the filter used by the promotion. This filter defines the criteria for promoted items. For more information, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/promoting-items.html#promotion-filters\">Promotion filters</a>.</p>"
369        },
370        "filterValues":{
371          "shape":"FilterValues",
372          "documentation":"<p>The values to use when promoting items. For each placeholder parameter in your promotion's filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma. </p> <p>For filter expressions that use an <code>INCLUDE</code> element to include items, you must provide values for all parameters that are defined in the expression. For filters with expressions that use an <code>EXCLUDE</code> element to exclude items, you can omit the <code>filter-values</code>. In this case, Amazon Personalize doesn't use that portion of the expression to filter recommendations.</p> <p>For more information on creating filters, see <a href=\"https://docs.aws.amazon.com/personalize/latest/dg/filter.html\">Filtering recommendations and user segments</a>.</p>"
373        }
374      },
375      "documentation":"<p>Contains information on a promotion. A promotion defines additional business rules that apply to a configurable subset of recommended items.</p>"
376    },
377    "PromotionList":{
378      "type":"list",
379      "member":{"shape":"Promotion"},
380      "max":1
381    },
382    "RecommendationID":{"type":"string"},
383    "ResourceNotFoundException":{
384      "type":"structure",
385      "members":{
386        "message":{"shape":"ErrorMessage"}
387      },
388      "documentation":"<p>The specified resource does not exist.</p>",
389      "error":{"httpStatusCode":404},
390      "exception":true
391    },
392    "Score":{"type":"double"},
393    "UserID":{
394      "type":"string",
395      "max":256
396    }
397  },
398  "documentation":"<p/>"
399}
400