Skip to content

Issue Key

POST /cdp/keys — issue a new vyg_ API key for a brand.

POST /cdp/keys
Content-Type: application/json
FieldTypeRequiredDescription
brand_idstringstaff onlyTarget brand. Staff may specify any brand; for a non-staff brand-admin the target is always their own brand and a different brand_id is rejected 403.
expires_atstring | numbernoOptional expiry — an ISO-8601 string or epoch milliseconds. Omit for no expiry.
{
"id": "key_abc",
"key_prefix": "vyg_AbCd",
"brand_id": "brand-uuid",
"is_staff": false,
"expires_at": null,
"revoked_at": null,
"created_at": "2026-01-15T00:00:00.000Z",
"api_key": "vyg_AbCd…full-plaintext…"
}
FieldTypeDescription
idstringThe key record id.
key_prefixstringDisplay-safe prefix (shown again on list).
brand_idstringThe owning brand.
is_staffbooleanWhether the key was issued under a staff context.
expires_atstring | nullExpiry timestamp, or null.
revoked_atstring | nullRevocation timestamp, or null.
created_atstring | nullCreation timestamp.
api_keystringThe plaintext key — returned exactly once. Never returned again; store it immediately.
Terminal window
curl -s -X POST "https://cdp.vyg.app/cdp/keys" \
-H "Authorization: Bearer <session-credential>" \
-H "Content-Type: application/json" \
-d '{ "expires_at": "2027-01-01T00:00:00Z" }'
StatusWhen
400brand_id required for a staff operation but omitted, or an invalid expires_at.
401Missing or invalid credential.
403An API key was used for management; a non-staff caller targeted another brand; or no connected Shopify integration resolves a scope for the brand.
405Unsupported method.
500Brand-scope resolution failed.

See Errors for the full envelope.