An API key lets your own code read members and grant or revoke access. Each key belongs to the administrator who made it and works only on the SmartMembers API.

SmartMembers Settings, Connections, API keys on the AI Weekly site, listing AI Weekly — shop sync (View and make changes, expires Dec 31, 2027) and AI Weekly — reporting (View only, last used just now), each with Edit and Revoke
Every administrator's keys on this site, newest first, with what each may do and when it was last used.

Pro: API keys need SmartMembers Pro. Without an active licence, existing keys keep working but no new key can be created.

Create a key

Open the API keys screen

Go to SmartMembers → Settings → Connections → API keys and click Create API key.

Name it and choose what it may do

The Create API key dialog filled in with the name AI Weekly — shop sync, View and make changes selected and an expiry of 31 December 2027
A key for the shop that sells AI Weekly — Reader, valid until the end of 2027.
OptionWhat it doesExample
NameHow you recognise the key in the list. The API returns it as key_name.AI Weekly — shop sync
AccessView only reads members and groups. View and make changes also grants, revokes and pauses access.A reporting script gets View only; the shop gets View and make changes.
ExpiresThe key stops working at the end of that day. Empty means it never expires.31 December 2027

Click Create API key.

Copy the key

The new key AI Weekly — shop sync, with the warning Shown once. Copy it now., a Key field starting smk_ and a Test it field holding a curl command, each with a Copy button
The key is shown once. Store it where your code keeps its secrets.

The key starts smk_ and can't be shown again. Lost it? Revoke it and create another.

Test it

Copy Test it and run it in a terminal. It calls /me and answers with your site and the key's name and access.

Use the key

Send it in the Authorization header of every request:

curl -H "Authorization: Bearer smk_…" \
  https://aiweekly.example/wp-json/cl-smartmembers/api/v1/members?access_group=15

Every route, its fields and its errors are in the API reference.

Edit, revoke and expiry

  • Edit changes the name, access or expiry. An expired key gets a new date here and works again.
  • Revoke deletes the key. Anything using it stops working at once.

What a key can and cannot reach

  • It works only under /wp-json/cl-smartmembers/api/v1. Any other WordPress route answers 403, and XML-RPC refuses it.
  • It acts as the administrator who made it. If that person stops being an administrator, or is removed from the site, their keys are revoked.
  • A key is a WordPress application password, so deleting it under Users → Profile → Application Passwords revokes it too.

Warning: Deactivating or deleting SmartMembers Pro deletes every API key. Reactivating does not bring them back.

If the screen shows a warning

This site cannot create API keys. WordPress only allows application passwords over HTTPS, and a plugin or your host may have turned them off. Serve the site over HTTPS, or remove whatever turns them off.

Your host removes the Authorization header, so no API key can sign in. Keys can be created but every request is refused. See Fix a stripped Authorization header.

Related articles