Skip to Content
StoreOSv0.27.1
Core GraphQL APIReferenceMutations

Identity__create Api Key

Creates a scoped public API key. rawKey is returned once. Requires a signed-in staff user. Needs the `identity__Tenant` `update` permission. Send the `x-tenant` header (the gateway sets it from your API key).

MUTATIONidentity__createApiKey(input: CreateApiKeyInput!): CreateApiKeyPayload!

Creates a scoped public API key. rawKey is returned once. Requires a signed-in staff user. Needs the identity__Tenant update permission. Send the x-tenant header (the gateway sets it from your API key).

Arguments

input*

Returns

  1. identity__createApiKey
createdAt*String!
id*String!
keyPrefix*String!
lastUsedAt?String
name*String!
rawKey*String!
revokedAt?String
scopes*[String!]!
status*ApiKeyStatus!
Value inactiverevoked
tenantUid*String!
Example Request
mutation Identity__createApiKey($input: CreateApiKeyInput!) {  identity__createApiKey(input: $input) {    createdAt    id    keyPrefix    lastUsedAt    name    rawKey    revokedAt    scopes  }}
Variables
{  "input": {    "name": "string",    "scopes": [      "string"    ]  }}
Example Response
{  "data": {    "identity__createApiKey": {      "createdAt": "string",      "id": "string",      "keyPrefix": "string",      "lastUsedAt": "string",      "name": "string",      "rawKey": "string",      "revokedAt": "string",      "scopes": [        "string"      ]    }  }}