API ReferenceApi keys
Rotate an API key's secret
POST
Replace the key's secret in place, keeping its id, name and scopes. The PREVIOUS secret stops authenticating immediately — there is no overlap window — so anything still using it starts failing on its next request. As with creation, the new secret is not returned: the response carries lastFour and a one-time revealUrl. A revoked key cannot be rotated (400 KEY_REVOKED).
Requires the api-keys:write scope — Create, rotate, and revoke API keys — these keep working even after you disconnect this app.
cookie
better-auth.session_token<token>BetterAuth session cookie. Used by the dashboard / browser clients. When present, the active project is taken from the x-project-id header.
id*stringProject id.
keyId*stringAPI key id.
API key rotated; the new secret is behind the reveal link.
application/json- response
success*trueValue in
truedata*curl -X POST 'https://api.sendly.now/api/projects/string/api-keys/string/rotate'Example Response
{ "success": true, "data": { "lastFour": "string", "revealUrl": "http://example.com", "revealExpiresAt": "2019-08-24T14:15:22Z" }}