API Reference > imodeljs-backend > Codes > CodeSpecs > insert insert Method Overloads insert(codeSpec) insert(name, scopeType) insert(codeSpec) Add a new CodeSpec to the iModel. insert(codeSpec: CodeSpec): Id64String note If successful, this method will assign a valid CodeSpecId to the supplied CodeSpec throws IModelError if the insertion fails Parameter Type Description codeSpec CodeSpec The CodeSpec to insert Returns - Id64String The Id of the persistent CodeSpec. insert(name, scopeType) Add a new CodeSpec to the IModelDb. insert(name: string, scopeType: Type): Id64String throws IModelError if the insertion fails Parameter Type Description name string The name for the new CodeSpec. scopeType Type The scope type Returns - Id64String The Id of the persistent CodeSpec. Defined in core/backend/src/CodeSpecs.ts Line 99 Last Updated: 13 June, 2024