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

# Retrieve 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.read',
  'crm.objects.custom.sensitive.read.v2',
  'crm.objects.custom.read',
  'oauth',
  'crm.objects.custom.highly_sensitive.read.v2'
]}
    />
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml specs/legacy/v3/crm-schemas-v3.json GET /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}:
    get:
      tags:
        - Basic
      summary: 指定されたカスタムオブジェクトのスキーマを取得します。
      description: オブジェクトタイプIDまたは完全修飾名を使用して、プロパティーや関連付けを含めてカスタムオブジェクトスキーマの詳細を取得します。
      operationId: get-/crm-object-schemas/v3/schemas/{objectType}_getById
      parameters:
        - name: objectType
          in: path
          description: スキーマの完全修飾名またはオブジェクトタイプID。
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: includeAssociationDefinitions
          in: query
          description: ''
          required: false
          style: form
          explode: true
          schema:
            type: boolean
            default: true
        - name: includeAuditMetadata
          in: query
          description: ''
          required: false
          style: form
          explode: true
          schema:
            type: boolean
            default: true
        - name: includePropertyDefinitions
          in: query
          description: ''
          required: false
          style: form
          explode: true
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectSchema'
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - crm.schemas.custom.read
        - oauth2:
            - crm.objects.custom.sensitive.read.v2
        - oauth2:
            - crm.objects.custom.highly_sensitive.read.v2
        - oauth2:
            - crm.objects.custom.read
        - oauth2:
            - oauth
