---
title: "Sets a single custom user property by email. If value is null or not provided, the property will be set to an empty string."
method: POST
path: "/v1/users/set-custom-property"
tags: ["users"]
---

# Sets a single custom user property by email. If value is null or not provided, the property will be set to an empty string.

`POST /v1/users/set-custom-property`

## Request

- Base URL: `https://api.memberspot.de` (the document declares no server; this is the origin it was published from)
- URL: `https://api.memberspot.de/v1/users/set-custom-property`
- Auth: API key in header `X-API-KEY`

## Request body

- SetSingleCustomPropertyDto
  - `email` string, email, required: User email
  - `key` string, required: The key/id of the custom property to set or remove
  - `value` string, nullable: The value to set for the custom property. If null or not provided, the property will be set to an empty string.

## Response `201`

Returns updated user with all custom properties. <br>
     If user does not exist, a bad request exception will be thrown. <br>
     If the property does not exist in the school, a bad request exception will be thrown. <br>
     If the value is invalid for the property type, a bad request exception will be thrown.

- User
  - `uid` string, required: User identifier
  - `email` string, required: User email
  - `created` string, date-time, required: Date user was created
  - `firstname` string, required: Users firstname
  - `name` string, required: Users lastname
  - `progress` UserCourseProgress[]: Course progress of the user. Only populated when the request filters by courseId (then it contains that single course); an empty array otherwise.
    - `activePosts` number: Number of lessons that count towards the course progress of this user (published lessons in accessible chapters)
    - `completedPosts` number: Number of completed lessons of this user in the course
    - `grantedAt` string, date-time: Date the course was first granted to the user. Revoking and re-granting access keeps this date; check "active" for the current access state.
    - `startDate` string, date-time: Date from which course access and drip scheduling are anchored for the user. Derived from the offer launch date or set by an admin, so it can be before or after grantedAt.
    - `updatedAt` string, date-time: Date the course assignment was last written. It changes whenever progress, access state, chapter access or start date change, and can also move when the access of the user is re-evaluated without a visible change. An unchanged value therefore guarantees unchanged data; a newer value does not guarantee a difference. Omitted for assignments that have not been written since the field was introduced.
    - `courseId` string, required
    - `scormProgress` object
  - `active` boolean: Is user active
  - `customUserProperties` object: Custom user properties key value pairs

## Other responses

- `400`: Missing arguments (check your api key)
- `401`: Api key provided but invalid
- `429`: Too many requests - only 4 requests per second allowed

---

[API](https://skmtc.dev/memberspot/apis/memberspot-api.md) · [All operations](https://skmtc.dev/memberspot/apis/memberspot-api/llms.txt) · [OpenAPI document](https://skmtc.dev/memberspot/apis/memberspot-api/revisions/48a9411d4339?raw)
