> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # DeleteUserDefinedFields # Package: dataExtensionSchema # Namespace: DataExtensionSchemaService # Method link: https://dev.wix.com/docs/api-reference/business-management/data-extension-schema/delete-user-defined-fields.md ## Permission Scopes: Manage Data Extensions Schemas: SCOPE.DATAEXTENSIONS.MANAGE-SCHEMAS ## Introduction Deletes a user defined field from the specified data extension schema. --- ## REST API ### Schema ``` Method: deleteUserDefinedFields Description: Deletes a user defined field from the specified data extension schema. URL: https://www.wixapis.com/v1/schemas/delete-user-defined-fields Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: dataExtensionSchemaId, fieldsToDelete Method parameters: param name: dataExtensionSchemaId | type: dataExtensionSchemaId | description: Schema GUID. | required: true param name: fieldsToDelete | type: array | description: List of fields paths to delete. For example, ["size", "personalization.specialInstructions"]. | required: true Return type: DeleteUserDefinedFieldsResponse - name: dataExtensionSchema | type: DataExtensionSchema | description: Updated schema. - name: id | type: string | description: Schema GUID. - name: fqdn | type: string | description: FQDN of the entity this schema extends. Use a wildcard (`*`) in place of the version number, for example `wix.ecom.*.order`. See [Supported objects](https://dev.wix.com/docs/api-reference/business-management/data-extension-schema/introduction.md#supported-objects) for valid FQDNs. - name: namespace | type: string | description: Namespace for this schema. For example, an app creating schemas might use their app name as a namespace. When a site owner creates a user-defined schema, the namespace is: `_user_fields`. - name: jsonSchema | type: object | description: Schema definition in [JSON schema format](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/the-json-schema.md) with the following [vocab](https://docs.json-everything.net/schema/vocabs/) extension: ``` { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://wixapis.com/v1/json-schema/extensions", "$vocabulary": { "https://wixapis.com/v1/json-schema/extensions/vocab/data-extensions": true }, "$dynamicAnchor": "meta", "title": "Wix' data-extensions vocabulary meta schema", "type": [ "object", "boolean" ], "properties": { "x-wix-permissions": { "type": "object", "description": "list of identity types that are allowed reading schema properties", "properties": { "read": { "type": "array", "items": { "type": "string", "enum": [ "apps", "owning-app", "users", "users-of-users" ] } }, "write": { "type": "array", "items": { "type": "string", "enum": [ "apps", "owning-app", "users", "users-of-users" ] } } } }, "x-wix-display": { "type": "object", "description": "field display properties", "schema": { "properties": { "placeholder": { "type": "string", "maxLength": 255, "description": "placeholder text for input fields" }, "label": { "type": "string", "maxLength": 255, "description": "label of the input fields" }, "hint": { "type": "string", "maxLength": 255, "description": "a short explanation that appears next to the input field" } } } } } } ``` - name: updatedDate | type: string | description: Date and time the schema was last updated. - name: createdDate | type: string | description: Date and time the schema was created. - name: revision | type: string | description: Revision number, which increments by 1 each time the schema is updated. To prevent conflicting changes, the existing revision must be used when updating a schema. - name: maxLimitBytes | type: integer | description: Maximum allowed schema size in bytes. - name: currentSizeBytes | type: integer | description: Current schema size in bytes. ``` ### Examples ### DeleteUserDefinedFields ```curl ~~~cURL curl -X POST \ 'https://www.wixapis.com/schema-service/v1/schemas/delete-user-defined-fields' \ -H 'Content-type: application/json' \ -H 'Authorization: ' \ -d '{ "dataExtensionSchemaId": "01ea0c8d-80b8-46e3-bfda-611b3678545b", "fieldsToDelete": ["size", "personalization.specialInstructions"] }' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.dataExtensionSchema.DataExtensionSchemaService.deleteUserDefinedFields(dataExtensionSchemaId, options) Description: Deletes a user defined field from the specified data extension schema. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: dataExtensionSchemaId, options.fieldsToDelete, options Method parameters: param name: dataExtensionSchemaId | type: string | description: Schema GUID. | required: true param name: options | type: DeleteUserDefinedFieldsOptions none | required: true - name: fieldsToDelete | type: array | description: List of fields paths to delete. For example, ["size", "personalization.specialInstructions"]. | required: true Return type: PROMISE - name: dataExtensionSchema | type: DataExtensionSchema | description: Updated schema. - name: _id | type: string | description: Schema GUID. - name: fqdn | type: string | description: FQDN of the entity this schema extends. Use a wildcard (`*`) in place of the version number, for example `wix.ecom.*.order`. See [Supported objects](https://dev.wix.com/docs/api-reference/business-management/data-extension-schema/introduction.md#supported-objects) for valid FQDNs. - name: namespace | type: string | description: Namespace for this schema. For example, an app creating schemas might use their app name as a namespace. When a site owner creates a user-defined schema, the namespace is: `_user_fields`. - name: jsonSchema | type: object | description: Schema definition in [JSON schema format](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/the-json-schema.md) with the following [vocab](https://docs.json-everything.net/schema/vocabs/) extension: ``` { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://wixapis.com/v1/json-schema/extensions", "$vocabulary": { "https://wixapis.com/v1/json-schema/extensions/vocab/data-extensions": true }, "$dynamicAnchor": "meta", "title": "Wix' data-extensions vocabulary meta schema", "type": [ "object", "boolean" ], "properties": { "x-wix-permissions": { "type": "object", "description": "list of identity types that are allowed reading schema properties", "properties": { "read": { "type": "array", "items": { "type": "string", "enum": [ "apps", "owning-app", "users", "users-of-users" ] } }, "write": { "type": "array", "items": { "type": "string", "enum": [ "apps", "owning-app", "users", "users-of-users" ] } } } }, "x-wix-display": { "type": "object", "description": "field display properties", "schema": { "properties": { "placeholder": { "type": "string", "maxLength": 255, "description": "placeholder text for input fields" }, "label": { "type": "string", "maxLength": 255, "description": "label of the input fields" }, "hint": { "type": "string", "maxLength": 255, "description": "a short explanation that appears next to the input field" } } } } } } ``` - name: _updatedDate | type: Date | description: Date and time the schema was last updated. - name: _createdDate | type: Date | description: Date and time the schema was created. - name: revision | type: string | description: Revision number, which increments by 1 each time the schema is updated. To prevent conflicting changes, the existing revision must be used when updating a schema. - name: maxLimitBytes | type: integer | description: Maximum allowed schema size in bytes. - name: currentSizeBytes | type: integer | description: Current schema size in bytes. ``` ### Examples ### deleteUserDefinedFields ```javascript import { schemas } from '@wix/data-extension-schema'; async function deleteUserDefinedFields(dataExtensionSchemaId,options) { const response = await schemas.deleteUserDefinedFields(dataExtensionSchemaId,options); }; ``` ### deleteUserDefinedFields (with elevated permissions) ```javascript import { schemas } from '@wix/data-extension-schema'; import { auth } from '@wix/essentials'; async function myDeleteUserDefinedFieldsMethod(dataExtensionSchemaId,options) { const elevatedDeleteUserDefinedFields = auth.elevate(schemas.deleteUserDefinedFields); const response = await elevatedDeleteUserDefinedFields(dataExtensionSchemaId,options); } ``` ### deleteUserDefinedFields (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { schemas } from '@wix/data-extension-schema'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { schemas }, // Include the auth strategy and host as relevant }); async function deleteUserDefinedFields(dataExtensionSchemaId,options) { const response = await myWixClient.schemas.deleteUserDefinedFields(dataExtensionSchemaId,options); }; ``` ---