Skip to main content

suggestCategoryCode

Requires permission categories:category:create.

Suggests an unused category code for a category name: the name upper-cased with punctuation dropped and spaces turned into underscores, numbered (_2, _3…) when an active category in your organization already uses it. Only a suggestion — creating the category still refuses a code that is taken. Requires permission to create categories.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query SuggestCategoryCode($name: String!) {
suggestCategoryCode(name: $name)
}

Variables:

{
"name": "string"
}

Response:

{
"data": {
"suggestCategoryCode": "string"
}
}
suggestCategoryCode(
name: String!
): String!

Arguments​

suggestCategoryCode.name ● String! non-null scalar​

The category name to build the code from.

Type​

String scalar​

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.