Produktly docs
UsersUserid

Create or replace an identified user

PUT
/users/{userId}

Server-side equivalent of identifyUser() with replace semantics: creates the user if it doesn't exist (201), otherwise replaces its entire metadata object (200). Prefer PATCH for scheduled syncs so you don't clobber attributes set client-side.

Authorization

BearerAuth
AuthorizationBearer <token>

Use an API key from the Produktly dashboard → Settings → API keys.

In: header

Path Parameters

userId*string

The user's external ID — the same value you pass to window.Produktly.identifyUser(). URL-encode it.

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/users/string" \  -H "Content-Type: application/json" \  -d '{    "metadata": {      "plan": "pro",      "seats": 12,      "role": "admin"    }  }'
{  "userId": "user_123",  "metadata": {    "plan": "pro",    "seats": 12  },  "createdAt": "2026-07-01T09:00:00.000Z",  "updatedAt": "2026-07-15T09:00:00.000Z"}