Create a wordlist
POST/v1/wordlistsKey scope write
Creates an empty wordlist. Add terms with POST /v1/wordlists/{id}/terms; the list scores nothing until a template enables its policy, wordlist/<slug>, in the dashboard.
Needs a key with the write scope. Authentication
Request body
namestringRequiredA name for the list, 1 to 200 characters.
slugstringThe slug used in the policy key
wordlist/<slug>: 2 to 80 lowercase letters, digits and single hyphens. Default: derived from the name, with a number added when it is taken. It cannot be changed later.descriptionstringA note on what the list is for, up to 2,000 characters.
modeenumWhat a match means.
block(default): a matched term is a violation and scores 0.85, plus 0.05 for each further match, up to 1.require: the violation is that no term matched, which scores 1.collect: matches are reported and the score stays 0; a match still fires the policy's trigger and counts as 0.85 towards severity unless the template enables the wordlist in observe mode.One of
blockrequirecollectmatch_presetenumHow close a word must be to a single-word term to match, as a similarity from 0 to 1 (1 minus the edit distance divided by the length of the longer word):
exact1.0,same_word0.9 (default),similar0.75,nearest0.6. Text and terms are normalised first, so case, lookalike characters and digit-for-letter substitutions do not matter. A term with a space is matched as an exact phrase whatever the preset.One of
exactsame_wordsimilarnearestlanguagestringA language code of up to 8 characters, for your own reference. It does not change matching.
enabledbooleanWhether the list is matched. A disabled list scores 0 on the templates that enable it. Default true.
Returns
The new wordlist, with status 201.
- 201 CreatedA wordlist object
Errors
- 403
plan_limitThe organisation's plan includes no wordlists, or the project already has as many as the plan allows.
- 409
slug_takenThe project already has a wordlist with this slug.
- 422
validation_errornameis missing, empty or too long,slugis not a valid slug,modeormatch_presetis not one of the listed values, or the body has an unknown key.
Every endpoint can also answer the errors any request can meet: a missing key, a rate limit, a malformed body. Errors
Something missing or unclear on this page? Write to support@useinfrared.com.