Consumer Authentication

/

API reference

/

M2M Authentication

/

M2M Client

/

Update M2M client

Update M2M Client

PUThttps://test.stytch.com/v1/m2m/clients/{client_id}

Updates an existing M2M Client. You can use this endpoint to activate or deactivate a M2M Client by changing its status. A deactivated M2M Client will not be allowed to perform future token exchange flows until it is reactivated.

Important: Deactivating a M2M Client will not invalidate any existing JWTs issued to the client, only prevent it from receiving new ones. To protect more-sensitive routes, pass a lower max_token_age value when authenticating the token.


Path parameters


client_id*string

Body parameters


client_namestring

client_descriptionstring

scopesarray[strings]

statusstring

trusted_metadataobject

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 \
	-u 'PROJECT_ID:SECRET' \
	-H 'Content-Type: application/json' \
	-d '{
		"client_description": "A new client description"
	}'

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":{}
    }
}

Common Error Types