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): string 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 - string The Id of the persistent CodeSpec. insert(name, scopeType) Add a new CodeSpec to the IModelDb. insert(name: string, scopeType: Type): string throws IModelError if the insertion fails Parameter Type Description name string The name for the new CodeSpec. scopeType Type The scope type Returns - string The Id of the persistent CodeSpec. Defined in core/backend/src/CodeSpecs.ts Line 101 Last Updated: 11 June, 2024