Sensors Data Schema API

The Schema API from Sensors Data — 13 operation(s) for schema.

Operations 13

POST /schema/event/list 获取事件定义列表 #
POST /schema/event/get 获取事件定义 #
POST /schema/event/create 创建事件定义 #
POST /schema/event/update 更新事件定义 #
POST /schema/event/field/list 获取事件属性 #
POST /schema/field/list 获取属性列表 #
POST /schema/field/get 获取属性信息 #
POST /schema/field/batch-create 批量创建属性 #
POST /schema/field/update 更新属性 支持修改 display_name,unit,custom_param,visible,enable,has_data,required,data_type,view_data_source,dict 支持更新维度字典 #
POST /schema/extended-table/list 查询 Schema 关联的 Table #
POST /schema/extended-table/batch-create 创建维度表关联关系 #
POST /schema/extended-table/update 更新 SchemaExtendedTable #
POST /schema/get 获取用户表/事件表元信息 #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sensors-data-schema-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sensors-data-schema-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 元数据管理服务
  title: 神策数界 Schema API
  version: ''
servers:
- url: /api/v3/horizon/v1
tags:
- name: Schema
paths:
  /schema/event/list:
    post:
      description: "获取事件定义列表\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/event/list' \\\n    -H 'Accept: application/json' \\\n    -H 'Content-Type: application/json' \\\n    -H 'api-key: {apiKey}' \\\n    -H 'sensorsdata-project: {projectName}' \\\n    -d '{\"expand\": \"custom_params\",\"page_size\": 1\n    }'\n  返回值示例:\n  {\n      \"code\": \"SUCCESS\",\n      \"request_id\": \"111439553289fbce04c278b6db07656c\",\n      \"data\": {\n          \"schemas\": [\n              {\n                  \"project_id\": 1,\n                  \"name\": \"events.ViewProduct\",\n                  \"display_name\": \"ViewProduct\",\n                  \"type\": \"LOGICAL\",\n                  \"schema_class\": \"EVENT\",\n                  \"schema_display_type\": \"BASIC\",\n                  \"original_name\": \"ViewProduct\",\n                  \"builtin\": false,\n                  \"has_data\": true,\n                  \"visible\": true,\n                  \"enable\": true,\n                  \"custom_params\": {\n                      \"meta_schema_mapping_condition\": \"{\\\"operator\\\":\\\"AND\\\",\\\"conditions\\\":[{\\\"function\\\":\\\"EQUAL\\\",\\\"params\\\":[{\\\"param_type\\\":\\\"FIELD\\\",\\\"field\\\":\\\"event_id\\\"},{\\\"param_type\\\":\\\"VALUE\\\",\\\"value\\\":{\\\"data_type\\\":\\\"INT\\\",\\\"int_value\\\":\\\"6\\\"}}]}]}\"\n                  },\n                  \"fields\": [],\n                  \"version\": 3,\n                  \"legacy_id\": 6,\n                  \"schema_data_mapping_type\": \"SCHEMA_DATA_MAPPING_TYPE_UNSPECIFIED\"\n              }\n          ],\n          \"total_size\": 6,\n          \"has_next\": true\n      }\n  }\n```"
      operationId: ListEventSchemas
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.ListLogicalSchemasRequest'
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data:
                  schemas:
                  - has_data: false
                    mapping:
                      condition:
                        index: 10
                        conditions:
                        - function: EQUAL
                          index: 10
                          params:
                          - expression: user.p1/user.p2+user.p3
                            field: '#ResourceId'
                            time_point:
                              relative_time:
                                time_interval: {}
                            variable: $ENTRY_TIME
                            value: {}
                            param_type: FIELD
                        operator: AND
                    visible: 'true'
                    data_mapping:
                      view_table: {}
                      extended_tables:
                      - access_info: {}
                    schema_data_mapping_type: BUILTIN_TABLE
                    enable: 'true'
                    schema_display_type: BASIC
                    type: PHYSICAL
                    fields:
                    - unit: {}
                      data_mapping:
                        extended_column: {}
                      data_type:
                        type: STRING
                      view_data_source:
                        inline_expression: {}
                        view_column_source_data: {}
                        complex_expression: {}
                      object_fields:
                      - {}
                    statistics:
                      track_platforms:
                      - {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sensorsdata.horizon.v1.ListLogicalSchemasResponseHttpApiResult'
          description: sensorsdata.horizon.v1.ListLogicalSchemasResponse
      summary: 获取事件定义列表
      x-sd-openapi:
        responseClass: com.sensorsdata.horizon.v1.ListLogicalSchemasResponse
        isServerStreaming: false
        requestClass: com.sensorsdata.horizon.v1.ListLogicalSchemasRequest
        grpcServiceBase: com.sensorsdata.horizon.v1.SchemaServiceGrpc.SchemaServiceImplBase
        internalDesc: classes in template for grpc service dynamic invoking
        isClientStreaming: false
      x-codegen-request-body-name: ListLogicalSchemasRequest
      tags:
      - Schema
  /schema/event/get:
    post:
      description: "获取事件定义\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/event/get' \\\n    -H 'Accept: application/json' \\\n    -H 'Content-Type: application/json' \\\n    -H 'api-key: {apiKey}' \\\n    -H 'sensorsdata-project: {projectName}' \\\n    -d '{\"expand\": \"custom_params\",\"original_name\": \"ViewProduct\"}'\n  返回值示例:\n  {\n    \"code\": \"SUCCESS\",\n    \"request_id\": \"11154529714df4438627873ae61ad15e\",\n    \"data\": {\n        \"visible\": true,\n        \"builtin\": false,\n        \"schema_class\": \"EVENT\",\n        \"schema_display_type\": \"BASIC\",\n        \"display_name\": \"ViewProduct\",\n        \"type\": \"LOGICAL\",\n        \"version\": 3,\n        \"has_data\": true,\n        \"custom_params\": {\n            \"meta_schema_mapping_condition\": \"{\\\"operator\\\":\\\"AND\\\",\\\"conditions\\\":[{\\\"function\\\":\\\"EQUAL\\\",\\\"params\\\":[{\\\"param_type\\\":\\\"FIELD\\\",\\\"field\\\":\\\"event_id\\\"},{\\\"param_type\\\":\\\"VALUE\\\",\\\"value\\\":{\\\"data_type\\\":\\\"INT\\\",\\\"int_value\\\":\\\"6\\\"}}]}]}\"\n        },\n        \"project_id\": 1,\n        \"schema_data_mapping_type\": \"SCHEMA_DATA_MAPPING_TYPE_UNSPECIFIED\",\n        \"enable\": true,\n        \"original_name\": \"ViewProduct\",\n        \"name\": \"events.ViewProduct\",\n        \"legacy_id\": 6,\n        \"fields\": []\n    }\n  }\n```"
      operationId: GetEvent
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.GetSchemaByOriginalNameRequest'
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data:
                  has_data: false
                  mapping:
                    condition:
                      index: 10
                      conditions:
                      - function: EQUAL
                        index: 10
                        params:
                        - expression: user.p1/user.p2+user.p3
                          field: '#ResourceId'
                          time_point:
                            relative_time:
                              time_interval: {}
                          variable: $ENTRY_TIME
                          value: {}
                          param_type: FIELD
                      operator: AND
                  visible: 'true'
                  data_mapping:
                    view_table: {}
                    extended_tables:
                    - access_info: {}
                  schema_data_mapping_type: BUILTIN_TABLE
                  enable: 'true'
                  schema_display_type: BASIC
                  type: PHYSICAL
                  fields:
                  - unit: {}
                    data_mapping:
                      extended_column: {}
                    data_type:
                      type: STRING
                    view_data_source:
                      inline_expression: {}
                      view_column_source_data: {}
                      complex_expression: {}
                    object_fields:
                    - {}
                  statistics:
                    track_platforms:
                    - {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sensorsdata.horizon.v1.SchemaHttpApiResult'
          description: sensorsdata.horizon.v1.Schema
      summary: 获取事件定义
      x-sd-openapi:
        responseClass: com.sensorsdata.horizon.v1.Schema
        isServerStreaming: false
        requestClass: com.sensorsdata.horizon.v1.GetSchemaByOriginalNameRequest
        grpcServiceBase: com.sensorsdata.horizon.v1.SchemaServiceGrpc.SchemaServiceImplBase
        internalDesc: classes in template for grpc service dynamic invoking
        isClientStreaming: false
      x-codegen-request-body-name: GetSchemaByOriginalNameRequest
      tags:
      - Schema
  /schema/event/create:
    post:
      description: "创建事件定义\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/event/create' \\\n    -H 'Content-Type: application/json' \\\n    -H 'api-key: {apiKey}' \\\n    -H 'sensorsdata-project: {projectName}' \\\n    -d '{\n    \"physical_schema_name\": \"events\",\n    \"schemas\": [\n      {\n        \"original_name\": \"buttonclick\",\n        \"display_name\": \"buttonclick\",\n        \"custom_params\": {\n          \"meta_desc\": \"备注\",\n          \"meta_trigger_action_desc\": \"aaa\"\n        },\n        \"statistics\": {\n          \"track_platforms\": [\n            {\n              \"platform\": \"ANDROID\",\n              \"has_data\": false\n            },\n            {\n              \"platform\": \"IOS\",\n              \"has_data\": false\n            }\n          ]\n        }\n      }\n    ]\n   }'\n  返回值示例:\n  {\n    \"code\": \"SUCCESS\",\n    \"request_id\": \"1115555389cba16b5b816e0514fd338d\",\n    \"data\": {}\n  }\n```"
      operationId: CreateEvent
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.BatchCreateLogicalSchemasRequest'
        description: 批量创建元事件
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data: {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sensorsdata.common.HttpApiResult'
          description: ''
      summary: 创建事件定义
      x-sd-openapi:
        responseClass: com.google.protobuf.Empty
        isServerStreaming: false
        requestClass: com.sensorsdata.horizon.v1.BatchCreateLogicalSchemasRequest
        grpcServiceBase: com.sensorsdata.horizon.v1.SchemaServiceGrpc.SchemaServiceImplBase
        internalDesc: classes in template for grpc service dynamic invoking
        isClientStreaming: false
      x-codegen-request-body-name: BatchCreateLogicalSchemasRequest
      tags:
      - Schema
  /schema/event/update:
    post:
      description: "更新事件定义\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/event/update' \\\n    -H 'Content-Type: application/json' \\\n    -H 'api-key: {api_key}' \\\n    -H 'sensorsdata-project: {projectName}' \\\n    -d '{\n      \"schema\": {\n      \"name\": \"events.buttonclick\",\n      \"display_name\": \"test\"\n    },\n    \"update_mask\": \"display_name\"\n  }'\n  返回值示例:\n  {\n    \"code\": \"SUCCESS\",\n    \"request_id\": \"11164928bb5f4702fcd21875da74dfd4\",\n    \"data\": {\n        \"visible\": true,\n        \"builtin\": false,\n        \"schema_class\": \"EVENT\",\n        \"schema_display_type\": \"BASIC\",\n        \"display_name\": \"test\",\n        \"type\": \"LOGICAL\",\n        \"version\": 2,\n        \"has_data\": false,\n        \"custom_params\": {},\n        \"project_id\": 1,\n        \"schema_data_mapping_type\": \"SCHEMA_DATA_MAPPING_TYPE_UNSPECIFIED\",\n        \"enable\": true,\n        \"original_name\": \"buttonclick\",\n        \"name\": \"events.buttonclick\",\n        \"legacy_id\": 37,\n        \"fields\": []\n    }\n  }\n```"
      operationId: UpdateEvent
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.UpdateSchemaRequest'
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data:
                  has_data: false
                  mapping:
                    condition:
                      index: 10
                      conditions:
                      - function: EQUAL
                        index: 10
                        params:
                        - expression: user.p1/user.p2+user.p3
                          field: '#ResourceId'
                          time_point:
                            relative_time:
                              time_interval: {}
                          variable: $ENTRY_TIME
                          value: {}
                          param_type: FIELD
                      operator: AND
                  visible: 'true'
                  data_mapping:
                    view_table: {}
                    extended_tables:
                    - access_info: {}
                  schema_data_mapping_type: BUILTIN_TABLE
                  enable: 'true'
                  schema_display_type: BASIC
                  type: PHYSICAL
                  fields:
                  - unit: {}
                    data_mapping:
                      extended_column: {}
                    data_type:
                      type: STRING
                    view_data_source:
                      inline_expression: {}
                      view_column_source_data: {}
                      complex_expression: {}
                    object_fields:
                    - {}
                  statistics:
                    track_platforms:
                    - {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sensorsdata.horizon.v1.SchemaHttpApiResult'
          description: sensorsdata.horizon.v1.Schema
      summary: 更新事件定义
      x-sd-openapi:
        responseClass: com.sensorsdata.horizon.v1.Schema
        isServerStreaming: false
        requestClass: com.sensorsdata.horizon.v1.UpdateSchemaRequest
        grpcServiceBase: com.sensorsdata.horizon.v1.SchemaServiceGrpc.SchemaServiceImplBase
        internalDesc: classes in template for grpc service dynamic invoking
        isClientStreaming: false
      x-codegen-request-body-name: UpdateSchemaRequest
      tags:
      - Schema
  /schema/event/field/list:
    post:
      description: "获取事件属性\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/event/field/list' \\\n  -H 'Content-Type: application/json' \\\n  -H 'api-key: {api_key}' \\\n  -H 'sensorsdata-project: {projectName}' \\\n  -d '{\n  \"schema_name\": \"events.buttonclick\"\n  }'\n  返回值示例:\n  {\n    \"code\": \"SUCCESS\",\n    \"request_id\": \"11171105110d11d01f2f2fd41f60f4e7\",\n    \"data\": {\n        \"fields\": [\n            {\n                \"name\": \"user_id\",\n                \"display_name\": \"user_id\",\n                \"data_type\": {\n                    \"type\": \"BIGINT\",\n                    \"element_data_types\": \"DATA_TYPE_UNSPECIFIED\"\n                },\n                \"field_display_type\": \"BASIC\",\n                \"created_by\": \"sensorsdata.horizon.identity\",\n                \"builtin\": true,\n                \"has_data\": false,\n                \"has_dict\": false,\n                \"visible\": true,\n                \"enable\": true,\n                \"identity\": false,\n                \"primary_identity\": false,\n                \"required\": true,\n                \"subscribable\": true,\n                \"data_versioned\": false,\n                \"data_version_form\": \"FIELD_VERSION_LEVEL_UNSPECIFIED\",\n                \"custom_params\": {},\n                \"object_fields\": [],\n                \"version\": 1,\n                \"legacy_id\": 22\n            }, ...\n        ]\n    }\n  }\n```"
      operationId: ListEventFields
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.ListSchemaFieldsRequest'
        description: 获取属性列表
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data:
                  fields:
                  - unit: {}
                    data_mapping:
                      extended_column: {}
                    data_type:
                      type: STRING
                    view_data_source:
                      inline_expression: {}
                      view_column_source_data: {}
                      complex_expression: {}
                    object_fields:
                    - {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sensorsdata.horizon.v1.ListSchemaFieldsResponseHttpApiResult'
          description: sensorsdata.horizon.v1.ListSchemaFieldsResponse
      summary: 获取事件属性
      x-sd-openapi:
        responseClass: com.sensorsdata.horizon.v1.ListSchemaFieldsResponse
        isServerStreaming: false
        requestClass: com.sensorsdata.horizon.v1.ListSchemaFieldsRequest
        grpcServiceBase: com.sensorsdata.horizon.v1.SchemaServiceGrpc.SchemaServiceImplBase
        internalDesc: classes in template for grpc service dynamic invoking
        isClientStreaming: false
      x-codegen-request-body-name: ListSchemaFieldsRequest
      tags:
      - Schema
  /schema/field/list:
    post:
      description: "获取属性列表\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/field/list' \\\n    -H 'Content-Type: application/json' \\\n    -H 'api-key: {api_key}' \\\n    -H 'sensorsdata-project: {projectName}' \\\n    -d '{\n    \"schema_name\": \"items\",\n    \"expand\": \"custom_params,data_mapping,view_data_source\",\n    \"page_size\": 1\n  }'\n  返回值示例:\n  {\n    \"code\": \"SUCCESS\",\n    \"request_id\": \"111727233b327426b628b0b72d088cc0\",\n    \"data\": {\n        \"fields\": [\n            {\n                \"name\": \"$create_time\",\n                \"display_name\": \"$create_time\",\n                \"data_type\": {\n                    \"type\": \"NUMBER\",\n                    \"element_data_types\": \"DATA_TYPE_UNSPECIFIED\"\n                },\n                \"field_display_type\": \"BASIC\",\n                \"created_by\": \"sensorsdata.horizon.meta\",\n                \"builtin\": true,\n                \"has_data\": false,\n                \"has_dict\": false,\n                \"visible\": false,\n                \"enable\": true,\n                \"identity\": false,\n                \"primary_identity\": false,\n                \"required\": false,\n                \"subscribable\": true,\n                \"data_versioned\": false,\n                \"data_version_form\": \"FIELD_VERSION_LEVEL_UNSPECIFIED\",\n                \"custom_params\": {},\n                \"object_fields\": [],\n                \"version\": 1,\n                \"legacy_id\": 25\n            }, ...\n        ]\n    }\n  }\n```"
      operationId: ListSchemaFields
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.ListSchemaFieldsRequest'
        description: 获取属性列表
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data:
                  fields:
                  - unit: {}
                    data_mapping:
                      extended_column: {}
                    data_type:
                      type: STRING
                    view_data_source:
                      inline_expression: {}
                      view_column_source_data: {}
                      complex_expression: {}
                    object_fields:
                    - {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sensorsdata.horizon.v1.ListSchemaFieldsResponseHttpApiResult'
          description: sensorsdata.horizon.v1.ListSchemaFieldsResponse
      summary: 获取属性列表
      x-sd-openapi:
        responseClass: com.sensorsdata.horizon.v1.ListSchemaFieldsResponse
        isServerStreaming: false
        requestClass: com.sensorsdata.horizon.v1.ListSchemaFieldsRequest
        grpcServiceBase: com.sensorsdata.horizon.v1.SchemaServiceGrpc.SchemaServiceImplBase
        internalDesc: classes in template for grpc service dynamic invoking
        isClientStreaming: false
      x-codegen-request-body-name: ListSchemaFieldsRequest
      tags:
      - Schema
  /schema/field/get:
    post:
      description: "获取属性信息\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/field/get' \\\n    -H 'Content-Type: application/json' \\\n    -H 'api-key: {api_key}' \\\n    -H 'sensorsdata-project: {projectName}' \\\n    -d '{\n    \"schema_name\": \"events\",\n    \"field_name\": \"event_id\",\n    \"expand\": \"custom_params,data_mapping,view_data_source,unit\"\n  }'\n  返回值示例:\n  {\n    \"code\": \"SUCCESS\",\n    \"request_id\": \"11174157af1a20e42523a79622bd015c\",\n    \"data\": {\n        \"visible\": false,\n        \"has_dict\": false,\n        \"builtin\": true,\n        \"primary_identity\": false,\n        \"object_fields\": [],\n        \"display_name\": \"event_id\",\n        \"created_by\": \"sensorsdata.horizon.meta\",\n        \"version\": 2,\n        \"required\": false,\n        \"field_display_type\": \"BASIC\",\n        \"has_data\": true,\n        \"data_version_form\": \"FIELD_VERSION_LEVEL_UNSPECIFIED\",\n        \"custom_params\": {},\n        \"data_versioned\": false,\n        \"enable\": true,\n        \"identity\": false,\n        \"name\": \"event_id\",\n        \"data_type\": {\n            \"type\": \"INT\",\n            \"element_data_types\": \"DATA_TYPE_UNSPECIFIED\"\n        },\n        \"legacy_id\": 8,\n        \"subscribable\": true\n    }\n  }\n```"
      operationId: GetSchemaField
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.GetSchemaFieldRequest'
        description: 获取schema属性信息
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data:
                  unit: {}
                  data_mapping:
                    extended_column: {}
                  data_type:
                    type: STRING
                  view_data_source:
                    inline_expression: {}
                    view_column_source_data: {}
                    complex_expression: {}
                  object_fields:
                  - {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sensorsdata.horizon.v1.FieldHttpApiResult'
          description: sensorsdata.horizon.v1.Field
      summary: 获取属性信息
      x-sd-openapi:
        responseClass: com.sensorsdata.horizon.v1.Field
        isServerStreaming: false
        requestClass: com.sensorsdata.horizon.v1.GetSchemaFieldRequest
        grpcServiceBase: com.sensorsdata.horizon.v1.SchemaServiceGrpc.SchemaServiceImplBase
        internalDesc: classes in template for grpc service dynamic invoking
        isClientStreaming: false
      x-codegen-request-body-name: GetSchemaFieldRequest
      tags:
      - Schema
  /schema/field/batch-create:
    post:
      description: "批量创建属性\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/field/batch-create' \\\n    -H 'Content-Type: application/json' \\\n    -H 'api-key: {api_key}' \\\n    -H 'sensorsdata-project: {projectName}' \\\n    -d '{\n    \"fields\": [\n      {\n        \"schema_name\": \"events\",\n        \"field\": {\n          \"name\": \"product_id\",\n          \"display_name\": \"product_id\",\n          \"data_type\": {\n            \"type\": \"STRING\"\n          },\n          \"data_mapping\": {\n            \"source_type\": \"MAIN_TABLE_COLUMN\"\n          },\n          \"custom_params\": {\n            \"meta_desc\": \"备注\"\n          }\n        }\n      }\n    ]\n   }'\n  返回值示例:\n  {\n    \"code\": \"SUCCESS\",\n    \"request_id\": \"11184302633b26d1accbe76da891b2f6\",\n    \"data\": {}\n  }\n```\n 批量创建属性\n 命名规则 `^[a-zA-Z_$][a-zA-Z\\d_$]{0,99}$`\n 不允许创建以下保留字段及包含保留前缀的字段\n - 保留字段\n   - 公共保留字段\n     - distinct_id, original_id, time, properties, id, first_id, second_id, users, events, event, user_id, date, datetime\n   - SchemaClass = EVENT\n     - 公共保留字段以及 event_id, event_bucket, day, week_id, month_id, _offset, sampling_group\n   - SchemaClass = USER\n     - 公共保留字段以及 _offset, first_id_type, second_id_type, generated_from, merged_to\n   - SchemaClass = ITEM\n     - 公共保留字段以及 item_type, item_id\n - 保留前缀\n   - user_tag, user_group, $identity_, identity_, segment_ (可以创建 $ 开头的属性)"
      operationId: BatchCreateSchemaFields
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.BatchCreateSchemaFieldsRequest'
        description: 批量创建schema属性
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data: {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sensorsdata.horizon.v1.BatchCreateSchemaFieldsResponseHttpApiResult'
          description: sensorsdata.horizon.v1.BatchCreateSchemaFieldsResponse
      summary: 批量创建属性
      x-sd-openapi:
        responseClass: com.sensorsdata.horizon.v1.BatchCreateSchemaFieldsResponse
        isServerStreaming: false
        requestClass: com.sensorsdata.horizon.v1.BatchCreateSchemaFieldsRequest
        grpcServiceBase: com.sensorsdata.horizon.v1.SchemaServiceGrpc.SchemaServiceImplBase
        internalDesc: classes in template for grpc service dynamic invoking
        isClientStreaming: false
      x-codegen-request-body-name: BatchCreateSchemaFieldsRequest
      tags:
      - Schema
  /schema/field/update:
    post:
      description: "更新属性\n```\n  curl -X POST 'http://{host}:{port}/api/v3/horizon/v1/schema/field/update' \\\n    -H 'Content-Type: application/json' \\\n    -H 'api-key: {api_key}' \\\n    -H 'sensorsdata-project: {projectName}' \\\n    -d '{\n    \"schema_name\": \"events\",\n    \"field\": {\n      \"name\": \"product_id\",\n      \"display_name\": \"test\",\n      \"custom_params\": {\n        \"meta_desc\": \"备注\"\n      }\n    },\n    \"update_mask\": \"display_name,custom_params\"\n}'\n  返回值示例:\n  {\n    \"code\": \"SUCCESS\",\n    \"request_id\": \"1210192666fd2dcf558ae476758ade5e\",\n    \"data\": {\n        \"visible\": true,\n        \"has_dict\": false,\n        \"builtin\": false,\n        \"primary_identity\": false,\n        \"object_fields\": [],\n        \"display_name\": \"test\",\n        \"created_by\": \"\",\n        \"version\": 2,\n        \"required\": false,\n        \"field_display_type\": \"BASIC\",\n        \"has_data\": false,\n        \"data_version_form\": \"FIELD_VERSION_LEVEL_UNSPECIFIED\",\n        \"custom_params\": {},\n        \"data_versioned\": false,\n        \"enable\": true,\n        \"identity\": false,\n        \"name\": \"product_id\",\n        \"data_type\": {\n            \"type\": \"STRING\",\n            \"element_data_types\": \"DATA_TYPE_UNSPECIFIED\"\n        },\n        \"legacy_id\": 170,\n        \"subscribable\": true\n    }\n  }\n```"
      operationId: UpdateSchemaField
      parameters:
      - description: 全局唯一的密钥,用于验证和授权访问 API 接口
        in: header
        name: api-key
        required: true
        schema:
          type: string
      - description: 项目名, 指定请求所属项目
        in: header
        name: sensorsdata-project
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sensorsdata.horizon.v1.UpdateSchemaFieldRequest'
        description: 更新schema属性
        required: false
      responses:
        default:
          content:
            application/json:
              example:
                code: SUCCESS
                data:
                  unit: {}
                  data_mapping:
                    extended_column: {}
                  data_type:
                    type: STRING
                  view_data_source:
                    inline_expression: {}
                    view_column_source_data: {}
                    complex_expression: {}
                  object_fields:
                  - {}
                request_id: '1'
              schema:
                $ref: '#/components/schemas/sen

# --- truncated at 32 KB (89 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/sensors-data/refs/heads/main/openapi/sensors-data-schema-api-openapi.yml