/v1/apps/{app_id}/credentials/{client_id}/rotateAuthRotate M2M client secret
Path parameters
app_id*stringId of the app.
client_id*stringId of the client.
Response · 200 New secret generated and returned ONCE.
client_id*stringThe M2M client id (used as `client_id` in the client-credentials grant).
client_secret*stringNew plaintext client secret. Returned exactly once.
Example
Request
POST https://api.auth.productcraft.co/v1/apps/{app_id}/credentials/{client_id}/rotate
Authorization: Bearer YOUR_TOKENimport { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const m2mRotateSecret = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").credentials.rotate("m2m_a1b2c3d4e5f6");auth.admin.app(…).credentials.rotate(clientId, options?): Auth.M2mRotateSecret
Response
{
"client_id": "string",
"client_secret": "string"
}