Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:expgraphqlkeys

The personal API keys of the GraphQL API: list them, make one for a user (the token is shown once) or revoke one; a dry run unless --apply.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/expgraphqlkeys.md

On this page

exp:expgraphqlkeys

The personal API keys of the GraphQL API: list them, make one for a user (the token is shown once) or revoke one; a dry run unless --apply.

Script bin/php/expgraphqlkeys.php, code in kernel/private/classes/commands/expgraphqlkeys.php. Run it from the installation root, as the user the web server runs as:

./console exp:expgraphqlkeys --help
./console exp:graphql:keys --help
php bin/php/expgraphqlkeys.php --help

Help text

The personal API keys of the GraphQL API
Lists the keys with a scope of the GraphQL API (graphql:read, graphql:write), makes one for a user
(the scopes are checked against the user's policies as on the user's own page; the token is shown
once and never stored), or revokes one. The keys are the kernel's personal API keys (rest.ini
[ApiKeySettings]): the owner manages them on the page API access, an administrator at
oauthadmin/keys. Making and revoking are recorded in the audit (access.apikey.create, .revoke).
Nothing is written without --apply.

./console exp:graphql:keys                                          the list
./console exp:graphql:keys --list --format=json
./console exp:graphql:keys --create --for=frontend --name='Shop front end' --apply
./console exp:graphql:keys --create --for=editor --scope=graphql:read,graphql:write --days=30 --apply
./console exp:graphql:keys --revoke=expk_4f2a9c1d7e3b --apply

Exit code: 0 done (or shown); 1 the key could not be made or revoked; 2 wrong options (an unknown
user or key, a scope the user may not have, a lifetime that is not offered).

Options

OptionValueHelp
--listlist the keys (the default)
--createmake a key (with --for)
--forrequiredthe owner of the new key (a login)
--namerequiredthe name of the new key (default: GraphQL)
--scoperequiredthe scopes of the new key, comma separated: graphql:read (the default), graphql:write
--daysrequiredthe lifetime of the new key in days (rest.ini [ApiKeySettings] ExpiryChoices[]; default 90)
--revokerequiredrevoke the key of this prefix (expk_...) or id
--formatrequiredtext (the default) or json (with --list)
--applywrite; without it nothing is changed

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/expgraphqlkeys.php, kernel/private/classes/commands/expgraphqlkeys.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x