Skip to main content

Set user fields

POST 

/api/v1/user-fields

Sets lead generation field data for a given user, a puzzle, and a given series. If a field already exists for this user and puzzle, its value is overwritten.

What are user fields? User fields correspond to the lead generation fields configured in the series settings. When lead generation is enabled for a series, up to 3 custom fields of information can be collected from players — such as name, email address, or phone number. These fields are configured with labels and input types (text, numbers, or email) in the series settings, and are represented in the API as field_1, field_2, and field_3.

Fields: Fields use keys field_1, field_2, and field_3. The label and validation type for each field are defined in the series settings under Lead Generation. For example, a series might configure field_1 as "Participant Name" (text), field_2 as "Email Address" (email format), and field_3 as "Phone Number" (numbers only).

Request Body: The fields object contains only the fields to set. Fields not included in the request are left untouched.

Response: A success response with status: 0. The response does not echo back the saved fields.

Examples:

Set user fields for a puzzle:

curl -X POST 'https://sandbox.amuselabs.com/pmm/api/v1/user-fields?series=demo-crossword&userId=9f7439e7-ecf1-4c03-ba90-91273f149231&puzzleId=daily-2024-01-15' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"fields": {"field_1": "Jane Doe", "field_2": "jane@example.com"}}'

Request

Responses

Fields set successfully.