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.
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
| Option | What it does | Example |
|---|---|---|
| Name | How you recognise the key in the list. The API returns it as key_name. | AI Weekly — shop sync |
| Access | View 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. |
| Expires | The 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 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 answers403, 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.