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

# Update the schema of a specified custom object.

> オブジェクトタイプIDまたは完全修飾名を使用して、プロパティーやラベルなどのカスタムオブジェクトスキーマの属性を更新します。

export const ScopesList = ({scopes = [], description = "この API には、次のいずれかのスコープが必要です。"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

export const SupportedProducts = ({marketing, sales, service, cms, marketingLevel, salesLevel, serviceLevel, cmsLevel}) => {
  const translations = {
    header: "サポートされる製品",
    description: "次のいずれかの製品またはそれ以上が必要です。",
    productNames: {
      marketing: "Marketing Hub",
      sales: "Sales Hub",
      service: "Service Hub",
      cms: "Content Hub"
    },
    tiers: {
      free: "無料ツール",
      starter: "Starter",
      professional: "Professional",
      enterprise: "Enterprise"
    }
  };
  const translateTier = tier => {
    if (!tier) return '';
    const lowerTier = tier.toLowerCase();
    return translations.tiers[lowerTier] || tier;
  };
  const products = [{
    name: marketing ? translations.productNames.marketing : '',
    level: translateTier(marketingLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/marketing-bolt.svg",
    alt: "Marketing Hub"
  }, {
    name: sales ? translations.productNames.sales : '',
    level: translateTier(salesLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/sales-star.svg",
    alt: "Sales Hub"
  }, {
    name: service ? translations.productNames.service : '',
    level: translateTier(serviceLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/service-heart.svg",
    alt: "Service Hub"
  }, {
    name: cms ? translations.productNames.cms : '',
    level: translateTier(cmsLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/content-play.svg",
    alt: "Content Hub"
  }].filter(product => product.name && product.level);
  if (products.length === 0) return null;
  return <div>
      <div className="text-sm mb-2">{translations.description}</div>
      <div className={`grid ${products.length === 1 ? 'grid-cols-1' : 'grid-cols-2'} gap-1.5`}>
        {products.map((product, index) => <div key={index} style={{
    display: 'flex',
    alignItems: 'center'
  }}>
            <img src={product.icon} alt={product.alt} className="w-3.5 h-3.5 mr-1.5 mt-2.5 mb-2.5 flex-shrink-0 align-middle" />
            <span className="font-medium mr-1 text-sm">{product.name} -</span>
            <span className="text-sm">{product.level}</span>
          </div>)}
      </div>
    </div>;
};

<AccordionGroup>
  <Accordion title="Supported products" defaultOpen="true" icon="cubes">
    <SupportedProducts marketing={true} sales={true} service={true} cms={true} marketingLevel="ENTERPRISE" salesLevel="ENTERPRISE" serviceLevel="ENTERPRISE" cmsLevel="ENTERPRISE" />
  </Accordion>

  <Accordion title="Required Scopes" icon="key">
    <ScopesList
      scopes={[
  'crm.schemas.custom.write'
]}
    />
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml specs/legacy/v3/crm-schemas-v3.json PATCH /crm-object-schemas/v3/schemas/{objectType}
openapi: 3.0.1
info:
  title: スキーマ
  description: >-
    The CRM uses schemas to define how custom objects should store and represent
    information in the HubSpot CRM. Schemas define details about an object's
    type, properties, and associations. The schema can be uniquely identified by
    its **object type ID**.
  version: v3
  x-hubspot-product-tier-requirements:
    marketing: ENTERPRISE
    sales: ENTERPRISE
    service: ENTERPRISE
    cms: ENTERPRISE
    commerce: ENTERPRISE
    crmHub: ENTERPRISE
    dataHub: ENTERPRISE
  x-hubspot-api-use-case: >-
    車の販売代理店の自動車に関する情報を格納する新規オブジェクトを作成します。オブジェクト定義には、情報を格納するプロパティーを含めることも、カスタムオブジェクトのインデックスページで使用可能なフィルターを含めることもできます。
  x-hubspot-related-documentation:
    - name: Custom Object Guide
      url: >-
        https://developers.hubspot.com/docs/guides/api/crm/objects/custom-objects
  x-hubspot-introduction: >-
    カスタム オブジェクト
    スキーマAPIを使用して、アカウント内でCRMレコードの新しいタイプを定義します。オブジェクトスキーマの設定後に、HubSpotでもオブジェクトAPIを使用した場合でも、カスタマイズそのオブジェクトにレコードを作成できるようになります。
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Advanced
  - name: Basic
  - name: Batch
paths:
  /crm-object-schemas/v3/schemas/{objectType}:
    patch:
      tags:
        - Basic
      summary: 指定されたカスタムオブジェクトのスキーマを更新します。
      description: オブジェクトタイプIDまたは完全修飾名を使用して、プロパティーやラベルなどのカスタムオブジェクトスキーマの属性を更新します。
      operationId: patch-/crm-object-schemas/v3/schemas/{objectType}_update
      parameters:
        - name: objectType
          in: path
          description: スキーマの完全修飾名またはオブジェクトタイプID。
          required: true
          style: simple
          explode: false
          schema:
            type: string
      requestBody:
        description: Attributes to update in your schema.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ObjectTypeDefinitionPatch'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectTypeDefinition'
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - crm.schemas.custom.write
components:
  schemas:
    ObjectTypeDefinitionPatch:
      type: object
      properties:
        allowsSensitiveProperties:
          type: boolean
          description: オブジェクトタイプにセンシティブとされたプロパティーを含めることができるかどうかを決定します。
        clearDescription:
          type: boolean
          description: オブジェクトタイプの説明をクリアするかどうかを示します。
        description:
          type: string
          description: オブジェクトタイプの簡単な説明。
        labels:
          $ref: '#/components/schemas/ObjectTypeDefinitionLabels'
        primaryDisplayProperty:
          type: string
          description: このオブジェクトのプライマリープロパティーの名前。このオブジェクトタイプのHubSpotレコードページにプライマリーとして表示されます。
        requiredProperties:
          type: array
          description: このタイプのオブジェクトを作成する際に「必須」となるプロパティーの名前。
          items:
            type: string
        restorable:
          type: boolean
          description: オブジェクトタイプを削除後に復元できるかどうかを指定します。
        searchableProperties:
          type: array
          description: HubSpotの製品検索でこのオブジェクトタイプについてインデックスされるプロパティーの名前。
          items:
            type: string
        secondaryDisplayProperties:
          type: array
          description: このオブジェクトのセカンダリープロパティーの名前。このオブジェクトタイプのHubSpotレコードページにセカンダリーとして表示されます。
          items:
            type: string
      description: Defines attributes to update on an object type.
      example:
        primaryDisplayProperty: my_object_property
        requiredProperties:
          - my_object_property
        searchableProperties:
          - my_object_property
    ObjectTypeDefinition:
      required:
        - id
        - labels
        - name
        - requiredProperties
      type: object
      properties:
        allowsSensitiveProperties:
          type: boolean
          description: オブジェクトタイプでセンシティブデータが含まれるプロパティーが許可されるかどうかを示します。
        archived:
          type: boolean
          description: オブジェクトタイプがアーカイブ済みかどうかを示します。
        createdAt:
          type: string
          description: オブジェクトタイプが作成された日時。
          format: date-time
        description:
          type: string
          description: オブジェクトタイプの説明。
        fullyQualifiedName:
          type: string
          description: ポータルIDやオブジェクト名を含む、オブジェクトの割り当てられた固有ID。
        id:
          type: string
          description: このオブジェクトタイプの固有ID。{meta-type}-{unique ID}として定義されます。
        labels:
          $ref: '#/components/schemas/ObjectTypeDefinitionLabels'
        name:
          type: string
          description: このオブジェクトの重複しない名前。内部使用のみ。
        objectTypeId:
          type: string
          description: オブジェクトタイプの固有ID。
        portalId:
          type: integer
          description: このオブジェクトタイプが固有であるアカウントのID。
          format: int32
        primaryDisplayProperty:
          type: string
          description: このオブジェクトのプライマリープロパティーの名前。このオブジェクトタイプのHubSpotレコードページにプライマリーとして表示されます。
        requiredProperties:
          type: array
          description: このタイプのオブジェクトを作成する際に「必須」となるプロパティーの名前。
          items:
            type: string
        searchableProperties:
          type: array
          description: HubSpotの製品検索でこのオブジェクトタイプについてインデックスされるプロパティーの名前。
          items:
            type: string
        secondaryDisplayProperties:
          type: array
          description: このオブジェクトのセカンダリープロパティーの名前。このオブジェクトタイプのHubSpotレコードページにセカンダリーとして表示されます。
          items:
            type: string
        updatedAt:
          type: string
          description: オブジェクトタイプが最後に更新された日時。
          format: date-time
      description: Defines an object type.
      example:
        createdAt: '2020-02-20T18:07:11.390Z'
        id: '123456'
        labels:
          plural: My objects
          singular: My object
        metaType: PORTAL_SPECIFIC
        name: my_object
        portalId: 12345678
        primaryDisplayProperty: my_object_property
        requiredProperties:
          - my_object_property
        searchableProperties:
          - my_object_property
        updatedAt: '2020-02-21T14:13:28.818002Z'
    ObjectTypeDefinitionLabels:
      type: object
      properties:
        plural:
          type: string
          description: 複数のオブジェクトに関する単語（後から変更できません）。
        singular:
          type: string
          description: 1件のオブジェクトに関する単語（後から変更できません）。
      description: Singular and plural labels for the object. Used in CRM display.
      example:
        plural: My objects
        singular: My object
    Error:
      required:
        - category
        - correlationId
        - message
      type: object
      properties:
        category:
          type: string
          description: エラーカテゴリー
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: エラー条件に関する背景状況
          example: >-
            {invalidPropertyName=[propertyValue], missingScopes=[scope1,
            scope2]}
        correlationId:
          type: string
          description: リクエストの固有ID。エラー報告またはサポートチケットには必ずこの値を含めてください
          format: uuid
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
        errors:
          type: array
          description: エラーに関する詳細情報
          items:
            $ref: '#/components/schemas/ErrorDetail'
        links:
          type: object
          additionalProperties:
            type: string
          description: エラーまたは推奨の修正手順に関するドキュメントが含まれる関連付けられたURIへのリンク名の対応付け
        message:
          type: string
          description: エラーと修正手順（該当する場合）を記した、人が理解できるメッセージ
          example: An error occurred
        subCategory:
          type: string
          description: エラーに関する具体的な詳細が含まれる特定のカテゴリー
      example:
        message: Invalid input (details will vary based on the error)
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        category: VALIDATION_ERROR
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
    ErrorDetail:
      required:
        - message
      type: object
      properties:
        code:
          type: string
          description: エラーの詳細に関連付けられているステータスコード
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: エラー条件に関する背景状況
          example: '{missingScopes=[scope1, scope2]}'
        in:
          type: string
          description: エラーが見つかったフィールドまたはパラメーターの名前。
        message:
          type: string
          description: エラーと修正手順（該当する場合）を記した、人が理解できるメッセージ
        subCategory:
          type: string
          description: エラーに関する具体的な詳細が含まれる特定のカテゴリー
  responses:
    Error:
      description: An error occurred.
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          tokenUrl: https://api.hubapi.com/oauth/v1/token
          scopes:
            crm.objects.custom.highly_sensitive.read.v2: ''
            crm.objects.custom.read: ''
            crm.objects.custom.sensitive.read.v2: ''
            crm.schemas.custom.read: ''
            crm.schemas.custom.write: ''
            oauth: ''

````