Consumer Authentication

/

API reference

/

M2M Authentication

/

Rotate secret

/

Rotate secret

Rotate M2M Client Secret

POSThttps://test.stytch.com/v1/m2m/clients/{client_id}/secrets/rotate

Complete the rotation of an M2M client secret started with the Start Secret Rotation Endpoint. After this endpoint is called, the client's next_client_secret becomes its client_secret and the previous client_secret will no longer be valid.


Path parameters


client_id*string

Response fields


status_codeint

request_idstring

m2m_clientobject
curl --request POST \
	--url https://test.stytch.com/v1/m2m/clients/m2m-client-test-d731954d-dab3-4a2b-bdee-07f3ad1be885/secrets/rotate \
	-u 'PROJECT_ID:SECRET'

RESPONSE

200
{
    "status_code": 200,
    "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
    "m2m_client": {
        "client_id":"m2m-client-test-d731954d-dab3-4a2b-bdee-07f3ad1be885",
        "client_name":"Example client name",
        "client_description":"Example client description.",
        "client_secret_last_four":"DzJj",
        "next_client_secret_last_four":null,
        "status":"active",
        "scopes":["read:users","write:users"],
        "trusted_metadata":{}
    }
}