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

# カタログアイテムを作成する

> URLで指定した`itemId`を使って、アイテムを1件作成します。



## OpenAPI

````yaml /ja/api-reference/openapi.yaml post /v1/projects/{projectId}/catalogs/{catalogName}/items/{itemId}
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:
  /v1/projects/{projectId}/catalogs/{catalogName}/items/{itemId}:
    parameters:
      - $ref: '#/components/parameters/ProjectId'
      - name: catalogName
        in: path
        description: カタログの作成時に指定した一意の名前です。
        required: true
        schema:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          maxLength: 250
      - name: itemId
        in: path
        description: カタログ内でアイテムを識別する一意のIDです。
        required: true
        schema:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          maxLength: 250
    post:
      tags:
        - catalog
      summary: create-api-catalog-item
      description: URLで指定した`itemId`を使って、アイテムを1件作成します。
      operationId: createApiCatalogItem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CatalogSingleItemWriteRequest'
      responses:
        '201':
          description: 作成しました。
          headers:
            Location:
              description: 作成されたカタログアイテムのパスです。
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogItemResponse'
        '400':
          $ref: '#/components/responses/CatalogBadRequest'
        '401':
          $ref: '#/components/responses/CatalogUnauthenticated'
        '403':
          $ref: '#/components/responses/CatalogPermissionDenied'
        '404':
          $ref: '#/components/responses/CatalogNotFound'
        '409':
          $ref: '#/components/responses/CatalogConflict'
        '413':
          $ref: '#/components/responses/CatalogPayloadTooLarge'
        '500':
          $ref: '#/components/responses/CatalogInternalServerError'
      security:
        - bearerAuth: []
components:
  parameters:
    ProjectId:
      name: projectId
      in: path
      description: NotiflyのプロジェクトIDです。
      required: true
      schema:
        type: string
        pattern: ^[a-f0-9]{32}$
        minLength: 32
        maxLength: 32
  schemas:
    CatalogSingleItemWriteRequest:
      type: object
      additionalProperties: false
      required:
        - items
      properties:
        items:
          type: array
          minItems: 1
          maxItems: 1
          items:
            type: object
            not:
              required:
                - id
            additionalProperties:
              $ref: '#/components/schemas/CatalogJsonValue'
      example:
        items:
          - name: 에브리데이 백팩
            price: 59000
            tags:
              - bag
              - new
    CatalogItemResponse:
      type: object
      required:
        - data
        - error
      properties:
        data:
          $ref: '#/components/schemas/CatalogItem'
        error:
          nullable: true
          enum:
            - null
      example:
        data:
          id: sku-001
          name: 에브리데이 백팩
          price: 59000
          tags:
            - bag
            - new
        error: null
    CatalogJsonValue:
      description: >-
        カタログアイテムのフィールドに保存できる再帰的なJSON値です。文字列は最大5,000文字、配列は最大100要素、オブジェクトと配列のネストは最大50階層です。
      oneOf:
        - type: string
          maxLength: 5000
        - type: number
        - type: boolean
        - nullable: true
          enum:
            - null
        - type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/CatalogJsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/CatalogJsonValue'
          description: >-
            保存するオブジェクトのキーにはピリオドやドル記号を使用できません。`$add`と`$remove`は、配列フィールドを`PATCH`する演算子として使用できます。
    CatalogItem:
      type: object
      description: >-
        利用者が管理するカタログアイテムです。Notiflyは値を分類したりマスキングしたりせず、保存したまま返します。氏名、メールアドレス、電話番号、外部ユーザーID、プロフィール項目など、個人を特定できる値は保存しないでください。
      required:
        - id
      properties:
        id:
          type: string
          pattern: ^[A-Za-z0-9_-]+$
          maxLength: 250
      additionalProperties:
        $ref: '#/components/schemas/CatalogJsonValue'
    CatalogApiErrorResponse:
      type: object
      required:
        - data
        - error
      properties:
        data:
          nullable: true
          enum:
            - null
        error:
          $ref: '#/components/schemas/CatalogApiError'
      example:
        data: null
        error:
          code: INVALID_ARGUMENT
          message: Invalid bulk item request.
          details:
            - field: items[0].unknown_field
              path:
                - items
                - 0
                - unknown_field
              code: invalid-fields
              message: 'Unrecognized field: unknown_field.'
    CatalogApiError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: array
          description: 入力検証に失敗したフィールドとパスを示します。クライアント側では、この構造化された情報を参照してください。
          items:
            $ref: '#/components/schemas/CatalogApiValidationErrorDetail'
      additionalProperties: true
    CatalogApiValidationErrorDetail:
      type: object
      description: 入力検証エラー1件分の情報です。`field`はドットと角括弧で表したフィールドパスです。`path`は同じ位置を文字列と数値の配列で表します。
      required:
        - field
        - path
        - code
        - message
      properties:
        field:
          type: string
          description: ドットと角括弧で表したフィールドのパスです。例は`items[0].price`です。
        path:
          type: array
          description: フィールドのパスを文字列と数値の要素に分けた配列です。
          items:
            anyOf:
              - type: string
              - type: integer
        code:
          type: string
          description: 入力が拒否された理由を示すコードです。
        message:
          type: string
          description: 入力検証エラーの内容を示すメッセージです。
      additionalProperties: false
  responses:
    CatalogBadRequest:
      description: Catalog APIへのリクエストが不正です。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CatalogApiErrorResponse'
    CatalogUnauthenticated:
      description: 認証が必要です。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CatalogApiErrorResponse'
    CatalogPermissionDenied:
      description: プロジェクトへのアクセス権限がありません。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CatalogApiErrorResponse'
    CatalogNotFound:
      description: 指定したカタログリソースが見つかりません。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CatalogApiErrorResponse'
    CatalogConflict:
      description: カタログリソースはすでに存在します。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CatalogApiErrorResponse'
    CatalogPayloadTooLarge:
      description: JSON本文が4 MiBを超えています。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CatalogApiErrorResponse'
    CatalogInternalServerError:
      description: サーバー内部エラーです。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CatalogApiErrorResponse'
  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.