createTaxonomyTerm
mutation should be used.
If a parent should be set, an appropriate term can be found with getTaxonomyTermByName
query
Note: vocabulary will not be created with an API, it should be created on the site manually.
- The API user context should have permission to create a taxonomy term in the given vocabulary. Otherwise, access denied response will be returned.
- The given vocabulary should exist on the site.
- If parent ID is not 0, a term with this ID should exist.
termData
that is the object with the following properties:
Argument | Type | Description | Default |
---|---|---|---|
vocabulary | String | Required. Represents a machine name of the taxonomy vocabulary to create a term. | — |
name | String | Required. A name (label) of the taxonomy term that should be created. | — |
parentId | ID | The parent term ID. By default the term will be created without a parent, as a first-level item. | 0 |

