Create API key
Creates a new API key for the current user
Authorizations
First-party Gumnut app session (Clerk session JWT). Only the Gumnut web and mobile apps can obtain one — API keys and OAuth tokens cannot manage credentials, so these operations are not callable with the credentials this API otherwise accepts.
Body
Create a key with an explicit action/library scope.
The scope fields are required: a request must state both which actions
the key may perform and which libraries it covers; omitting either is a
422, never a silent full-access grant. Full access is still expressible,
but only explicitly: actions=[read, write, delete, delete_permanently]
plus library_scope_mode=all_libraries.
Descriptive name identifying this API key
255Action verbs the key may perform (at least one). read is required whenever any broader action is selected. Pass all four actions for a full-access key.
Actions a credential may perform.
read views resources; write creates or changes them; delete trashes
photos or libraries and destructively removes organizational records and
associations such as albums, people, faces, and memberships;
delete_permanently irreversibly deletes photos or libraries.
read, write, delete, delete_permanently Which libraries the key covers: all_libraries (all current and future libraries) or selected_libraries.
all_libraries, selected_libraries Libraries the key covers. Required (at least one) when library_scope_mode is selected_libraries; not allowed otherwise. Up to 200 ids.
200Response
Successful Response
Response when creating a new API key - includes the actual key value.
This is the only time the raw API key is exposed. After creation, only the hashed version is stored and the raw key cannot be retrieved.
Unique API key identifier with 'apikey_' prefix
When this API key was created
Whether this API key is currently valid and can be used
The actual API key value - store this securely as it cannot be retrieved later
Optional descriptive name for this API key
When this API key was last used for authentication
Action verbs this key's grant allows; null for legacy keys
Actions a credential may perform.
read views resources; write creates or changes them; delete trashes
photos or libraries and destructively removes organizational records and
associations such as albums, people, faces, and memberships;
delete_permanently irreversibly deletes photos or libraries.
read, write, delete, delete_permanently 'all_libraries' or 'selected_libraries'; null for legacy keys
all_libraries, selected_libraries Number of libraries a 'selected_libraries' grant covers; null unless library_scope_mode is 'selected_libraries'