components:
  schemas:
    ObjectSchema:
      required:
        - associations
        - id
        - labels
        - name
        - properties
        - requiredProperties
      type: object
      properties:
        allowsSensitiveProperties:
          type: boolean
        archived:
          type: boolean
        associations:
          type: array
          description: 特定のオブジェクトタイプについて定義された関連付け。
          items:
            $ref: '#/components/schemas/AssociationDefinition'
        createdAt:
          type: string
          description: オブジェクトスキーマが作成された日時。
          format: date-time
        createdByUserId:
          type: integer
          format: int32
        description:
          type: string
        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
        primaryDisplayProperty:
          type: string
          description: このオブジェクトのプライマリープロパティーの名前。このオブジェクトタイプのHubSpotレコードページにプライマリーとして表示されます。
        properties:
          type: array
          description: このオブジェクトタイプについて定義されたプロパティー。
          items:
            $ref: '#/components/schemas/Property'
        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
        updatedByUserId:
          type: integer
          format: int32
      description: Defines an object schema, including its properties and associations.
      example:
        associations:
          - fromObjectTypeId: 2-123456
            id: '123'
            name: my_object_to_contact
            toObjectTypeId: 0-1
        createdAt: '2020-02-20T18:07:11.390Z'
        fullyQualifiedName: p7878787_my_object"
        id: '123456'
        labels:
          plural: My objects
          singular: My object
        metaType: PORTAL_SPECIFIC
        name: my_object
        primaryDisplayProperty: my_object_property
        properties:
          - archived: false
            calculated: false
            createdAt: '2020-02-20T18:07:11.802Z'
            displayOrder: -1
            externalOptions: false
            fieldType: text
            groupName: my_object_information
            hasUniqueValue: false
            label: My object property
            name: my_object_property
            type: string
            updatedAt: '2020-02-20T18:07:11.802Z'
        requiredProperties:
          - my_object_property
        searchableProperties:
          - my_object_property
        updatedAt: '2020-02-20T18:09:07.555Z'
    AssociationDefinition:
      required:
        - fromObjectTypeId
        - id
        - toObjectTypeId
      type: object
      properties:
        createdAt:
          type: string
          description: 関連付けが定義された日時。
          format: date-time
        fromObjectTypeId:
          type: string
          description: リンク元のプライマリー オブジェクト タイプのID。
        id:
          type: string
          description: この関連付けの固有ID。
        name:
          type: string
          description: この関連付けの重複しない名前。
        toObjectTypeId:
          type: string
          description: リンク先のターゲット オブジェクト タイプIDのID。
        updatedAt:
          type: string
          description: 関連付けが最後に更新された日時。
          format: date-time
      description: 関連付けの定義
      example:
        fromObjectTypeId: 2-123456
        id: '105'
        name: my_object_to_contact
        toObjectTypeId: 0-1
    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
    Property:
      required:
        - description
        - fieldType
        - groupName
        - label
        - name
        - options
        - type
      type: object
      properties:
        archived:
          type: boolean
          description: プロパティーがアーカイブされているかどうか。
        archivedAt:
          type: string
          description: プロパティーがアーカイブされた日時
          format: date-time
        calculated:
          type: boolean
          description: >-
            デフォルトのプロパティーの場合、trueはプロパティーがHubSpotプロセスによって計算されることを示します。カスタムプロパティーの場合は効果がありません。
        calculationFormula:
          type: string
          description: 計算プロパティーに使用される式。
        createdAt:
          type: string
          description: プロパティーが作成された日時
          format: date-time
        createdUserId:
          type: string
          description: >-
            HubSpotでプロパティーを作成したユーザーの内部ID。プロパティーがHubSpot外で作成された場合、このフィールドは存在しない場合があります。
        currencyPropertyName:
          type: string
          description: 関連する通貨プロパティーの名前。
        dataSensitivity:
          type: string
          description: >-
            「non_sensitive」、「sensitive」、「highly_sensitive」など、プロパティーのセンシティブ（慎重に扱うべき）レベルを示します。
          enum:
            - highly_sensitive
            - non_sensitive
            - sensitive
        dateDisplayHint:
          type: string
          description: >-
            HubSpot
            UIで日付プロパティーを表示する方法を制御します。「absolute」、「absolute_with_relative」、「time_since」、「time_until」などのオプションがあります。
          enum:
            - absolute
            - absolute_with_relative
            - time_since
            - time_until
        description:
          type: string
          description: HubSpotにヘルプテキストとして表示されるプロパティーの説明。
        displayOrder:
          type: integer
          description: >-
            このオブジェクトタイプの他のプロパティーと関連して、HubSpot
            UIにこのプロパティーが表示される順序。プロパティーは最も小さい正の整数値を先頭に表示されます。「-1」という値にすると、そのプロパティーは全ての正の値よりも「後」に表示されます。
          format: int32
        externalOptions:
          type: boolean
          description: デフォルトのプロパティーの場合、trueはオプションがプロパティー設定外に格納されていることを示します。
        fieldType:
          type: string
          description: HubSpotでのプロパティーの表示が制御されます。
        formField:
          type: boolean
          description: HubSpotフォームにプロパティーを使用できるかどうか。
        groupName:
          type: string
          description: プロパティーが含まれているプロパティーグループの名前。
        hasUniqueValue:
          type: boolean
          description: プロパティーの値が固有である必要があるかどうか。設定すると、変更はできません。
        hidden:
          type: boolean
          description: 非表示のオプションはHubSpotに表示されません。
          example: false
        hubspotDefined:
          type: boolean
          description: HubSpotに組み込まれているデフォルトのオブジェクトプロパティーではtrueになります。
        label:
          type: string
          description: HubSpotに表示される、人間が読めるプロパティーラベル。
        modificationMetadata:
          $ref: '#/components/schemas/PropertyModificationMetadata'
        name:
          type: string
          description: このAPIを使用してプロパティーを参照する際に使用する必要がある内部プロパティー名。
        numberDisplayHint:
          type: string
          description: >-
            HubSpotのUIでの数値プロパティーの表示方法と検証方法に関するヒント。「unformatted」、「formatted」、「currency」、「percentage」、「duration」、「probability」のいずれかにできます。
          enum:
            - currency
            - duration
            - formatted
            - percentage
            - probability
            - unformatted
        options:
          type: array
          description: プロパティーに有効なオプションのリスト。このフィールドは列挙型のプロパティーに必要ですが、他のプロパティータイプでは空になります。
          items:
            $ref: '#/components/schemas/Option'
        referencedObjectType:
          type: string
          description: このプロパティーが他のオブジェクトに関連している場合、ここに一覧で表示されます。
        sensitiveDataCategories:
          type: array
          description: sensitiveDataがtrueの場合、プロパティーに含まれるセンシティブデータのタイプを示します（例：「HIPAA」）。
          items:
            type: string
        showCurrencySymbol:
          type: boolean
          description: プロパティーによってアカウント設定で定義された通貨記号が表示されるかどうか。
        textDisplayHint:
          type: string
          description: >-
            HubSpotのUIでのテキストの表示方法と検証方法に関するヒント。「unformatted_single_line」、「multi_line」、「email」、「phone_number」、「domain_name」、「ip_address」、「physical_address」、「postal_code」のいずれかにできます。
          enum:
            - domain_name
            - email
            - ip_address
            - multi_line
            - phone_number
            - physical_address
            - postal_code
            - unformatted_single_line
        type:
          type: string
          description: プロパティーのデータ型。
        updatedAt:
          type: string
          description: オブジェクトタイプが最後に更新された日時。
          format: date-time
        updatedUserId:
          type: string
          description: >-
            HubSpotでプロパティーを更新したユーザーの内部ユーザーID。プロパティーがHubSpot外で更新された場合、このフィールドは存在しない場合があります。
      description: HubSpotプロパティー
      example:
        displayOrder: 2
        fieldType: select
        groupName: my_object_information
        hasUniqueValue: false
        label: My object property
        modificationMetadata:
          archivable: true
          readOnlyDefinition: false
          readOnlyOptions: false
          readOnlyValue: false
        name: my_object_property
        options:
          - description: Choice number one
            displayOrder: 1
            hidden: false
            label: Option A
            value: A
          - description: Choice number two
            displayOrder: 2
            hidden: false
            label: Option B
            value: B
        type: enumeration
    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
    PropertyModificationMetadata:
      required:
        - archivable
        - readOnlyDefinition
        - readOnlyValue
      type: object
      properties:
        archivable:
          type: boolean
          description: プロパティーをアーカイブできるかどうかを示します。
        readOnlyDefinition:
          type: boolean
          description: プロパティーの定義が読み取り専用であるかどうかを示します。
        readOnlyOptions:
          type: boolean
          description: プロパティーのオプションが読み取り専用であるかどうかを示します。
        readOnlyValue:
          type: boolean
          description: プロパティーの値が読み取り専用かどうかを示します。
    Option:
      required:
        - hidden
        - label
        - value
      type: object
      properties:
        description:
          type: string
          description: オプションの説明。
        displayOrder:
          type: integer
          description: オプションは、最も小さい正の整数値を先頭に表示されます。「-1」という値にすると、そのオプションは全ての正の値よりも後に表示されます。
          format: int32
        hidden:
          type: boolean
          description: 非表示のオプションはHubSpotに表示されません。
        label:
          type: string
          description: HubSpotに表示される、人間が読めるオプションラベル。
        value:
          type: string
          description: このAPIを使用してプロパティー値を設定する際に使用する必要があるオプションの内部値。
      description: HubSpotプロパティーオプション
      example:
        description: Choice number one
        displayOrder: 1
        hidden: false
        label: Option A
        value: A
    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: ''

````