> ## 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.

# ユーザー属性を設定する

> Notiflyでユーザー属性を登録、更新します。登録した属性はセグメントの設定やメッセージのパーソナライズに使えます。

> [!NOTE]
>
> 氏名や住所など保護が必要なカスタムユーザー属性を送信する前に、コンソールで**ユーザー管理 > ユーザー一覧 > 属性管理**を開きます。送信するキーと同じ名前で属性を登録し、暗号化を有効にしてください。
>
> 設定手順と利用上の制約は[ユーザー属性を管理する](https://docs.notifly.tech/ja/user-guide/users/properties.md)を参照してください。

> [!NOTE]
>
> 複数のユーザーを一括で更新するには、同じ形式のユーザーオブジェクトを配列で送信します。1回のリクエストにつき最大1,000人です。


## OpenAPI

````yaml /ja/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サーバー
security: []
tags:
  - name: catalog
    x-group: カタログ
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: >-
                    Notiflyが発行するプロジェクトIDです。**設定 > 製品とプロジェクト情報 >
                    プロジェクト情報**で確認できます。
                userProperties:
                  type: object
                  description: >-
                    キーと値の組で指定するユーザー属性です。予約済みのキーには、メールアドレスの`$email`、電話番号の`$phone_number`、LINEユーザーIDの`$line_user_id`があります。
                userId:
                  type: string
                  description: ユーザー識別子です。
            example:
              projectId: example_project_1234567890abcdef
              userId: user_abc123
      responses:
        '200':
          description: ユーザー属性を更新しました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: integer
                    description: 更新した行数です。
              example:
                data: 3
        '400':
          description: リクエスト本文の形式が不正です。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientErrorResponse'
        '401':
          description: トークンが無効か期限切れのため、認証に失敗しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientErrorResponse'
        '413':
          description: リクエストの件数が1回あたりの上限である1,000人を超えています。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientErrorResponse'
        '500':
          description: サーバー内部エラーです。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ClientErrorResponse:
      type: object
      properties:
        data:
          type: string
          nullable: true
          description: エラー時はnullです。
          example: null
        error:
          type: string
          description: エラーメッセージ
          example: Invalid Authorization Token
    ErrorResponse:
      type: object
      properties:
        data:
          type: string
          nullable: true
          description: エラー時はnullです。
          example: null
        error:
          type: string
          description: エラーメッセージ
        projectId:
          type: string
          nullable: true
          description: プロジェクトIDです。500エラーの場合のみ含まれます。
          example: null
        durationMs:
          type: integer
          nullable: true
          description: 処理時間です。単位はmsで、500エラーの場合のみ含まれます。
          example: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '`POST /authenticate`で発行したトークンをBearer形式で送信します。'

````

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