> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifly.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Set user properties

> Create or update user properties in Notifly. Use the properties to define audiences and personalize messages.

> [!NOTE]
>
> Before sending a custom user property that needs protection, such as a name or address, open **User Management > User List > Property management** in the console. Register the property with the same key you will send and enable encryption.
>
> See [Manage user properties](https://docs.notifly.tech/en/user-guide/users/properties.md) for setup and limitations.

> [!NOTE]
>
> To update multiple users at once, send an array of user objects with the same structure. Each request accepts up to 1,000 users.


## OpenAPI

````yaml /en/api-reference/openapi.yaml post /set-user-properties
openapi: 3.0.3
info:
  title: Notifly API
  version: 1.0.0
  contact:
    email: contact@notifly.tech
servers:
  - url: https://api.notifly.tech
    description: Notifly API server
security: []
tags:
  - name: catalog
    x-group: Catalogs
paths:
  /set-user-properties:
    post:
      summary: set-user-properties
      operationId: setUserProperties
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - projectId
                - userProperties
                - userId
              properties:
                projectId:
                  type: string
                  description: >-
                    The project ID assigned by Notifly. Find it under **Settings
                    > Product & Project > Project Info**.
                userProperties:
                  type: object
                  description: >-
                    User properties as key-value pairs. Reserved keys include
                    `$email` for email, `$phone_number` for phone number, and
                    `$line_user_id` for LINE user ID.
                userId:
                  type: string
                  description: User identifier.
            example:
              projectId: example_project_1234567890abcdef
              userId: user_abc123
      responses:
        '200':
          description: The user properties were updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: integer
                    description: Number of rows updated.
              example:
                data: 3
        '400':
          description: The request body format is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientErrorResponse'
        '401':
          description: Authentication failed because the token is invalid or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientErrorResponse'
        '413':
          description: The request exceeds the batch size limit of 1,000 users.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ClientErrorResponse:
      type: object
      properties:
        data:
          type: string
          nullable: true
          description: null on error.
          example: null
        error:
          type: string
          description: Error message
          example: Invalid Authorization Token
    ErrorResponse:
      type: object
      properties:
        data:
          type: string
          nullable: true
          description: null on error.
          example: null
        error:
          type: string
          description: Error message
        projectId:
          type: string
          nullable: true
          description: Project ID, included only for 500 errors.
          example: null
        durationMs:
          type: integer
          nullable: true
          description: Processing time in ms, included only for 500 errors.
          example: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Pass the token issued by `POST /authenticate` as a bearer token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.