{"openapi":"3.0.0","info":{"title":"Afineo Webservices API — mappings","description":"Module `mappings` of the Afineo API v3 (7 endpoints).\n\nRead-only access to field mapping configurations: list available mappings and retrieve mapping details. Mappings define how data is transformed during import and export operations.\n\nFull specification: https://api.afineo.io/openapi.json","version":"3.0.0","contact":{"name":"Afineo Solutions","url":"https://www.afineo.com"},"x-logo":{"url":"./logo.png","altText":"Afineo - Powerful Data, Powerful People"}},"servers":[{"url":"https://{instance}.afineo.io","description":"Afineo instance","variables":{"instance":{"description":"Your Afineo instance name","default":"client"}}}],"tags":[{"name":"mappings","description":"Read-only access to field mapping configurations: list available mappings and retrieve mapping details. Mappings define how data is transformed during import and export operations."}],"paths":{"/api/v3/mappings/create-export/":{"post":{"tags":["mappings"],"summary":"create-export — Create an export mapping","description":"## Purpose\n\nCreates a new export mapping for a library (class) with structured column definitions, format options, and export configuration.\n\n## Label\n\nSeveral export mappings can share the same label, as in the interface: each call creates a new mapping.\n\n## Column Types\n\n- `attr`: Direct attribute value (attribute_id required)\n- `assoc`: Cross-reference/association value (attribute_id + optional format_attribute_id)\n- `afs`: Calculated field using Smarty code (value required)\n- `tab`: Dynamic tab — expands at export time to all attributes within the tab (attribute_id required, label optional)\n\n## Export Formats\n\nBase formats: CSV, XLSX, TXT, JSON, \"JSON Composed\"\nConditional (depends on instance configuration): XML, FABDIS, XLSX-Ecat, JSON_V2\nIf an unsupported format is requested, the error response lists all formats available on this instance.\n\n## Permissions\n\n- Requires the \"Save export\" right (`fiche::lca_saveexport`) or the \"Manage mappings\" right (`fiche::lca_manage_mappings`); both are always granted to admins.\n- Requires access to the library.\n\n## Common Errors\n\n- `Label cannot be empty` — label parameter is missing or blank\n- `Export format \"X\" is not available on this instance. Available: ...` — format not enabled\n- Permission denied (status_code=997) — missing right, or no access to the library or to the mapping\n\n## Discovery Endpoints\n\n- Libraries: `POST /api/v3/administration/classes/list`\n- Attributes: `POST /api/v3/attributes/list` with class_id\n- Asset types: `POST /api/v3/types/list` with class_id\n- Versions/languages: `POST /api/v3/administration/versions/list` with class_id\n- Existing mappings: `POST /api/v3/mappings/list` with class_id and type=export\n- Inspect a mapping: `POST /api/v3/mappings/get` with id (useful as a template)\n\n## Errors\n\n- `2` : `At least one column or file attribute is required`\n- `2` : `Class ID \"…\" is invalid`\n- `2` : `Column …: attribute_id must be a positive integer`\n- `2` : and 22 other validation message(s) of the same family\n- `997` : `You don't have the rights to access this class (…)`\n- `997` : `You don't have the rights to do this action`\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Export mapping creation response","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"integer","example":456,"description":"Created mapping ID"},"code":{"type":"string","example":"export_products_csv","description":"Portable mapping code, stable across environments"},"created":{"type":"boolean","example":true,"description":"Always true: a new mapping is created even when the label is already used"}},"required":["id","code","created"]}}}]},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"class_id":{"type":"integer","description":"Library ID (called \"class\" internally). Use POST /api/v3/administration/classes/list to get available libraries.","example":4},"label":{"type":"string","description":"Export mapping display name. Several export mappings of a library may share the same label, as in the export screen.","example":"Export Produits CSV"},"code":{"type":"string","description":"Portable code identifying the mapping across environments (preprod/prod). Must start with a letter, then letters, digits and underscores only (no hyphen), 100 characters max, unique across the whole platform. Auto-generated as \"code_{id}\" if omitted.","example":"export_products_csv"},"export_formats":{"type":"array","description":"Export file format(s). Can be empty, as in the export screen. Base formats: CSV, XLSX, TXT, JSON, \"JSON Composed\". Conditional formats depend on instance config: XML, FABDIS, XLSX-Ecat, JSON_V2. If an invalid format is sent, the error response lists all available formats.","example":["CSV"],"items":{"type":"string","enum":["CSV","XLSX","TXT","JSON","JSON Composed","XML","FABDIS","XLSX-Ecat","JSON_V2"]}},"columns":{"type":"array","description":"Export columns definition. Each column maps to one column in the exported file. Can be empty if file_attributes is provided (at least one column or file attribute is required, as in the export screen). (Array of objects - see example for structure)","example":[{"type":"attr","attribute_id":734,"label":"Product Name"},{"type":"assoc","attribute_id":234,"label":"Brand","format_attribute_id":567},{"type":"afs","value":"{$fiche.734} - {$fiche.891}","label":"Computed Field"},{"type":"tab","attribute_id":12}],"items":{"type":"object","properties":{"type":{"type":"string","enum":["attr","assoc","afs","tab"],"description":"Column type: \"attr\" (attribute), \"assoc\" (cross-reference), \"afs\" (calculated Smarty field), \"tab\" (dynamic tab)"},"attribute_id":{"type":["integer","string"],"description":"Attribute ID (integer), a system column of the export screen (idFiche, idAssetParent, codeAssetParent, idNode, idNodeParent, idStatut, codeStatut, labelStatut, idWfItems, codeWfItems, labelWfItems, idType, codeType, labelType, idTypeParent, labelTypeParent, xlsThumb, label, labels) or url_<image format>. For type=attr|assoc|tab: if omitted, the column is saved empty (no value exported, header kept) — this is how `mappings/get` returns a column whose attribute was deleted. Use POST /api/v3/attributes/list with class_id. System columns are passed as strings, e.g. \"idFiche\" (asset internal ID), \"idNode\" (node ID), \"label\" (asset label)."},"value":{"type":"string","description":"Smarty/AFS code for type=afs (optional: an empty value exports an empty column). Ignored for other types. Example: \"{$fiche.734} - {$fiche.891}\"."},"label":{"type":"string","description":"Column header label in the exported file. Optional (an empty label exports an empty header, as in the interface); for tab, lines are expanded at export time using attribute names."},"format_attribute_id":{"type":"integer","description":"For type=assoc: which attribute of the linked asset to display. Use POST /api/v3/attributes/list with the linked library's class_id."},"version_index":{"type":"string","description":"Version variant index (0-8). 0=default version. Determines which version variant of the attribute to export. Use POST /api/v3/administration/versions/list with class_id to understand available variants. Default: empty (default variant)."},"image_path":{"type":"string","description":"Image export path pattern for image attributes. Default: empty."},"format_type":{"type":"string","description":"Per-column format override, as offered by the export screen: \"\" (none, default), \"text\", \"alphanum\", \"alpha\", \"integer\", \"decimal\", \"date\", \"datetime\", \"email\", \"objectjson\", \"objectxml\". An invalid value returns the list of accepted values."},"format_decimal":{"type":"string","description":"Decimal precision (e.g. \"2\") when format_type=decimal. Default: empty."},"format_round":{"type":"string","enum":["","round","down","up"],"description":"Rounding mode when format_type=decimal: \"round\" (nearest), \"down\" (floor), \"up\" (ceil). Default: empty."},"format_date":{"type":"string","description":"Date format (e.g. \"d/m/Y\", \"Y-m-d H:i:s\") when format_type=date|datetime. Default: empty."},"version":{"type":"string","description":"Version ID(s) for this column. Single ID as string (e.g. \"12\") or comma-separated for multiple (e.g. \"12,15\"). Use POST /api/v3/administration/versions/list with class_id. Default: empty (default version)."},"linked_asset_filter":{"type":"string","description":"Controls which linked assets to export for association columns. \"0\"=all linked assets, \"1\" to \"100\"=export only the N-th linked asset, \"cond:attribute_id=value\"=conditional export (only assets matching condition). Default: \"0\" (all assets)."},"group_id":{"type":"integer","description":"0-based index into the groups array. Default: 0."}}}},"groups":{"type":"array","description":"Sheet/workbook groups. Default: one group \"Classeur\" with view-column. Each group becomes an Excel sheet or a logical grouping. (Array of objects - see example for structure)","example":[{"label":"Products","view":"view-column"}],"items":{"type":"object","properties":{"label":{"type":"string","description":"Group/sheet name"},"type":{"type":"string","enum":["classeur"],"description":"Group type. Default: \"classeur\"."},"view":{"type":"string","enum":["view-column","view-line"],"description":"Layout: \"view-column\" (normal) or \"view-line\" (transposed). Default: \"view-column\"."},"section_break_attribute_id":{"type":"string","description":"Attribute ID (as string) used to split the export into sections. A new section is created each time this attribute value changes. Use POST /api/v3/attributes/list. Only used with view=view-line. Default: empty (no break)."},"break_header_attribute_id":{"type":"string","description":"Attribute ID (as string) used as column header in section break mode. Only relevant when section_break_attribute_id is set. Default: empty."},"break_filter_value":{"type":"string","description":"Attribute value filter for section break mode. Only relevant when section_break_attribute_id is set. Default: empty."}}}},"type_ids":{"type":"array","description":"Asset type IDs to export. Use POST /api/v3/types/list with class_id. Default: empty (all types).","example":[204,228],"items":{"type":"integer"}},"supertype_ids":{"type":"array","description":"Supertype IDs for grouping. Use POST /api/v3/types/list with class_id. Default: empty.","example":[],"items":{"type":"integer"}},"version_ids":{"type":"array","description":"Version IDs to include in export. Default: empty (default version).","example":[1],"items":{"type":"integer"}},"csv_options":{"type":"object","description":"CSV/TXT format options.","example":{"field_separator":";","text_qualifier":"dq","line_ending":"lf"},"properties":{"field_separator":{"type":"string","description":"Column separator. Default: \";\""},"text_qualifier":{"type":"string","description":"\"dq\" (double quote), \"sq\" (single quote), \"no\" (none). Default: \"dq\"","enum":["dq","sq","no"]},"line_ending":{"type":"string","description":"\"lf\" (Unix), \"cr\" (Mac), \"crlf\" (Windows). Default: \"lf\"","enum":["lf","cr","crlf"]},"assoc_separator":{"type":"string","description":"Multi-value association separator. Default: \"\\n\""},"split_line_assoc":{"type":"array","description":"Attribute IDs of associations to split into separate rows (one row per value). Default: empty","items":{"type":"integer"}},"split_line":{"type":"array","description":"Column indices (1-based) to split into separate rows. Default: empty","items":{"type":"integer"}},"split_line_separator":{"type":"string","description":"Separator used to split multi-value fields into rows (e.g. \",\"). Default: empty"}}},"row_options":{"type":"object","description":"Row/header configuration.","example":{"show_column_headers":true,"header_row_number":1},"properties":{"show_column_headers":{"type":"boolean","description":"Include column header labels row. Default: true"},"header_row_number":{"type":"integer","description":"Row number for headers. Default: 1"},"show_id_fields_row":{"type":"boolean","description":"Include internal field IDs row. Default: false"},"id_fields_row_content":{"type":"string","description":"Content of ID fields row. Default: empty"},"show_id_help_row":{"type":"boolean","description":"Include help/description row. Default: false"},"id_help_row_content":{"type":"string","description":"Content of help row. Default: empty"},"data_start_row":{"type":"integer","description":"Row number where data starts. Default: auto"},"add_id_asset":{"type":"boolean","description":"Add asset ID column. Default: false"},"transpose_enabled":{"type":"boolean","description":"Activate the transposition of transpose_attribute_id (screen checkbox). Default: false"},"transpose_attribute_id":{"type":"string","description":"Attribute ID (as string) to transpose from column to row layout. When set, each value of this attribute becomes a separate row instead of a column. Default: empty (standard column layout)."}}},"display_options":{"type":"object","description":"Display and rendering options.","example":{"display_mode":"libelle"},"properties":{"display_mode":{"type":"string","description":"\"libelle\" (display labels) or \"uname\" (technical attribute codes). Default: \"libelle\"","enum":["libelle","uname"]},"default_suffix_attr":{"type":"integer","description":"Default version variant index for all columns (0-8). 0=default version. Default: none"},"default_format_date":{"type":"string","description":"Default date format for all date columns (e.g. \"d/m/Y\"). Default: empty"},"search_in_repository":{"type":"boolean","description":"Search in repository mode. Default: true"},"sub_object_mode":{"type":"string","description":"JSON export mode: \"label\" exports association values as labels, \"sub_object\" exports them as nested JSON objects. Default: \"label\"","enum":["label","sub_object"]},"max_level_json":{"type":"integer","description":"Max nesting level for JSON exports. Default: 1"},"add_attr_id_suffix":{"type":"boolean","description":"Add attribute ID as suffix to column labels (e.g. \"Product Name-734\"). Especially relevant for tab-type columns. Default: false"},"exclude_empty_fields":{"type":"boolean","description":"Exclude columns with empty values from export output. Default: false"},"exclude_inherited_values":{"type":"boolean","description":"Exclude inherited values from export (only export values directly set on the asset). Default: false"}}},"afs_format_options":{"type":"object","description":"Global format options for AFS calculated fields.","example":{"format_round":"round"},"properties":{"format_type":{"type":"string","description":"Global AFS format type, as offered by the export screen: \"\" (none, default), \"text\", \"alphanum\", \"alpha\", \"integer\", \"decimal\", \"date\", \"datetime\", \"email\". An invalid value returns the list of accepted values."},"format_decimal":{"type":"string","description":"Global decimal precision. Default: empty"},"format_round":{"type":"string","description":"Global rounding mode. Default: \"round\"","enum":["round","down","up"]},"format_date":{"type":"string","description":"Global AFS date format. Default: \"d/m/Y\""}}},"file_options":{"type":"object","description":"File output options.","example":{"file_name":"export_{$current_time}"},"properties":{"file_name":{"type":"string","description":"Custom file name. Supports {$current_time}. Default: auto-generated"},"split_file_nb_assets":{"type":"integer","description":"Split export every N assets. Default: none"},"translate_labels_lang":{"type":"integer","description":"Language version ID for translating column header labels. Use POST /api/v3/administration/versions/list with class_id. Set to -1 to disable. Must be combined with translate_labels=true. Default: -1 (no translation)"},"translate_labels":{"type":"boolean","description":"Activate label translation. Must be true for translate_labels_lang to take effect. Default: false"},"sheet_name":{"type":"string","description":"Excel sheet name. Only used with XLSX export format, ignored for other formats. Default: empty"},"export_permanent_urls":{"type":"boolean","description":"Use signed/permanent URLs for media. Default: false"},"split_file":{"type":"boolean","description":"Split the export into several files of split_file_nb_assets assets (CSV, TXT, JSON). Default: true when split_file_nb_assets is set, otherwise false"},"xls_validators":{"type":"boolean","description":"XLSX: add input limits and lists of values to the cells (enriched Excel). Default: false"},"xls_remove_empty_columns":{"type":"boolean","description":"XLSX: remove the columns without any value. Default: false"},"attachments_single_folder":{"type":"boolean","description":"Exported files (file_attributes): put all files in a single folder. Default: false"},"attachments_transfer_file":{"type":"boolean","description":"Exported files: deliver them through a transfer file. Default: false"},"transfer_file_without_csv":{"type":"boolean","description":"With attachments_transfer_file: do not include the data file in the transfer. Default: false"},"compress_zip":{"type":"boolean","description":"Compress the export in a ZIP file. Default: false"},"linked_image_formats":{"type":"object","description":"Image format to export for the assets of each linked library, keyed by library ID, e.g. {\"16\": \"src_HIGH\"}. Values: src_original, a format folder (src_<FORMAT>) or xlsThumb (XLSX thumbnail). Use POST /api/v3/administration/classes/list. Default: empty"}}},"json_options":{"type":"object","description":"JSON / JSON Composed export options (screen \"JSON options\").","example":{"advanced":true,"version_key":"language_code"},"properties":{"advanced":{"type":"boolean","description":"Advanced JSON: values grouped by version (language). Default: false"},"version_key":{"type":"string","description":"With advanced: key of each version in the JSON. version_id (1), language_code (fr) or localisation (fr-FR). Default: none","enum":["version_id","language_code","localisation"]},"afs_format_for_objects":{"type":"boolean","description":"Apply the AFS formatting to the linked objects. Default: false"},"linked_library_attribute_sets":{"type":"object","description":"JSON Composed: attribute set (display preference ID) to export for the linked assets of each library, keyed by library ID, e.g. {\"16\": 33}. Default: empty"}}},"xml_options":{"type":"object","description":"XML export options.","example":{"afs_format_for_objects":true},"properties":{"afs_format_for_objects":{"type":"boolean","description":"Apply the AFS formatting to the linked objects. Default: false"}}},"file_attributes":{"type":"array","description":"File/attachment attributes to export. Accepts either simple attribute IDs (integers) for backward compatibility, or objects with format/afs/version details. Default: empty.","example":[{"attribute_id":734,"format":"jpg"},891],"items":{"oneOf":[{"type":"integer","description":"Attribute ID (uses original format)"},{"type":"object","properties":{"attribute_id":{"type":"integer","description":"File attribute ID"},"format":{"type":"string","description":"Export format: \"original\", \"jpg\", \"png\", etc. Default: \"original\"."},"afs":{"type":"string","description":"AFS/Smarty code for file processing. Default: empty"},"version":{"type":"string","description":"Version ID(s) for this file attribute (comma-separated). Default: empty"}}}]}},"file_format_overrides":{"type":"object","description":"Format overrides per attribute ID, e.g. {\"734\": \"jpg\"}. Default: empty.","example":[]},"image_path_overrides":{"type":"object","description":"Path overrides per attribute ID, e.g. {\"734\": \"/images/\"}. Default: empty.","example":[]},"lca":{"type":"array","description":"User/group asset IDs for access control (sharing). Controls which users or groups can see and use this mapping. Default: empty (no restriction, visible to all).","example":[],"items":{"type":"integer"}},"search":{"type":"object","description":"Embedded search criteria. When enabled, the export automatically filters assets based on these search conditions instead of exporting all assets.","example":{"enabled":true,"filters":{"classified":false,"lca":"1120,1119"},"conditions":[{"fields":["4105"],"operator":"isnotnull","link":"","value":"","split_words":false}]},"properties":{"enabled":{"type":"boolean","description":"Activate embedded search. Must be true for filters/conditions to take effect. Default: false"},"filters":{"type":"object","description":"Global search filters.","properties":{"classified":{"type":"boolean","description":"Filter on classified assets only. Default: false"},"unclassified":{"type":"boolean","description":"Filter on unclassified assets only. Default: false"},"orphan":{"type":"boolean","description":"Filter on orphan assets only. Default: false"},"duplicates":{"type":"boolean","description":"Filter on duplicate assets only. Default: false"},"lca":{"type":"string","description":"Comma-separated node IDs to restrict search scope. Default: empty (all nodes)"},"time":{"type":"string","description":"Start modification date filter (format: \"d/m/Y\" or \"d/m/Y H:i:s\"). Default: empty"},"timeend":{"type":"string","description":"End modification date filter. Default: empty"},"creatime":{"type":"string","description":"Start creation date filter. Default: empty"},"creatimeend":{"type":"string","description":"End creation date filter. Default: empty"}}},"conditions":{"type":"array","description":"Search conditions (attribute-level filters). Each condition filters on an attribute value. (Array of objects - see example for structure)","items":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"},"description":"Attribute ID(s) to search on. Use POST /api/v3/attributes/list with class_id. Required for a new condition: a condition without attribute makes the search fail and return no asset."},"operator":{"type":"string","description":"Search operator: \"isnotnull\", \"isnull\", \"is\", \"isnot\", \"contain\", \"notcontain\", \"start\", \"end\", \"sup\", \"inf\", \"supegal\", \"infegal\", \"between\""},"value":{"type":"string","description":"Search value for the operator. Default: empty"},"value2":{"type":"string","description":"Second value (used with \"between\" operator). Default: empty"},"link":{"type":"string","enum":["","and","or"],"description":"Logical connector with previous condition. Empty for first condition, \"and\" or \"or\" for subsequent ones."},"split_words":{"type":"boolean","description":"Search each word separately. Default: false"}}}},"associated_data_conditions":{"type":"string","description":"Associated data search conditions (JSON string). Default: empty"}}}},"required":["class_id","label","export_formats","columns"]}}}}}},"/api/v3/mappings/create-import/":{"post":{"tags":["mappings"],"summary":"create-import — Create an import mapping","description":"## Purpose\n\nCreates a new import mapping for a library (class) that defines how file columns map to Afineo attributes, with reconciliation keys, import mode, and optional transformations.\n\n## Duplicate Labels\n\nAs in the import screen, a new mapping is always created, even if an import mapping with the same label already exists for the given class_id. Call `mappings/list` first to reuse an existing one.\n\n## Import Modes\n\n| Mode | Internal Code | Description |\n|------|--------------|-------------|\n| create_only | insertOnly | Create new records only |\n| update_only | updateOnly | Update existing records only |\n| create_and_update | insertUpdateOnly | Create new and update existing records |\n| update_asset_type | updateCateg | Only update the record type |\n| create_in_project | insertOnlyInPosition | Create records in a specific project node |\n| update_in_project | updateInPosition | Update records in a specific project node |\n| classify_only | none | Classify records without modifying data |\n\n## Reconciliation Keys\n\n- **Primary key** (`is_key: true`): One column must be marked as primary key for update/hybrid modes. This attribute is used to find existing records.\n- **Secondary key** (`is_secondary_key: true`): Additional keys for multi-criteria reconciliation.\n- Keys are NOT required for `create_only` and `create_in_project` modes.\n\n## Column Mappings\n\nEach column maps a file column (by index) to an Afineo attribute (by ID). Special attribute values:\n- Integer attribute IDs: Use `POST /api/v3/attributes/list` with class_id to discover\n- `\"typeFiche\"` (string): Maps the column to the record type field\n- System field strings: `\"[ID_NODE]\"` (node ID), `\"[ID_FICHE]\"` (asset internal ID), `\"[ID_TYPE]\"` (type ID — instance-specific), `\"[CODE_TYPE]\"` (type portable code — stable across environments, unlike the id and the label), `\"[PAGENUM]\"` (page number), `\"[PARENT]\"` (parent link — requires parent_key_attribute_id and parent_type_id), `\"[LABEL_TYPE]\"` (type label), `\"[ID_STATUT]\"` (status ID — instance-specific, like `[ID_WFITEMS]`), `\"[CODE_STATUT]\"` (status portable code — stable across environments, unlike the id and the label), `\"[LABEL_STATUT]\"` (status label — the explicit, recommended name for label-based resolution), `\"[STATUT]\"` (legacy synonym of `[LABEL_STATUT]`, still fully supported for backward compatibility — both resolve the status by its label), `\"[ID_WFITEMS]\"` (workflow step ID), `\"[LABEL_WFITEMS]\"` (workflow step label), `\"[CODE_WFITEMS]\"` (workflow step portable code — resolved within the workflow the asset is currently on, so the same file works across environments where step IDs differ), `\"[ORDRE]\"` (order), `\"[LABEL_ATTRIBUTE]\"` (attribute name — requires value_column_index), `\"[ATTRIBUTE_CODE]\"` (attribute code — requires value_column_index), `\"[ATTRIBUTE_ID]\"` (attribute ID — requires value_column_index)\n- `\"-1\"` (string): Ignore this column entirely\n\n## Update Mode (field_update)\n\nFor update/hybrid modes, each column has an `update_mode` that controls how values are applied:\n- `\"sync\"` (default): Exact synchronization — replaces the existing value entirely\n- `\"add\"`: Additive — appends to existing value (for text) or adds to list (for associations/multi-value)\n\n## Column Conditions\n\nEach column can have an optional import condition that filters which rows are processed:\n- `isnotnull`: Import only if this column is not empty\n- `isnull`: Import only if this column is empty\n- `equals`: Import only if value equals condition_value\n- `not_equals`: Import only if value does not equal condition_value\n- `contains`: Import only if value contains condition_value\n- `not_contains`: Import only if value does not contain condition_value\n- `starts_with`: Import only if value starts with condition_value\n- `not_starts_with`: Import only if value does not start with condition_value\n- `greater_than`: Import only if value is greater than condition_value\n- `less_than`: Import only if value is less than condition_value\n\n## Data Mode\n\nSome attributes support a dual interpretation of the column value via the `data_mode` parameter:\n- `\"value\"` (default): The column contains actual attribute data\n- `\"suffix\"`: The column contains a language/variant suffix identifier instead of data\n\n## Dynamic Attribute Mapping\n\nWhen using `[LABEL_ATTRIBUTE]`, `[ATTRIBUTE_CODE]`, or `[ATTRIBUTE_ID]` as attribute_id, the column contains attribute names/codes/IDs rather than data. Use `value_column_index` to specify which column holds the actual value, and optionally `suffix_column_index` and `version_column_index` for variant/version.\n\n## Hierarchy/Grouping (Regroupements)\n\nFor tree-based import modes (classify_only, create_in_project, update_in_project), you can define grouping levels via the `groupings` parameter. Each level creates a folder structure based on a type and column-to-attribute mappings.\n\n## Associated Characteristics\n\nWhen the ATTR_CARAC extension is enabled, you can designate an attribute as a characteristic pivot. Use `characteristic_attribute_id` in import_options to set the pivot attribute, and `characteristic_mode` to control whether it applies automatically (1) or only to columns marked with `is_characteristic` (2).\n\n## Supported Transformations\n\nSame transformations as the import screen, stored the same way. A type whose format is inactive on the instance is rejected.\n\n| Type | Description | Parameters |\n|------|-------------|------------|\n| uppercase | Convert to uppercase | none |\n| lowercase | Convert to lowercase | none |\n| capitalize | First letter uppercase | none |\n| replace | Search and replace | `search`, `replace` (one rule), or `rules`: one `search=replace` rule per line, `REGEX:pattern=replace` for a regular expression, a literal `=` written `==` |\n| prefix | Add prefix to value | value |\n| suffix | Add suffix to value | value |\n| afs | Compute a new value with an AfineoScript | script |\n\n## Permissions\n\n- Requires the \"Import\" right (`fiche::lca_import`) or the \"Manage mappings\" right (`fiche::lca_manage_mappings`); both are always granted to admins.\n- Requires access to the library.\n\n## Common Errors\n\n- `Label cannot be empty` — label parameter is missing or blank\n- `Invalid import_mode` — mode not in the allowed enum\n- `At least one column mapping is required` — column_mappings array is empty\n- `A key column is required for mode X` — update/hybrid modes need a primary key\n- `column_mappings[N] requires column_index` — missing column index\n- `column_mappings[N].column_index must be a positive integer` — invalid column index\n- `Attribute X does not exist` — attribute_id not found in system\n- Permission denied (status_code=997) — missing right, or no access to the library or to the mapping\n\n## Discovery Endpoints\n\n- Libraries: `POST /api/v3/administration/classes/list`\n- Attributes: `POST /api/v3/attributes/list` with class_id\n- Asset types: `POST /api/v3/types/list` with class_id\n- Versions/languages: `POST /api/v3/administration/versions/list` with class_id\n- Existing mappings: `POST /api/v3/mappings/list` with class_id and type=import\n- Inspect a mapping: `POST /api/v3/mappings/get` with id (useful as a template)\n\n## Errors\n\n- `2` : `A key column (is_key: true) is required for mode …`\n- `2` : `At least one column mapping is required`\n- `2` : `Class ID \"…\" is invalid`\n- `2` : `Failed to create import mapping (XML validation failed)`\n- `2` : `Invalid import_mode: …. Valid modes: …`\n- `2` : `Label cannot be empty`\n- `2` : and 59 other validation message(s) of the same family\n- `997` : `You don't have the rights to access this class (…)`\n- `997` : `You don't have the rights to do this action`\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Import mapping creation response","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"integer","example":215,"description":"Created mapping ID"},"code":{"type":"string","example":"export_products_csv","description":"Portable mapping code, stable across environments"},"created":{"type":"boolean","example":true,"description":"Always true: a new mapping is created even when the label is already used"}},"required":["id","code","created"]}}}]},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"class_id":{"type":"integer","description":"Library ID (called \"class\" internally). Use POST /api/v3/administration/classes/list to get available libraries.","example":4},"label":{"type":"string","description":"Import mapping display name. Several import mappings of a library may share the same label, as in the import screen.","example":"Import Produits CSV"},"code":{"type":"string","description":"Portable code identifying the mapping across environments (preprod/prod). Must start with a letter, then letters, digits and underscores only (no hyphen), 100 characters max, unique across the whole platform. Auto-generated as \"code_{id}\" if omitted.","example":"import_products_csv"},"import_mode":{"type":"string","description":"Import behavior mode. Determines whether records are created, updated, or both. create_only=create new records only, update_only=update existing records only, create_and_update=create and update, update_asset_type=update record type only, create_in_project=create in specific project, update_in_project=update in specific project, classify_only=classify without modifying data.","enum":["create_only","update_only","create_and_update","update_asset_type","create_in_project","update_in_project","classify_only"],"example":"create_and_update"},"column_mappings":{"type":"array","description":"Mapping of file columns to Afineo attributes. At least one column required. Each entry maps a CSV/Excel column to a target attribute. (Array of objects - see example for structure)","example":[{"column_index":1,"attribute_id":734,"is_key":true},{"column_index":2,"attribute_id":856,"update_mode":"add"},{"column_index":3,"attribute_id":912,"condition":"isnotnull","transformations":[{"type":"uppercase"}]}],"items":{"type":"object","properties":{"column_index":{"type":"integer","description":"Column index in file (1-indexed: 1=column A, 2=column B, etc.)."},"attribute_id":{"type":["integer","string"],"description":"Target attribute ID (integer). Use POST /api/v3/attributes/list with class_id to discover. Also accepts the string \"type\" to map the column to the record type field. Omitted, 0 or empty: the file column is kept without attribute (not imported), as the import screen saves it — unlike \"-1\", which marks the column as ignored. As in the import screen: advanced link attributes and the category classification attribute (Categories v2, imported through \"[CATEGORY_LINK]\") are not available, an attribute with a context scope is not available for modes create_only, update_only, create_and_update and update_asset_type, an attribute with a counter is not available for creation modes (create_only, create_and_update, create_in_project), \"[CATEGORY_LINK]\" is only available for modes create_only, update_only and create_and_update, and \"[LABEL_WFITEMS]\" requires the IMPORT_WF_STEP_BY_LABEL extension."},"is_key":{"type":"boolean","description":"Mark as primary reconciliation key. Required for update/hybrid modes. Only one column should be the primary key. Must be an indexed attribute (the import looks records up in the index table) or a system field; \"[CATEGORY_LINK]\" cannot be a key. Default: false."},"is_secondary_key":{"type":"boolean","description":"Mark as secondary reconciliation key for multi-criteria matching. Only available for mode update_in_project, with the import_multiKey extension, on an indexed attribute. Default: false."},"update_mode":{"type":"string","enum":["sync","add"],"description":"How to apply values on existing records. \"sync\" = exact synchronization (replaces existing value entirely). \"add\" = additive (appends to text, adds to multi-value lists/associations). Default: \"sync\"."},"condition":{"type":"string","enum":["isnotnull","isnull","equals","not_equals","contains","not_contains","starts_with","not_starts_with","greater_than","less_than"],"description":"Import condition: only process this column when condition is met. isnotnull=not empty, isnull=empty, equals/not_equals=value comparison, contains/not_contains=substring, starts_with/not_starts_with=prefix, greater_than/less_than=numeric. Default: none (always import)."},"condition_value":{"type":"string","description":"Value to compare against for condition operators (equals, not_equals, contains, not_contains, starts_with, not_starts_with, greater_than, less_than). Ignored for isnotnull/isnull. Default: empty."},"version_id":{"type":"integer","description":"Version ID for multilingual attributes (determines language/channel variant). Use POST /api/v3/administration/versions/list with class_id to get available versions. -1 = default (the mapping version). Default: none (default version)."},"data_mode":{"type":"string","enum":["value","suffix"],"description":"How to interpret the column data. \"value\" = column contains attribute data (default). \"suffix\" = column contains a language/variant suffix identifier. Default: \"value\"."},"association":{"type":"object","description":"Configuration for association/linked data columns. Use when the attribute references records from another library. Also used for [PARENT] system field.","properties":{"target_attribute_id":{"type":"integer","description":"Attribute ID in the linked library to match against (reconciliation key to find linked records). Use POST /api/v3/attributes/list with the linked library class_id. For [PARENT]: attribute ID to match parent records. The record ID attribute (system name asset_id) cannot be used when create_if_not_exists is true."},"target_asset_type_id":{"type":"integer","description":"For [PARENT]: supertype ID of the parent records (type_type, e.g. 7 = Article)."},"create_if_not_exists":{"type":"boolean","description":"If true, create the linked record when not found (create and link). If false, only link to existing records. Default: false. Not applicable for [PARENT]."},"create_asset_type_id":{"type":"integer","description":"Record type ID to use when creating linked records (used with create_if_not_exists or file/URL imports). Use POST /api/v3/types/list with the linked library class_id. Default: none."},"cross_reference_columns":{"type":"object","description":"Cross-reference column mappings for importing additional attributes of the linked record from other file columns. Maps attribute IDs of the linked library to file column indices (1-indexed). Format: {\"attribute_id\": column_index}. Example: {\"856\": 5} means column 5 provides the value for attribute 856 of the linked record.","additionalProperties":true}}},"value_column_index":{"type":"integer","description":"For [LABEL_ATTRIBUTE], [ATTRIBUTE_CODE], [ATTRIBUTE_ID] system fields: column index (1-indexed, same as column_index) containing the actual data value. Required when attribute_id is one of these dynamic attribute system fields."},"suffix_column_index":{"type":"integer","description":"For [LABEL_ATTRIBUTE], [ATTRIBUTE_CODE], [ATTRIBUTE_ID]: column index (1-indexed) containing the suffix/variant identifier. Optional."},"version_column_index":{"type":"integer","description":"For [LABEL_ATTRIBUTE], [ATTRIBUTE_CODE], [ATTRIBUTE_ID]: column index (1-indexed) containing the version identifier. Optional."},"is_characteristic":{"type":"boolean","description":"Mark this column as an associated characteristic column. Requires ATTR_CARAC extension and characteristic_attribute_id set in import_options. Default: false."},"transformations":{"type":"array","description":"Transformations to apply on imported value before saving.","items":{"type":"object","properties":{"type":{"type":"string","enum":["uppercase","lowercase","capitalize","replace","prefix","suffix","afs"],"description":"Transformation type."},"params":{"type":"object","description":"Transformation parameters. For replace: {search, replace} or {rules} (one search=replace rule per line, REGEX: prefix for a regular expression). For prefix/suffix: {value}. For afs: {script}."}}}}}}},"source_config":{"type":"object","description":"Source file configuration (CSV/Excel row settings).","example":{"header_row":1,"data_start_row":2},"properties":{"header_row":{"type":"integer","description":"Row number containing column headers (1-indexed). 0: the file has no header row. Default: 1."},"attribute_row":{"type":"integer","description":"Row number containing attribute codes (if different from headers). Default: same as header_row."},"data_start_row":{"type":"integer","description":"Row number where data starts. Default: 2."},"worksheet_name":{"type":"string","description":"Excel worksheet name to use. Default: first sheet."}}},"csv_options":{"type":"object","description":"CSV/TXT file parsing options. Only relevant for CSV and TXT file imports.","example":{"column_separator":";","field_delimiter":"\""},"properties":{"column_separator":{"type":"string","description":"Column/field separator character. Default: \";\" (semicolon)."},"field_delimiter":{"type":"string","description":"Field enclosure/delimiter character. Default: '\"' (double quote)."}}},"default_version_id":{"type":"integer","description":"Default version ID applied to all columns that don't have a specific version_id set. Determines which language/channel variant to import into. Use POST /api/v3/administration/versions/list with class_id. -1 = default (the project version, or per record). Default: platform default version. Not available for update_asset_type and classify_only modes.","example":1},"default_status_id":{"type":"integer","description":"Default status (LCA) ID applied to imported records. Use POST /api/v3/permissions/statuses/list with class_id to get available statuses. Default: none. Not available for update_asset_type mode.","example":0},"asset_type_id":{"type":"integer","description":"Default record type ID for created records, for creation modes (create_only, create_and_update, create_in_project). Optional: the type can also come from the caller of the import (a process action) or from a type column of the file; without any of them, each row to create is rejected. Use POST /api/v3/types/list with class_id.","example":25},"import_options":{"type":"object","description":"Advanced import behavior options.","example":{"reindex_after":true},"properties":{"force_context":{"type":"boolean","description":"Force context during import. Default: false."},"reindex_after":{"type":"boolean","description":"Trigger reindexation after import. Default: false."},"move_if_exists":{"type":"boolean","description":"Move existing record to new location if found. Default: false."},"as_suggestions":{"type":"boolean","description":"Import values as suggestions (pending approval). Requires the proposals option of the library. Default: false."},"filter_by_asset_type_id":{"type":"integer","description":"Only process records of this supertype ID (type_type, e.g. 2 = Record, 7 = Article, 8 = Product variation). Default: none (all supertypes)."},"no_merge_lines":{"type":"boolean","description":"Do not merge multiple rows with same key into one record. Requires the import_allowNotMergeLines extension. Default: false."},"no_auto_child_links":{"type":"boolean","description":"Disable automatic child link creation. Default: false."},"characteristic_attribute_id":{"type":"integer","description":"Attribute ID to use as characteristic pivot (requires ATTR_CARAC extension). This attribute becomes the characteristic grouping key. Use POST /api/v3/attributes/list with class_id. Default: none."},"characteristic_mode":{"type":"integer","description":"How to handle characteristic columns. 1=apply to all unaffected attributes automatically, 2=apply only to columns explicitly marked with is_characteristic. Default: 1. Only used when characteristic_attribute_id is set.","enum":[1,2]}}},"groupings":{"type":"array","description":"Hierarchy/grouping levels for tree-based imports (classify_only, create_in_project, update_in_project modes, or when allowArboHierarchy is enabled). Each level defines a folder structure. Not available for updateCateg mode. (Array of objects - see example for structure)","example":[{"level":1,"asset_type_id":85,"fields":[{"column_index":1,"attribute_id":231,"is_key":false},{"column_index":2,"attribute_id":376,"is_key":false}]}],"items":{"type":"object","properties":{"level":{"type":"integer","description":"Grouping level number (1-based, sequential)."},"asset_type_id":{"type":"integer","description":"Asset type/category ID for this grouping level. Use POST /api/v3/types/list with class_id."},"fields":{"type":"array","description":"Column-to-attribute mappings for this level. Format: [{column_index, attribute_id, is_key}].","items":{"type":"object","properties":{"column_index":{"type":"integer","description":"File column index (1-indexed)."},"attribute_id":{"type":["integer","string"],"description":"Target attribute ID for this grouping field, or the string \"[PAGENUM]\" for the page number column (as saved by the import screen)."},"is_key":{"type":"boolean","description":"Mark as key field for this grouping level. Default: false."}}}}}}},"lca":{"type":"array","description":"User/group asset IDs for access control (sharing). Controls which users or groups can see and use this mapping. Default: empty (no restriction, visible to all).","example":[],"items":{"type":"integer"}}},"required":["class_id","label","import_mode","column_mappings"]}}}}}},"/api/v3/mappings/full/":{"post":{"tags":["mappings"],"summary":"full — Get all mappings for a class","description":"## Purpose\n\nReturns all mappings for a class grouped by type (export, import, asset_view, search_view, dynamic_grouped_view).\n\n## Response Details\n\nEach mapping includes metadata (creation/modification dates, users, permissions) and full configuration data.\n\n## Permissions\n\n- Requires access to the library.\n- Rights per mapping type, as the interface screens that save them: export → \"Save export\" (`fiche::lca_saveexport`), import → \"Import\" (`fiche::lca_import`), dynamic_grouped_view → \"Manage views and trees\" (`fiche::lca_manage_view_and_arbo`), other types (asset_view, search_view, saved_search) → \"Manage mappings\" only. The \"Manage mappings\" right (`fiche::lca_manage_mappings`) opens every type; admins have all rights.\n- Non-admin users only see mappings without profile restriction (empty, 0 or \"/\"), mappings they created, or mappings allowed to one of their profiles or to themselves.\n- Only the mapping types the user has rights for are returned; status_code=997 if none.\n\n## Errors\n\n- `2` : `Class ID \"…\" is invalid`\n- `2` : a parameter is missing, of the wrong type, outside the allowed values, or a nested property is malformed (see the request schema)\n- `997` : `You don't have the rights to access this class (…)`\n- `997` : `You don't have the rights to do this action`\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Mappings information response","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"result":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","example":"export","description":"Mapping type"},"results_total":{"type":"integer","example":5,"description":"Total number of mappings returned for this mapping type"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":1415,"description":"ID"},"code":{"type":"string","example":"export_products_csv","description":"Mapping code"},"label":{"type":"string","nullable":true,"example":"My Mapping","description":"Label"},"tags":{"type":"array","items":{"type":"string"},"example":["tag1","tag2"],"description":"Array of tags (can be empty)"},"class_id":{"type":"integer","example":4,"description":"Library ID"},"class_code":{"type":"string","example":"code_4","description":"Portable code of the library. Stable across environments, unlike class_id."},"class_label":{"type":"string","example":"Products","description":"Library label"},"permissions":{"type":"string","example":"Group 1 | Group 2","description":"Permissions"},"creation_date":{"type":"string","nullable":true,"example":"2016-02-17T00:00:00+01:00","description":"Creation date (ISO 8601 format)"},"creation_user":{"type":"string","nullable":true,"example":"creation_user@company.com","description":"Creation user"},"modification_date":{"type":"string","nullable":true,"example":"2018-02-17T00:00:00+01:00","description":"Modification date (ISO 8601 format)"},"modification_user":{"type":"string","nullable":true,"example":"modification_user@company.com","description":"Modification user"},"last_use_date":{"type":"string","nullable":true,"example":"2019-02-17T00:00:00+01:00","description":"Last use date (ISO 8601 format)"},"last_use_user":{"type":"string","nullable":true,"example":"last_use_user@company.com","description":"Last use user"},"hash":{"type":"string","example":"a84ef1b35017a6ce27eaca962d291124afaf005dc301656ef9b7492e29cc3d4d","description":"Hash"},"data":{"type":"object","nullable":true,"description":"Data","additionalProperties":true}},"required":["id","code","label","tags","class_id","class_code","class_label","hash"],"description":"Mapping information"}}},"required":["type","items"],"description":"List of mappings for the mapping type"}}}}]},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"class_id":{"type":"integer","description":"Library ID. Use POST /api/v3/administration/classes/list to get available libraries.","example":4}},"required":["class_id"]}}}}}},"/api/v3/mappings/get/":{"post":{"tags":["mappings"],"summary":"get — Get mapping details","description":"## Purpose\n\nReturns complete mapping configuration including metadata, permissions, and full data structure.\n\n## Permissions\n\n- Requires access to the mapping library.\n- Rights per mapping type, as the interface screens that save them: export → \"Save export\" (`fiche::lca_saveexport`), import → \"Import\" (`fiche::lca_import`), dynamic_grouped_view → \"Manage views and trees\" (`fiche::lca_manage_view_and_arbo`), other types (asset_view, search_view, saved_search) → \"Manage mappings\" only. The \"Manage mappings\" right (`fiche::lca_manage_mappings`) opens every type; admins have all rights.\n- Non-admin users only see mappings without profile restriction (empty, 0 or \"/\"), mappings they created, or mappings allowed to one of their profiles or to themselves.\n- A mapping hidden by these profile rules is reported as not existing (status_code=2); status_code=997 if the user has no right for its type.\n\n## Errors\n\n- `2` : `Mapping \"…\" does not exist`\n- `2` : a parameter is missing, of the wrong type, outside the allowed values, or a nested property is malformed (see the request schema)\n- `3` : `Mapping \"…\" is not a valid mapping type`\n- `997` : `You don't have the rights to do this action`\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Mapping information response","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"integer","example":1415,"description":"ID"},"code":{"type":"string","example":"export_products_csv","description":"Mapping code"},"label":{"type":"string","nullable":true,"example":"My Mapping","description":"Label"},"tags":{"type":"array","items":{"type":"string"},"example":["tag1","tag2"],"description":"Array of tags (can be empty)"},"class_id":{"type":"integer","example":4,"description":"Library ID"},"class_code":{"type":"string","example":"code_4","description":"Portable code of the library. Stable across environments, unlike class_id."},"class_label":{"type":"string","example":"Products","description":"Library label"},"type":{"type":"string","example":"export","description":"Mapping type"},"permissions":{"type":"string","example":"Group 1 | Group 2","description":"Permissions"},"creation_date":{"type":"string","nullable":true,"example":"2016-02-17T00:00:00+01:00","description":"Creation date (ISO 8601 format)"},"creation_user":{"type":"string","nullable":true,"example":"creation_user@company.com","description":"Creation user"},"modification_date":{"type":"string","nullable":true,"example":"2018-02-17T00:00:00+01:00","description":"Modification date (ISO 8601 format)"},"modification_user":{"type":"string","nullable":true,"example":"modification_user@company.com","description":"Modification user"},"last_use_date":{"type":"string","nullable":true,"example":"2019-02-17T00:00:00+01:00","description":"Last use date (ISO 8601 format)"},"last_use_user":{"type":"string","nullable":true,"example":"last_use_user@company.com","description":"Last use user"},"hash":{"type":"string","example":"a84ef1b35017a6ce27eaca962d291124afaf005dc301656ef9b7492e29cc3d4d","description":"Hash"},"data":{"type":"object","nullable":true,"description":"Data","additionalProperties":true}},"required":["id","code","label","tags","class_id","class_code","class_label","type","hash"],"description":"Mapping information"}}}]},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Mapping ID. Use POST /api/v3/mappings/list with class_id to get available mappings.","example":140}},"required":["id"]}}}}}},"/api/v3/mappings/list/":{"post":{"tags":["mappings"],"summary":"list — List mappings by class and type","description":"## Purpose\n\nReturns the mappings of a library for one mapping type, with their id, portable code, label and tags — without their column configuration.\n\n## Mapping Types\n\n- `export`: Data export configurations\n- `import`: Data import configurations\n- `asset_view`: Asset display views\n- `search_view`: Search result views\n- `dynamic_grouped_view`: Grouped display views\n\n## Permissions\n\n- Requires access to the library.\n- Rights per mapping type, as the interface screens that save them: export → \"Save export\" (`fiche::lca_saveexport`), import → \"Import\" (`fiche::lca_import`), dynamic_grouped_view → \"Manage views and trees\" (`fiche::lca_manage_view_and_arbo`), other types (asset_view, search_view, saved_search) → \"Manage mappings\" only. The \"Manage mappings\" right (`fiche::lca_manage_mappings`) opens every type; admins have all rights.\n- Non-admin users only see mappings without profile restriction (empty, 0 or \"/\"), mappings they created, or mappings allowed to one of their profiles or to themselves.\n- status_code=997 if the user has no right for the requested type.\n\n## Errors\n\n- `2` : `Class ID \"…\" is invalid`\n- `2` : a parameter is missing, of the wrong type, outside the allowed values, or a nested property is malformed (see the request schema)\n- `3` : `No mappings found for the class \"…\"`\n- `997` : `You don't have the rights to access this class (…)`\n- `997` : `You don't have the rights to do this action`\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Mappings information response","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"result":{"type":"object","properties":{"results_total":{"type":"integer","example":2,"description":"Total number of mappings found"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":1415,"description":"Mapping ID"},"code":{"type":"string","example":"export_products_csv","description":"Mapping code"},"label":{"type":"string","nullable":true,"example":"My Mapping","description":"Mapping label"},"tags":{"type":"array","items":{"type":"string"},"example":["tag1","tag2"],"description":"Array of tags (can be empty)"},"class_id":{"type":"integer","example":4,"description":"Library ID"},"class_code":{"type":"string","example":"code_4","description":"Portable code of the library. Stable across environments, unlike class_id."},"class_label":{"type":"string","example":"Products","description":"Library label"},"type":{"type":"string","example":"export","description":"Mapping type"}},"required":["id","code","label","tags","class_id","class_code","class_label","type"]},"description":"Array of mapping objects"}},"required":["results_total","items"],"description":"Mappings with total count"}}}]},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"class_id":{"type":"integer","description":"Library ID. Use POST /api/v3/administration/classes/list to get available libraries.","example":4},"type":{"type":"string","description":"Mapping type: \"export\" (data export), \"import\" (data import), \"asset_view\" (asset display), \"search_view\" (search results), \"dynamic_grouped_view\" (grouped display).","enum":["asset_view","dynamic_grouped_view","export","import","search_view"],"example":"export"}},"required":["class_id","type"]}}}}}},"/api/v3/mappings/update-export/":{"post":{"tags":["mappings"],"summary":"update-export — Update an existing export mapping","description":"## Purpose\n\nUpdates an existing export mapping configuration. All parameters except `id` are optional — only provided fields are updated.\n\n## Behavior\n\n- The mapping must exist and be of type \"export\".\n- If `columns` is provided, it **replaces** the entire column list (no partial merge).\n- If `groups` is provided, it **replaces** the entire groups list.\n- Option groups (`csv_options`, `row_options`, `display_options`, `afs_format_options`, `file_options`, `json_options`, `xml_options`) are merged: the fields provided replace the current ones, the fields omitted keep their current value.\n- Other top-level optional parameters are merged into the existing configuration.\n- An empty or missing `label` keeps the current label. Several export mappings can share the same label, as in the interface.\n- A column of type attr/assoc/tab without `attribute_id` is saved empty, as in the interface: columns returned by `mappings/get` without `attribute_id` can be sent back as is.\n\n## Permissions\n\n- Requires the \"Save export\" right (`fiche::lca_saveexport`) or the \"Manage mappings\" right (`fiche::lca_manage_mappings`); both are always granted to admins.\n- Requires access to the mapping library.\n- Access to the mapping, as in the \"Replace a mapping\" list of the export screen: a mapping without profile restriction (empty, 0 or \"/\"), a mapping created by the user, a mapping whose `lca` contains the user ID, or a mapping allowed to one of the user's profiles. Admins can update any mapping except another user's private mapping.\n\n## Common Errors\n\n- `Mapping \"X\" not found` — invalid mapping ID\n- `Mapping \"X\" is not an export mapping (type: Y)` — wrong mapping type\n- Permission denied (status_code=997) — missing right, or no access to the library or to the mapping\n\n## Discovery Endpoints\n\n- Existing mappings: `POST /api/v3/mappings/list` with class_id and type=export\n- Mapping details: `POST /api/v3/mappings/get` with id (use as template)\n- Libraries: `POST /api/v3/administration/classes/list`\n- Attributes: `POST /api/v3/attributes/list` with class_id\n- Asset types: `POST /api/v3/types/list` with class_id\n- Versions/languages: `POST /api/v3/administration/versions/list` with class_id\n\n## Errors\n\n- `2` : `At least one column or file attribute is required`\n- `2` : `Column …: attribute_id must be a positive integer`\n- `2` : and 24 other validation message(s) of the same family\n- `997` : `You don't have the rights to do this action`\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Export mapping update response","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"integer","example":456,"description":"Updated mapping ID"},"code":{"type":"string","example":"export_products_csv","description":"Portable mapping code, stable across environments"},"updated":{"type":"boolean","example":true,"description":"true if mapping was updated"}},"required":["id","code","updated"]}}}]},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Mapping ID to update. Use POST /api/v3/mappings/list with class_id and type=export to get available export mappings.","example":456},"label":{"type":"string","description":"New export mapping display name. If empty or not provided, the existing label is kept.","example":"Export Produits CSV v2"},"code":{"type":"string","description":"New portable code for the mapping. Must start with a letter, then letters, digits and underscores only (no hyphen), 100 characters max, unique across the whole platform. ⚠️ Renaming breaks any external reference to the previous code.","example":"export_products_csv"},"export_formats":{"type":"array","description":"Export file format(s). Replaces existing formats. Base formats: CSV, XLSX, TXT, JSON, \"JSON Composed\". Conditional formats depend on instance config: XML, FABDIS, XLSX-Ecat, JSON_V2. If an invalid format is sent, the error response lists all available formats.","example":["CSV","XLSX"],"items":{"type":"string","enum":["CSV","XLSX","TXT","JSON","JSON Composed","XML","FABDIS","XLSX-Ecat","JSON_V2"]}},"columns":{"type":"array","description":"Export columns definition. Replaces the entire column list. Each column maps to one column in the exported file. (Array of objects - see example for structure)","example":[{"type":"attr","attribute_id":734,"label":"Product Name"},{"type":"assoc","attribute_id":234,"label":"Brand","format_attribute_id":567}],"items":{"type":"object","properties":{"type":{"type":"string","enum":["attr","assoc","afs","tab"],"description":"Column type: \"attr\" (attribute), \"assoc\" (cross-reference), \"afs\" (calculated Smarty field), \"tab\" (dynamic tab)"},"attribute_id":{"type":["integer","string"],"description":"Attribute ID (integer), a system column of the export screen (idFiche, idAssetParent, codeAssetParent, idNode, idNodeParent, idStatut, codeStatut, labelStatut, idWfItems, codeWfItems, labelWfItems, idType, codeType, labelType, idTypeParent, labelTypeParent, xlsThumb, label, labels) or url_<image format>. For type=attr|assoc|tab: if omitted, the column is saved empty (no value exported, header kept) — this is how `mappings/get` returns a column whose attribute was deleted. Use POST /api/v3/attributes/list with class_id. System columns are passed as strings, e.g. \"idFiche\" (asset internal ID), \"idNode\" (node ID), \"label\" (asset label)."},"value":{"type":"string","description":"Smarty/AFS code for type=afs (optional: an empty value exports an empty column). Ignored for other types. Example: \"{$fiche.734} - {$fiche.891}\"."},"label":{"type":"string","description":"Column header label in the exported file. Optional (an empty label exports an empty header, as in the interface); for tab, lines are expanded at export time using attribute names."},"format_attribute_id":{"type":"integer","description":"For type=assoc: which attribute of the linked asset to display. Use POST /api/v3/attributes/list with the linked library's class_id."},"version_index":{"type":"string","description":"Version variant index (0-8). 0=default version. Determines which version variant of the attribute to export. Use POST /api/v3/administration/versions/list with class_id. Default: empty (default variant)."},"image_path":{"type":"string","description":"Image export path pattern for image attributes. Default: empty."},"format_type":{"type":"string","description":"Per-column format override, as offered by the export screen: \"\" (none, default), \"text\", \"alphanum\", \"alpha\", \"integer\", \"decimal\", \"date\", \"datetime\", \"email\", \"objectjson\", \"objectxml\". An invalid value returns the list of accepted values."},"format_decimal":{"type":"string","description":"Decimal precision (e.g. \"2\") when format_type=decimal. Default: empty."},"format_round":{"type":"string","enum":["","round","down","up"],"description":"Rounding mode when format_type=decimal: \"round\" (nearest), \"down\" (floor), \"up\" (ceil). Default: empty."},"format_date":{"type":"string","description":"Date format (e.g. \"d/m/Y\", \"Y-m-d H:i:s\") when format_type=date|datetime. Default: empty."},"version":{"type":"string","description":"Version ID(s) for this column. Single ID as string (e.g. \"12\") or comma-separated for multiple (e.g. \"12,15\"). Use POST /api/v3/administration/versions/list with class_id. Default: empty (default version)."},"linked_asset_filter":{"type":"string","description":"Controls which linked assets to export for association columns. \"0\"=all linked assets, \"1\" to \"100\"=export only the N-th linked asset, \"cond:attribute_id=value\"=conditional export (only assets matching condition). Default: \"0\" (all assets)."},"group_id":{"type":"integer","description":"0-based index into the groups array. Default: 0."}}}},"groups":{"type":"array","description":"Sheet/workbook groups. Replaces existing groups. (Array of objects - see example for structure)","example":[{"label":"Products","view":"view-column"}],"items":{"type":"object","properties":{"label":{"type":"string","description":"Group/sheet name"},"type":{"type":"string","enum":["classeur"],"description":"Group type. Default: \"classeur\"."},"view":{"type":"string","enum":["view-column","view-line"],"description":"Layout. Default: \"view-column\"."},"section_break_attribute_id":{"type":"string","description":"Attribute ID (as string) used to split the export into sections. A new section is created each time this attribute value changes. Use POST /api/v3/attributes/list. Only used with view=view-line. Default: empty (no break)."},"break_header_attribute_id":{"type":"string","description":"Attribute ID (as string) used as column header in section break mode. Only relevant when section_break_attribute_id is set. Default: empty."},"break_filter_value":{"type":"string","description":"Attribute value filter for section break mode. Only relevant when section_break_attribute_id is set. Default: empty."}}}},"type_ids":{"type":"array","description":"Asset type IDs to export. Use POST /api/v3/types/list with class_id. Default: unchanged.","example":[204,228],"items":{"type":"integer"}},"supertype_ids":{"type":"array","description":"Supertype IDs for grouping. Default: unchanged.","example":[],"items":{"type":"integer"}},"version_ids":{"type":"array","description":"Version IDs to include. Default: unchanged.","example":[1],"items":{"type":"integer"}},"csv_options":{"type":"object","description":"CSV/TXT format options. Fields not provided keep their current value.","example":{"field_separator":";","text_qualifier":"dq"},"properties":{"field_separator":{"type":"string","description":"Column separator. Default: \";\""},"text_qualifier":{"type":"string","description":"\"dq\" (double quote), \"sq\" (single quote), \"no\" (none). Default: \"dq\"","enum":["dq","sq","no"]},"line_ending":{"type":"string","description":"\"lf\" (Unix), \"cr\" (Mac), \"crlf\" (Windows). Default: \"lf\"","enum":["lf","cr","crlf"]},"assoc_separator":{"type":"string","description":"Multi-value separator. Default: \"\\n\""},"split_line_assoc":{"type":"array","description":"Attribute IDs of associations to split into separate rows. Default: empty","items":{"type":"integer"}},"split_line":{"type":"array","description":"Column indices (1-based) to split into separate rows. Default: empty","items":{"type":"integer"}},"split_line_separator":{"type":"string","description":"Separator used to split multi-value fields into rows. Default: empty"}}},"row_options":{"type":"object","description":"Row/header configuration. Fields not provided keep their current value.","example":{"show_column_headers":true},"properties":{"show_column_headers":{"type":"boolean","description":"Include column header labels row. Default: true"},"header_row_number":{"type":"integer","description":"Row number for headers. Default: 1"},"show_id_fields_row":{"type":"boolean","description":"Include internal field IDs row. Default: false"},"id_fields_row_content":{"type":"string","description":"Content of ID fields row. Default: empty"},"show_id_help_row":{"type":"boolean","description":"Include help/description row. Default: false"},"id_help_row_content":{"type":"string","description":"Content of help row. Default: empty"},"data_start_row":{"type":"integer","description":"Row number where data starts. Default: auto"},"add_id_asset":{"type":"boolean","description":"Add asset ID column. Default: false"},"transpose_enabled":{"type":"boolean","description":"Activate the transposition of transpose_attribute_id (screen checkbox). Default: false"},"transpose_attribute_id":{"type":"string","description":"Attribute ID (as string) to transpose from column to row layout. When set, each value of this attribute becomes a separate row instead of a column. Default: empty (standard column layout)."}}},"display_options":{"type":"object","description":"Display and rendering options. Fields not provided keep their current value.","example":{"display_mode":"libelle"},"properties":{"display_mode":{"type":"string","description":"\"libelle\" (display labels) or \"uname\" (technical attribute codes). Default: \"libelle\"","enum":["libelle","uname"]},"default_suffix_attr":{"type":"integer","description":"Default version variant index for all columns (0-8). 0=default version. Default: none"},"default_format_date":{"type":"string","description":"Default date format for all date columns (e.g. \"d/m/Y\"). Default: empty"},"search_in_repository":{"type":"boolean","description":"Search in repository mode. Default: true"},"sub_object_mode":{"type":"string","description":"JSON export mode: \"label\" exports association values as labels, \"sub_object\" exports them as nested JSON objects. Default: \"label\"","enum":["label","sub_object"]},"max_level_json":{"type":"integer","description":"Max nesting level for JSON exports. Default: 1"},"add_attr_id_suffix":{"type":"boolean","description":"Add attribute ID as suffix to column labels (e.g. \"Product Name-734\"). Especially relevant for tab-type columns. Default: false"},"exclude_empty_fields":{"type":"boolean","description":"Exclude columns with empty values from export output. Default: false"},"exclude_inherited_values":{"type":"boolean","description":"Exclude inherited values from export (only export values directly set on the asset). Default: false"}}},"afs_format_options":{"type":"object","description":"Global format options for AFS calculated fields.","example":{"format_round":"round"},"properties":{"format_type":{"type":"string","description":"Global AFS format type, as offered by the export screen: \"\" (none, default), \"text\", \"alphanum\", \"alpha\", \"integer\", \"decimal\", \"date\", \"datetime\", \"email\". An invalid value returns the list of accepted values."},"format_decimal":{"type":"string","description":"Global decimal precision. Default: empty"},"format_round":{"type":"string","description":"Global rounding mode. Default: \"round\"","enum":["round","down","up"]},"format_date":{"type":"string","description":"Global AFS date format. Default: \"d/m/Y\""}}},"file_options":{"type":"object","description":"File output options.","example":{"file_name":"export_{$current_time}"},"properties":{"file_name":{"type":"string","description":"Custom file name. Supports {$current_time}. Default: auto-generated"},"split_file_nb_assets":{"type":"integer","description":"Split export every N assets. Default: none"},"translate_labels_lang":{"type":"integer","description":"Language version ID for translating column header labels. Use POST /api/v3/administration/versions/list with class_id. Set to -1 to disable. Must be combined with translate_labels=true. Default: -1 (no translation)"},"translate_labels":{"type":"boolean","description":"Activate label translation. Must be true for translate_labels_lang to take effect. Default: false"},"sheet_name":{"type":"string","description":"Excel sheet name. Only used with XLSX export format, ignored for other formats. Default: empty"},"export_permanent_urls":{"type":"boolean","description":"Use signed/permanent URLs for media. Default: false"},"split_file":{"type":"boolean","description":"Split the export into several files of split_file_nb_assets assets (CSV, TXT, JSON). Default: true when split_file_nb_assets is set, otherwise false"},"xls_validators":{"type":"boolean","description":"XLSX: add input limits and lists of values to the cells (enriched Excel). Default: false"},"xls_remove_empty_columns":{"type":"boolean","description":"XLSX: remove the columns without any value. Default: false"},"attachments_single_folder":{"type":"boolean","description":"Exported files (file_attributes): put all files in a single folder. Default: false"},"attachments_transfer_file":{"type":"boolean","description":"Exported files: deliver them through a transfer file. Default: false"},"transfer_file_without_csv":{"type":"boolean","description":"With attachments_transfer_file: do not include the data file in the transfer. Default: false"},"compress_zip":{"type":"boolean","description":"Compress the export in a ZIP file. Default: false"},"linked_image_formats":{"type":"object","description":"Image format to export for the assets of each linked library, keyed by library ID, e.g. {\"16\": \"src_HIGH\"}. Values: src_original, a format folder (src_<FORMAT>) or xlsThumb (XLSX thumbnail). Use POST /api/v3/administration/classes/list. Default: empty"}}},"json_options":{"type":"object","description":"JSON / JSON Composed export options (screen \"JSON options\").","example":{"advanced":true,"version_key":"language_code"},"properties":{"advanced":{"type":"boolean","description":"Advanced JSON: values grouped by version (language). Default: false"},"version_key":{"type":"string","description":"With advanced: key of each version in the JSON. version_id (1), language_code (fr) or localisation (fr-FR). Default: none","enum":["version_id","language_code","localisation"]},"afs_format_for_objects":{"type":"boolean","description":"Apply the AFS formatting to the linked objects. Default: false"},"linked_library_attribute_sets":{"type":"object","description":"JSON Composed: attribute set (display preference ID) to export for the linked assets of each library, keyed by library ID, e.g. {\"16\": 33}. Default: empty"}}},"xml_options":{"type":"object","description":"XML export options.","example":{"afs_format_for_objects":true},"properties":{"afs_format_for_objects":{"type":"boolean","description":"Apply the AFS formatting to the linked objects. Default: false"}}},"file_attributes":{"type":"array","description":"File/attachment attributes to export. Accepts either simple attribute IDs (integers) or objects with format/afs/version. Default: unchanged.","example":[{"attribute_id":734,"format":"jpg"},891],"items":{"oneOf":[{"type":"integer","description":"Attribute ID (uses original format)"},{"type":"object","properties":{"attribute_id":{"type":"integer","description":"File attribute ID"},"format":{"type":"string","description":"Export format: \"original\", \"jpg\", \"png\", etc. Default: \"original\"."},"afs":{"type":"string","description":"AFS/Smarty code for file processing. Default: empty"},"version":{"type":"string","description":"Version ID(s) for this file attribute. Default: empty"}}}]}},"file_format_overrides":{"type":"object","description":"Format overrides per attribute ID. Default: unchanged.","example":[]},"image_path_overrides":{"type":"object","description":"Path overrides per attribute ID. Default: unchanged.","example":[]},"lca":{"type":"array","description":"User/group asset IDs for access control (sharing). Controls which users or groups can see and use this mapping. Default: unchanged.","example":[],"items":{"type":"integer"}},"search":{"type":"object","description":"Embedded search criteria. Replaces existing search config. When enabled, the export automatically filters assets. Set enabled=false to remove embedded search.","example":{"enabled":true,"conditions":[{"fields":["4105"],"operator":"isnotnull","link":"","value":"","split_words":false}]},"properties":{"enabled":{"type":"boolean","description":"Activate embedded search. Set to false to disable/remove search. Default: unchanged"},"filters":{"type":"object","description":"Global search filters.","properties":{"classified":{"type":"boolean","description":"Filter on classified assets only. Default: false"},"unclassified":{"type":"boolean","description":"Filter on unclassified assets only. Default: false"},"orphan":{"type":"boolean","description":"Filter on orphan assets only. Default: false"},"duplicates":{"type":"boolean","description":"Filter on duplicate assets only. Default: false"},"lca":{"type":"string","description":"Comma-separated node IDs to restrict search scope. Default: empty"},"time":{"type":"string","description":"Start modification date filter (format: \"d/m/Y\"). Default: empty"},"timeend":{"type":"string","description":"End modification date filter. Default: empty"},"creatime":{"type":"string","description":"Start creation date filter. Default: empty"},"creatimeend":{"type":"string","description":"End creation date filter. Default: empty"}}},"conditions":{"type":"array","description":"Search conditions (attribute-level filters). (Array of objects - see example for structure)","items":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"string"},"description":"Attribute ID(s) to search on. Required for a new condition (a condition without attribute makes the search fail and return no asset); a condition already saved without attribute can be sent back as is."},"operator":{"type":"string","description":"Search operator: \"isnotnull\", \"isnull\", \"is\", \"isnot\", \"contain\", \"notcontain\", \"start\", \"end\", \"sup\", \"inf\", \"supegal\", \"infegal\", \"between\""},"value":{"type":"string","description":"Search value. Default: empty"},"value2":{"type":"string","description":"Second value (for \"between\"). Default: empty"},"link":{"type":"string","enum":["","and","or"],"description":"Logical connector with previous condition."},"split_words":{"type":"boolean","description":"Search each word separately. Default: false"}}}},"associated_data_conditions":{"type":"string","description":"Associated data search conditions. Default: empty"}}}},"required":["id"]}}}}}},"/api/v3/mappings/update-import/":{"post":{"tags":["mappings"],"summary":"update-import — Update an existing import mapping","description":"## Purpose\n\nUpdates an existing import mapping configuration. All parameters except `id` are optional — only provided fields are updated.\n\n## Behavior\n\n- The mapping must exist and be of type \"import\".\n- If `column_mappings` is provided, it **replaces** the entire column mapping list (no partial merge).\n- If `groupings` is provided, it **replaces** the entire groupings list.\n- If `import_options` is provided, it **replaces** the entire import options block.\n- If `import_mode` is changed, all mode-specific validations are re-applied (keys, groupings, etc.) and incompatible existing options are automatically dropped.\n- `label` may be the label of another import mapping of the library, as in the import screen.\n- Non-provided fields keep their existing values.\n\n## Import Modes\n\n| Mode | Internal Code | Description |\n|------|--------------|-------------|\n| create_only | insertOnly | Create new records only |\n| update_only | updateOnly | Update existing records only |\n| create_and_update | insertUpdateOnly | Create new and update existing records |\n| update_asset_type | updateCateg | Only update the record type |\n| create_in_project | insertOnlyInPosition | Create records in a specific project node |\n| update_in_project | updateInPosition | Update records in a specific project node |\n| classify_only | none | Classify records without modifying data |\n\n## Reconciliation Keys\n\n- **Primary key** (`is_key: true`): One column must be marked as primary key for update/hybrid modes. This attribute is used to find existing records.\n- **Secondary key** (`is_secondary_key: true`): Additional keys for multi-criteria reconciliation.\n- Keys are NOT required for `create_only` and `create_in_project` modes.\n\n## Column Mappings\n\nEach column maps a file column (by index) to an Afineo attribute (by ID). Special attribute values:\n- Integer attribute IDs: Use `POST /api/v3/attributes/list` with class_id to discover\n- `\"typeFiche\"` (string): Maps the column to the record type field\n- System field strings: `\"[ID_NODE]\"`, `\"[ID_FICHE]\"`, `\"[ID_TYPE]\"`, `\"[CODE_TYPE]\"` (type portable code), `\"[PAGENUM]\"`, `\"[PARENT]\"`, `\"[LABEL_TYPE]\"`, `\"[ID_STATUT]\"` (status ID), `\"[CODE_STATUT]\"` (status portable code), `\"[LABEL_STATUT]\"` (status label, recommended), `\"[STATUT]\"` (legacy synonym of [LABEL_STATUT]), `\"[ID_WFITEMS]\"`, `\"[LABEL_WFITEMS]\"`, `\"[CODE_WFITEMS]\"` (workflow step portable code), `\"[ORDRE]\"`, `\"[LABEL_ATTRIBUTE]\"` (requires value_column_index), `\"[ATTRIBUTE_CODE]\"` (requires value_column_index), `\"[ATTRIBUTE_ID]\"` (requires value_column_index)\n- `\"-1\"` (string): Ignore this column entirely\n\n## Column Conditions\n\nEach column can have an optional import condition that filters which rows are processed:\n- `isnotnull`: Import only if this column is not empty\n- `isnull`: Import only if this column is empty\n- `equals`/`not_equals`: Value comparison (requires condition_value)\n- `contains`/`not_contains`: Substring match (requires condition_value)\n- `starts_with`/`not_starts_with`: Prefix match (requires condition_value)\n- `greater_than`/`less_than`: Numeric comparison (requires condition_value)\n\n## Supported Transformations\n\nSame transformations as the import screen, stored the same way. A type whose format is inactive on the instance is rejected.\n\n| Type | Description | Parameters |\n|------|-------------|------------|\n| uppercase | Convert to uppercase | none |\n| lowercase | Convert to lowercase | none |\n| capitalize | First letter uppercase | none |\n| replace | Search and replace | `search`, `replace` (one rule), or `rules`: one `search=replace` rule per line, `REGEX:pattern=replace` for a regular expression, a literal `=` written `==` |\n| prefix | Add prefix to value | value |\n| suffix | Add suffix to value | value |\n| afs | Compute a new value with an AfineoScript | script |\n\n## Permissions\n\n- Requires the \"Import\" right (`fiche::lca_import`) or the \"Manage mappings\" right (`fiche::lca_manage_mappings`); both are always granted to admins.\n- Requires access to the mapping library.\n- Access to the mapping, as in the \"Replace a mapping\" list of the import screen: a mapping without profile restriction (empty, 0 or \"/\"), a mapping created by the user, a mapping whose `lca` contains the user ID, or a mapping allowed to one of the user's profiles. Admins can update any mapping except another user's private mapping.\n\n## Common Errors\n\n- `Mapping \"X\" not found` — invalid mapping ID\n- `Mapping \"X\" is not an import mapping (type: Y)` — wrong mapping type\n- `Label cannot be empty` — label parameter is blank\n- `Invalid import_mode` — mode not in the allowed enum\n- `A key column is required for mode X` — update/hybrid modes need a primary key\n- `column_mappings[N] requires column_index` — missing column index\n- `column_mappings[N].column_index must be a positive integer` — invalid column index\n- `Attribute X does not exist` — attribute_id not found in system\n- `Attribute X does not belong to library Y` — attribute not in the mapping's library\n- Permission denied (status_code=997) — missing right, or no access to the library or to the mapping\n\n## Discovery Endpoints\n\n- Existing mappings: `POST /api/v3/mappings/list` with class_id and type=import\n- Mapping details: `POST /api/v3/mappings/get` with id (use as template)\n- Libraries: `POST /api/v3/administration/classes/list`\n- Attributes: `POST /api/v3/attributes/list` with class_id\n- Asset types: `POST /api/v3/types/list` with class_id\n- Versions/languages: `POST /api/v3/administration/versions/list` with class_id\n- Statuses: `POST /api/v3/permissions/statuses/list` with class_id\n\n## Errors\n\n- `2` : `A key column (is_key: true) is required for mode …`\n- `2` : `At least one column mapping is required`\n- `2` : `Failed to update import mapping (XML validation failed)`\n- `2` : `Invalid import_mode: …. Valid modes: …`\n- `2` : `Label cannot be empty`\n- `2` : and 61 other validation message(s) of the same family\n- `997` : `You don't have the rights to do this action`\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Import mapping update response","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"result":{"type":"object","properties":{"id":{"type":"integer","example":215,"description":"Updated mapping ID"},"code":{"type":"string","example":"export_products_csv","description":"Portable mapping code, stable across environments"},"updated":{"type":"boolean","example":true,"description":"true if update was applied"}},"required":["id","code","updated"]}}}]},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Mapping ID to update. Use POST /api/v3/mappings/list with class_id and type=import to get available import mappings.","example":215},"label":{"type":"string","description":"New import mapping display name. Several import mappings of a library may share the same label, as in the import screen. If not provided, the existing label is kept.","example":"Import Produits CSV v2"},"code":{"type":"string","description":"New portable code for the mapping. Must start with a letter, then letters, digits and underscores only (no hyphen), 100 characters max, unique across the whole platform. ⚠️ Renaming breaks any external reference to the previous code.","example":"import_products_csv"},"import_mode":{"type":"string","description":"Import behavior mode. If not provided, the existing mode is kept. Changing mode triggers re-validation of all mode-specific parameters.","enum":["create_only","update_only","create_and_update","update_asset_type","create_in_project","update_in_project","classify_only"],"example":"create_and_update"},"column_mappings":{"type":"array","description":"Mapping of file columns to Afineo attributes. Replaces the entire column mapping list. At least one column required if provided. (Array of objects - see example for structure)","example":[{"column_index":1,"attribute_id":734,"is_key":true},{"column_index":2,"attribute_id":856,"update_mode":"add"}],"items":{"type":"object","properties":{"column_index":{"type":"integer","description":"Column index in file (1-indexed: 1=column A, 2=column B, etc.)."},"attribute_id":{"type":["integer","string"],"description":"Target attribute ID (integer). Use POST /api/v3/attributes/list with class_id to discover. Also accepts the string \"type\" to map the column to the record type field. Omitted, 0 or empty: the file column is kept without attribute (not imported), as the import screen saves it — unlike \"-1\", which marks the column as ignored. As in the import screen: advanced link attributes and the category classification attribute (Categories v2, imported through \"[CATEGORY_LINK]\") are not available, an attribute with a context scope is not available for modes create_only, update_only, create_and_update and update_asset_type, an attribute with a counter is not available for creation modes (create_only, create_and_update, create_in_project), \"[CATEGORY_LINK]\" is only available for modes create_only, update_only and create_and_update, and \"[LABEL_WFITEMS]\" requires the IMPORT_WF_STEP_BY_LABEL extension."},"is_key":{"type":"boolean","description":"Mark as primary reconciliation key. Required for update/hybrid modes. Only one column should be the primary key. Must be an indexed attribute (the import looks records up in the index table) or a system field; \"[CATEGORY_LINK]\" cannot be a key. Default: false."},"is_secondary_key":{"type":"boolean","description":"Mark as secondary reconciliation key for multi-criteria matching. Only available for mode update_in_project, with the import_multiKey extension, on an indexed attribute. Default: false."},"update_mode":{"type":"string","enum":["sync","add"],"description":"How to apply values on existing records. \"sync\" = exact synchronization (replaces existing value entirely). \"add\" = additive (appends to text, adds to multi-value lists/associations). Default: \"sync\"."},"condition":{"type":"string","enum":["isnotnull","isnull","equals","not_equals","contains","not_contains","starts_with","not_starts_with","greater_than","less_than"],"description":"Import condition: only process this column when condition is met. isnotnull=not empty, isnull=empty, equals/not_equals=value comparison, contains/not_contains=substring, starts_with/not_starts_with=prefix, greater_than/less_than=numeric. Default: none (always import)."},"condition_value":{"type":"string","description":"Value to compare against for condition operators (equals, not_equals, contains, not_contains, starts_with, not_starts_with, greater_than, less_than). Ignored for isnotnull/isnull. Default: empty."},"version_id":{"type":"integer","description":"Version ID for multilingual attributes (determines language/channel variant). Use POST /api/v3/administration/versions/list with class_id to get available versions. -1 = default (the mapping version). Default: none (default version)."},"data_mode":{"type":"string","enum":["value","suffix"],"description":"How to interpret the column data. \"value\" = column contains attribute data (default). \"suffix\" = column contains a language/variant suffix identifier. Default: \"value\"."},"association":{"type":"object","description":"Configuration for association/linked data columns. Use when the attribute references records from another library. Also used for [PARENT] system field.","properties":{"target_attribute_id":{"type":"integer","description":"Attribute ID in the linked library to match against (reconciliation key to find linked records). Use POST /api/v3/attributes/list with the linked library class_id. For [PARENT]: attribute ID to match parent records. The record ID attribute (system name asset_id) cannot be used when create_if_not_exists is true."},"target_asset_type_id":{"type":"integer","description":"For [PARENT]: supertype ID of the parent records (type_type, e.g. 7 = Article)."},"create_if_not_exists":{"type":"boolean","description":"If true, create the linked record when not found (create and link). If false, only link to existing records. Default: false. Not applicable for [PARENT]."},"create_asset_type_id":{"type":"integer","description":"Record type ID to use when creating linked records (used with create_if_not_exists). Use POST /api/v3/types/list with the linked library class_id. Default: none."},"cross_reference_columns":{"type":"object","description":"Cross-reference column mappings for importing additional attributes of the linked record from other file columns. Maps attribute IDs of the linked library to file column indices (1-indexed). Format: {\"attribute_id\": column_index}. Example: {\"856\": 5} means column 5 provides the value for attribute 856 of the linked record.","additionalProperties":true}}},"value_column_index":{"type":"integer","description":"For [LABEL_ATTRIBUTE], [ATTRIBUTE_CODE], [ATTRIBUTE_ID] system fields: column index (1-indexed, same as column_index) containing the actual data value. Required when attribute_id is one of these dynamic attribute system fields."},"suffix_column_index":{"type":"integer","description":"For [LABEL_ATTRIBUTE], [ATTRIBUTE_CODE], [ATTRIBUTE_ID]: column index (1-indexed) containing the suffix/variant identifier. Optional."},"version_column_index":{"type":"integer","description":"For [LABEL_ATTRIBUTE], [ATTRIBUTE_CODE], [ATTRIBUTE_ID]: column index (1-indexed) containing the version identifier. Optional."},"is_characteristic":{"type":"boolean","description":"Mark as associated characteristic column. Requires ATTR_CARAC extension. Default: false."},"transformations":{"type":"array","description":"Transformations to apply on imported value before saving.","items":{"type":"object","properties":{"type":{"type":"string","enum":["uppercase","lowercase","capitalize","replace","prefix","suffix","afs"],"description":"Transformation type."},"params":{"type":"object","description":"Transformation parameters. For replace: {search, replace} or {rules} (one search=replace rule per line, REGEX: prefix for a regular expression). For prefix/suffix: {value}. For afs: {script}."}}}}}}},"source_config":{"type":"object","description":"Source file configuration (CSV/Excel row settings). Replaces existing source config.","example":{"header_row":1,"data_start_row":2},"properties":{"header_row":{"type":"integer","description":"Row number containing column headers (1-indexed). 0: the file has no header row. Default: 1."},"attribute_row":{"type":"integer","description":"Row number containing attribute codes. Default: same as header_row."},"data_start_row":{"type":"integer","description":"Row number where data starts. Default: 2."},"worksheet_name":{"type":"string","description":"Excel worksheet name to use. Default: first sheet."}}},"csv_options":{"type":"object","description":"CSV/TXT file parsing options. Replaces existing CSV options.","example":{"column_separator":";","field_delimiter":"\""},"properties":{"column_separator":{"type":"string","description":"Column/field separator character. Default: \";\" (semicolon)."},"field_delimiter":{"type":"string","description":"Field enclosure/delimiter character. Default: '\"' (double quote)."}}},"default_version_id":{"type":"integer","description":"Default version ID applied to all columns that don't have a specific version_id set. Determines which language/channel variant to import into. Use POST /api/v3/administration/versions/list with class_id. -1 = default (the project version, or per record). If not provided, existing value is kept. Not available for update_asset_type and classify_only modes.","example":1},"default_status_id":{"type":"integer","description":"Default status (LCA) ID applied to imported records. Use POST /api/v3/permissions/statuses/list with class_id to get available statuses. If not provided, existing value is kept. Not available for update_asset_type mode.","example":0},"asset_type_id":{"type":"integer","description":"Default record type ID for created records, for creation modes (create_only, create_and_update, create_in_project). Optional: the type can also come from the caller of the import (a process action) or from a type column of the file; without any of them, each row to create is rejected. Use POST /api/v3/types/list with class_id. If not provided, existing value is kept.","example":25},"import_options":{"type":"object","description":"Advanced import behavior options. Replaces existing import options.","example":{"reindex_after":true},"properties":{"force_context":{"type":"boolean","description":"Force context during import. Default: false."},"reindex_after":{"type":"boolean","description":"Trigger reindexation after import. Default: false."},"move_if_exists":{"type":"boolean","description":"Move existing record to new location if found. Default: false."},"as_suggestions":{"type":"boolean","description":"Import values as suggestions (pending approval). Requires the proposals option of the library. Default: false."},"filter_by_asset_type_id":{"type":"integer","description":"Only process records of this supertype ID (type_type, e.g. 2 = Record, 7 = Article, 8 = Product variation). Default: none (all supertypes)."},"no_merge_lines":{"type":"boolean","description":"Do not merge multiple rows with same key into one record. Requires the import_allowNotMergeLines extension. Default: false."},"no_auto_child_links":{"type":"boolean","description":"Disable automatic child link creation. Default: false."},"characteristic_attribute_id":{"type":"integer","description":"Attribute ID to use as characteristic pivot (requires ATTR_CARAC extension). This attribute becomes the characteristic grouping key. Use POST /api/v3/attributes/list with class_id. Default: none."},"characteristic_mode":{"type":"integer","description":"How to handle characteristic columns. 1=apply to all unaffected attributes automatically, 2=apply only to columns explicitly marked with is_characteristic. Default: 1. Only used when characteristic_attribute_id is set.","enum":[1,2]}}},"groupings":{"type":"array","description":"Hierarchy/grouping levels for tree-based imports (classify_only, create_in_project, update_in_project modes, or when allowArboHierarchy is enabled). Each level defines a folder structure. Replaces existing groupings. Not available for update_asset_type mode. (Array of objects - see example for structure)","example":[{"level":1,"asset_type_id":85,"fields":[{"column_index":1,"attribute_id":231}]}],"items":{"type":"object","properties":{"level":{"type":"integer","description":"Grouping level number (1-based, sequential)."},"asset_type_id":{"type":"integer","description":"Asset type/category ID for this grouping level. Use POST /api/v3/types/list with class_id."},"fields":{"type":"array","description":"Column-to-attribute mappings for this level.","items":{"type":"object","properties":{"column_index":{"type":"integer","description":"File column index (1-indexed)."},"attribute_id":{"type":"integer","description":"Target attribute ID."},"is_key":{"type":"boolean","description":"Mark as key field. Default: false."}}}}}}},"lca":{"type":"array","description":"User/group asset IDs for access control. Default: unchanged.","example":[],"items":{"type":"integer"}}},"required":["id"]}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token generated with /api/v3/token/get/"}},"schemas":{"SuccessEnvelope":{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","enum":[1],"example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"","description":"Status message"}},"required":["status_code","status_message","result"]},"ErrorResponse":{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":3,"description":"Status code (0 = the action does not exist, 2 = parameter error, 3 = no result, 997 = unauthorized action, 998 = invalid token, 999 = connection error)"},"status_message":{"type":"string","example":"Class not found or access denied","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]},"ExportPage":{"type":"object","properties":{"results_total":{"type":"integer","example":15,"description":"Total number of items"},"items":{"type":"array","items":{"type":"object"},"description":"Export data"},"num_page":{"type":"integer","nullable":true,"example":1,"description":"Current page number"},"nb_pages":{"type":"integer","nullable":true,"example":15,"description":"Total number of pages"},"results_per_page":{"type":"integer","nullable":true,"example":100,"description":"Number of results per page"}},"required":["results_total","items"],"description":"Export result"},"ExportJobQueued":{"type":"object","properties":{"queue_id":{"type":"integer","example":47593,"description":"Queue ID for async file retrieval via export/get-file"}},"required":["queue_id"],"description":"Queue information"},"ImportAutoResult":{"type":"object","properties":{"success":{"type":"boolean","example":true,"description":"Import success status"},"mapping":{"type":"object","properties":{"resolved":{"type":"array","items":{"type":"object","properties":{"column":{"type":"integer","example":1,"description":"Column index (1-based)"},"header":{"type":"string","example":"reference*","description":"Original column header from file"},"attribute_id":{"type":"integer","nullable":true,"example":145,"description":"Matched attribute ID. Null if mapped to a system field."},"attribute_code":{"type":"string","example":"reference","description":"Portable attribute code (ROLE_XML), stable across environments (the auto-incremented id is not). Only present for attribute mappings."},"attribute_label":{"type":"string","example":"Reference","description":"Matched attribute label. Only present for attribute mappings."},"system_field":{"type":"string","nullable":true,"example":"[ID_FICHE]","description":"System field identifier. Only present for system field mappings. Full list: [ID_FICHE], [ID_NODE], [ID_TYPE], [CODE_TYPE], [LABEL_TYPE], [ID_STATUT], [CODE_STATUT], [LABEL_STATUT], [STATUT] (legacy synonym of [LABEL_STATUT]), [ID_WFITEMS], [CODE_WFITEMS], [LABEL_WFITEMS], [ORDRE], [PARENT], [PAGENUM]. The [CODE_*] forms are the portable ones: they are stable across environments, unlike the ids, and not translated, unlike the labels."},"is_key":{"type":"boolean","example":true,"description":"Whether this column is marked as a key column (header ends with *)"}}},"description":"Columns successfully mapped to attributes or system fields"},"unresolved":{"type":"array","items":{"type":"object","properties":{"column":{"type":"integer","example":3,"description":"Column index (1-based)"},"header":{"type":"string","example":"unknown_column","description":"Column header that could not be matched to any attribute"}}},"description":"Columns that could not be mapped (no matching uname or label found in the class)"}},"description":"Mapping information"},"stats":{"type":"object","properties":{"total_rows":{"type":"integer","example":1500,"description":"Total number of data rows processed"},"created":{"type":"integer","example":1200,"description":"Number of assets created"},"updated":{"type":"integer","example":300,"description":"Number of assets updated"},"excluded":{"type":"integer","example":0,"description":"Number of rows excluded (no key value)"},"errors":{"type":"integer","example":0,"description":"Number of rows with errors"}},"required":["total_rows","created","updated","excluded","errors"],"description":"Import statistics"},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","description":"Row number"},"message":{"type":"string","description":"Error message"}}},"description":"List of row-level errors"},"history_id":{"type":"integer","example":12345,"description":"ID of the import action in the history log. Can be used to track or reference this import operation."}},"required":["success","mapping","stats","errors"],"description":"Import result"},"ImportJsonResult":{"type":"object","properties":{"success":{"type":"boolean","example":true,"description":"Import success status"},"stats":{"type":"object","properties":{"total_rows":{"type":"integer","example":2,"description":"Total number of data rows processed"},"created":{"type":"integer","example":1,"description":"Number of assets created"},"updated":{"type":"integer","example":1,"description":"Number of assets updated"},"excluded":{"type":"integer","example":0,"description":"Number of rows excluded (no key value)"},"errors":{"type":"integer","example":0,"description":"Number of rows with errors"}},"required":["total_rows","created","updated","excluded","errors"],"description":"Import statistics"},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","example":3,"description":"Row number where error occurred"},"message":{"type":"string","example":"Invalid attribute ID: 999","description":"Error message describing the issue"}}},"example":[{"row":3,"message":"Invalid attribute ID: 999"}],"description":"List of row-level errors encountered during import"},"history_id":{"type":"integer","example":12345,"description":"ID of the import action in the history log"},"mapping":{"type":"object","additionalProperties":true,"description":"Column-to-attribute mapping actually applied, always returned : the JSON endpoints share executeAutoImport() with the auto_* endpoints. Same shape as ImportAutoResult.mapping (resolved[] / unresolved[])."}},"required":["success","mapping","stats","errors"],"description":"Import result"},"PermissionGroup":{"type":"object","properties":{"id":{"type":"integer","example":15,"description":"Group ID"},"label":{"type":"string","example":"My group","description":"Group label"},"parent_id":{"type":"integer","example":1511,"description":"Parent group ID"},"parent_label":{"type":"string","example":"My group parent","description":"Parent group label"},"configuration":{"type":"object","properties":{"langs":{"type":"object","additionalProperties":true,"example":{"all_versions":true},"description":"Multilingual"},"default_display_mask":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":1032,"description":"Mask ID"},"code":{"type":"string","example":"mask_purchasing","description":"Portable mask code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"A mask","description":"Mask label"}},"description":"Default display mask of the group. Use `code` rather than `id` to replay this configuration on another environment."},"profiles":{"type":"object","description":"Profiles of the group, one per type. Use `code` rather than `id` to replay this configuration on another environment.","properties":{"asset":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":35,"description":"Profile ID"},"code":{"type":"string","example":"profile_full_rights","description":"Portable profile code"},"label":{"type":"string","example":"Full rights","description":"Profile label"}},"description":"Asset profile"},"general":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":33,"description":"Profile ID"},"code":{"type":"string","example":"profile_full_rights","description":"Portable profile code"},"label":{"type":"string","example":"Full rights","description":"Profile label"}},"description":"General profile"},"project":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":34,"description":"Profile ID"},"code":{"type":"string","example":"profile_full_rights","description":"Portable profile code"},"label":{"type":"string","example":"Full rights","description":"Profile label"}},"description":"Project profile"}}},"status":{"type":"array","items":{"type":"object","properties":{"class_id":{"type":"integer","example":2,"description":"Class ID"},"class_code":{"type":"string","example":"lib_products","description":"Portable library code, stable across environments (the auto-incremented id is not)"},"class_label":{"type":"string","example":"DAM","description":"Class label"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":1093,"description":"Status ID"},"code":{"type":"string","example":"status_active","description":"Portable status code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"Active","description":"Status label"}},"required":["id","code","label"]},"description":"Statuses granted to the group for this library. Use `code` rather than `id` to replay this configuration on another environment."}},"required":["class_id","class_code","class_label","items"]},"description":"Status list"},"overload_by_status":{"type":"array","items":{"type":"object","properties":{"class_id":{"type":"integer","example":2,"description":"Class ID"},"class_code":{"type":"string","example":"lib_products","description":"Portable library code, stable across environments (the auto-incremented id is not)"},"class_label":{"type":"string","example":"DAM","description":"Class label"},"items":{"type":"array","items":{"type":"object","properties":{"status":{"type":"object","properties":{"id":{"type":"integer","example":1111,"description":"Status ID"},"code":{"type":"string","example":"status_proposed","description":"Portable status code, stable across environments"},"label":{"type":"string","example":"Proposed","description":"Status label"}},"required":["id","code","label"],"description":"Status the overload applies to"},"profile_asset":{"type":"object","properties":{"id":{"type":"integer","example":53,"description":"Profile ID, 0 when the overload does not set a profile"},"code":{"type":"string","example":"profile_contributor","description":"Portable profile code, empty when the overload does not set a profile"},"label":{"type":"string","example":"Profile test","description":"Profile label, \"Default\" when the overload does not set a profile"}},"description":"Overloaded asset profile"},"mask":{"type":"object","properties":{"id":{"type":"integer","example":1064,"description":"Mask ID, 0 when the overload does not set a mask"},"code":{"type":"string","example":"mask_full_display","description":"Portable mask code, empty when the overload does not set a mask"},"label":{"type":"string","example":"Full display mask","description":"Mask label, \"Default\" when the overload does not set a mask"}},"description":"Overloaded display mask"}},"required":["status","profile_asset","mask"]},"description":"Overloads defined for this library"}},"required":["class_id","class_code","class_label","items"]},"description":"Overloaded by status"}},"required":["langs","default_display_mask","profiles","status","overload_by_status"],"description":"Group configuration (langs, default display mask, profiles, statuses and overload by status)"},"users":{"type":"object","additionalProperties":{"type":"string"},"example":{"2187":"login@company.com"},"description":"Users in group"}},"required":["id","label","parent_id","parent_label","configuration","users"]},"DisplayMask":{"type":"object","properties":{"id":{"type":"integer","example":1025,"description":"Mask ID"},"code":{"type":"string","example":"code_1025","description":"Portable mask code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"Standard mask","description":"Mask label"},"class_id":{"type":"integer","example":2,"description":"Class ID"},"class_code":{"type":"string","example":"lib_products","description":"Portable library code, stable across environments (the auto-incremented id is not)"},"class_label":{"type":"string","example":"DAM","description":"Class label"},"attributes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":123,"description":"Attribute ID"},"code":{"type":"string","example":"product_name","description":"Portable attribute code (ROLE_XML), stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"Product name","description":"Attribute label"},"hidden":{"type":"boolean","example":false,"description":"Whether attribute is hidden"},"read":{"type":"boolean","example":true,"description":"Whether attribute is readable"},"write":{"type":"boolean","example":true,"description":"Whether attribute is writable"},"locally_editable":{"type":"boolean","example":false,"description":"Whether attribute is locally editable (asset share)"}},"required":["id","code","label","hidden","read","write","locally_editable"]},"description":"Attributes configuration for the class"}},"required":["id","code","label","class_id","class_code","class_label","attributes"]},"WorkflowSummary":{"type":"object","properties":{"id":{"type":"integer","example":15,"description":"Workflow ID"},"code":{"type":"string","example":"","description":"Workflow code"},"label":{"type":"string","example":"Workflow validation","description":"Workflow label"},"class_id":{"type":"integer","example":4,"description":"Class ID"},"project_node_id":{"type":"integer","example":1234,"description":"Project node ID (0 for the repository project)"},"project_label":{"type":"string","example":"My Project","description":"Project label (\"Repository Project\" for the repository)"},"tags":{"type":"array","items":{"type":"string"},"example":["validation","review"],"description":"Array of tags (can be empty)"},"supertype":{"type":"object","properties":{"id":{"type":"integer","example":3,"description":"Supertype ID"},"label":{"type":"string","example":"Products","description":"Supertype label"}},"required":["id","label"],"description":"Supertype information"},"types":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","example":"type_product","description":"Portable type code, stable across environments (the auto-incremented id is not)"},"id":{"type":"integer","example":42,"description":"Type ID"},"label":{"type":"string","example":"Product","description":"Type label"}},"required":["id","code","label"]},"description":"Array of asset types associated with this workflow"}},"required":["id","code","label","class_id","project_node_id","project_label","tags","supertype","types"],"description":"Workflow information without its steps"},"WorkflowSummaryList":{"type":"object","properties":{"results_total":{"type":"integer","example":2,"description":"Total number of workflows returned"},"items":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowSummary"},"description":"Array of workflow objects"}},"required":["results_total","items"]},"Workflow":{"type":"object","properties":{"id":{"type":"integer","example":15,"description":"Workflow ID"},"code":{"type":"string","example":"","description":"Workflow code"},"label":{"type":"string","example":"Workflow validation","description":"Workflow label"},"tags":{"type":"array","items":{"type":"string"},"example":["validation","review"],"description":"Array of tags (can be empty)"},"class_id":{"type":"integer","example":4,"description":"Associated class ID"},"project_node_id":{"type":"integer","example":1234,"description":"Project node ID (0 for repository project)"},"project_label":{"type":"string","example":"My Project","description":"Project label"},"started":{"type":"boolean","example":true,"description":"Whether the workflow is started"},"filters":{"type":"array","nullable":true,"items":{"type":"object","properties":{"attribute_id":{"type":"integer","example":123,"description":"Attribute ID. Use POST /api/v3/attributes/list with class_id to get available attributes."},"attribute_code":{"type":"string","example":"product_name","description":"Portable attribute code (ROLE_XML), stable across environments (the auto-incremented id is not)"},"attribute_label":{"type":"string","example":"Status","description":"Attribute label"},"value":{"type":"string","example":"active","description":"Filter value"}}},"description":"Workflow filters (array of filter objects or null)"},"supertype":{"type":"object","properties":{"id":{"type":"integer","example":3,"description":"Supertype ID"},"label":{"type":"string","example":"Products","description":"Supertype label"}},"required":["id","label"],"description":"Supertype information"},"types":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","example":"type_product","description":"Portable type code, stable across environments (the auto-incremented id is not)"},"id":{"type":"integer","example":42,"description":"Type ID"},"label":{"type":"string","example":"Product","description":"Type label"}},"required":["id","code","label"]},"description":"Array of asset types associated with this workflow"},"configuration":{"type":"object","properties":{"step_groups":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStepGroup"},"description":"Array of step groups containing steps with their nested data"}},"required":["step_groups"],"description":"Workflow configuration containing step groups hierarchy"}},"required":["id","code","label","class_id","project_node_id","project_label","tags","supertype","types","started","configuration"],"description":"Complete workflow information with hierarchical structure"},"WorkflowStepGroup":{"type":"object","properties":{"id":{"type":"integer","example":1,"description":"Step group ID"},"code":{"type":"string","example":"group_validation","description":"Portable step group code. Unique within the workflow (not across the platform)."},"label":{"type":"string","example":"Validation","description":"Step group label"},"order":{"type":"integer","example":1,"description":"Display order"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"},"description":"Array of steps in this group"}},"required":["id","code","label","order","steps"]},"WorkflowStep":{"type":"object","properties":{"id":{"type":"integer","example":101,"description":"Step ID"},"code":{"type":"string","example":"step_draft","description":"Portable step code. Unique within the workflow (not across the platform). This is the value expected in the \"wf-{workflowCode}-{stepCode}\" format used to force a workflow step."},"label":{"type":"string","example":"Draft","description":"Step label"},"order":{"type":"integer","example":1,"description":"Display order"},"color":{"type":"string","nullable":true,"example":"#28a745","description":"Step color"},"start":{"type":"boolean","example":false,"description":"Whether this is a start step"},"notification":{"type":"object","nullable":true,"properties":{"mail_template_id":{"type":"integer","example":5,"description":"Mail template ID"},"mail_template_code":{"type":"string","example":"code_5","description":"Portable code of the mail template, stable across environments (the auto-incremented id is not)"},"mail_template_label":{"type":"string","example":"Validation notification","description":"Mail template label"}},"description":"Notification configuration (null if not configured)"},"delay_days":{"type":"integer","nullable":true,"example":7,"description":"Delay in days for the step"},"workflow_action_on_arrival":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":536,"description":"Process ID triggered when an asset reaches this step"},"code":{"type":"string","example":"code_536","description":"Portable process code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"Create vendor component","description":"Process label"}},"required":["id","code","label"],"description":"Process triggered on arrival at this step (null if none)"},"contributors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":5,"description":"Contributor group ID"},"code":{"type":"string","example":"group_validators","description":"Portable contributor group code. Unique within the project (not across the platform)."},"label":{"type":"string","example":"Validation Group","description":"Contributor group label"}},"required":["id","code","label"]},"description":"Array of contributors for this step"},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":201,"description":"Action ID"},"code":{"type":"string","example":"action_validate","description":"Portable action (button) code. Unique within the workflow (not across the platform)."},"label":{"type":"string","example":"Validate","description":"Action label"},"goto_step":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":102,"description":"Destination step ID"},"code":{"type":"string","example":"step_validated","description":"Portable step code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"Validated","description":"Destination step label"}},"required":["id","code","label"],"description":"Destination step (null if no destination)"},"mode":{"type":"string","enum":["send_the_brief","submit","reject","validate"],"example":"validate","description":"Action mode (send_the_brief, submit, reject or validate)"},"display_if_completeness":{"type":"boolean","example":false,"description":"Display button only if all completeness attributes are filled"}},"required":["id","code","label","mode","display_if_completeness"]},"description":"Array of actions for this step"},"completeness":{"type":"object","nullable":true,"properties":{"attributes":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"integer","example":1547,"description":"Attribute ID"},"code":{"type":"string","example":"component_commercial_name","description":"Portable attribute code (ROLE_XML), stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"Component commercial name","description":"Attribute label"}},"required":["id","code","label"]},"description":"Attributes taken into account for completeness"},"automate_goto_step":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":102,"description":"Automatic transition step ID when complete"},"code":{"type":"string","example":"step_validate","description":"Portable step code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"Validate","description":"Automatic transition step label when complete"}},"required":["id","code","label"],"description":"Automatic step transition when completeness is reached"}},"description":"Completeness configuration (null if not configured)"},"hotfolder":{"type":"object","nullable":true,"properties":{"action_on_update":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":201,"description":"Action ID to execute on update"},"code":{"type":"string","example":"action_validate","description":"Portable action code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","example":"Validate","description":"Action label"}},"required":["id","code","label"],"description":"Action to execute when hotfolder is updated (null for no automatic step change)"},"create_version":{"type":"boolean","example":true,"description":"Whether to create a version on update"}},"description":"Hotfolder configuration (null if not configured or not active)"},"status_piloting_view":{"type":"object","properties":{"status":{"type":"object","nullable":true,"properties":{"id":{"type":"integer","example":1234,"description":"Status id"},"code":{"type":"string","example":"status_active","description":"Portable status code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","nullable":true,"example":"Admin Status","description":"Status label"}},"required":["id","code"],"description":"Status configuration (null if not configured)"},"default_view":{"type":"string","nullable":true,"enum":["default","completeness","list"],"example":"completeness","description":"Default view mode (default, completeness, or list)"},"children_piloting":{"$ref":"#/components/schemas/WorkflowChildrenPiloting"}},"description":"Status, piloting and view configuration"},"reminder":{"type":"object","nullable":true,"properties":{"days_before":{"type":"integer","example":7,"description":"Days before deadline to send notification"},"recurrence_days":{"type":"integer","nullable":true,"example":1,"description":"Recurrence interval in days for notifications"}},"description":"Reminder configuration (null if not configured)"}},"required":["id","code","label","order","start","contributors","actions","status_piloting_view"]},"WorkflowChildrenPiloting":{"type":"object","nullable":true,"oneOf":[{"type":"object","title":"Workflow Type","properties":{"type":{"type":"string","enum":["workflow"],"example":"workflow","description":"Children piloting type"},"items":{"type":"array","items":{"type":"object","properties":{"workflow":{"type":"object","properties":{"id":{"type":"integer","example":15,"description":"Target workflow ID"},"code":{"type":"string","example":"code_15","description":"Portable workflow code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","nullable":true,"example":"Child Workflow","description":"Target workflow label"}},"required":["id","code"]},"step":{"type":"object","properties":{"id":{"type":"integer","example":101,"description":"Target step ID"},"code":{"type":"string","example":"step_draft","description":"Portable step code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","nullable":true,"example":"Draft","description":"Target step label"}},"required":["id","code"]}},"required":["workflow","step"]},"description":"Array of workflow step configurations"}},"required":["type","items"]},{"type":"object","title":"Status Type","properties":{"type":{"type":"string","enum":["status"],"example":"status","description":"Children piloting type"},"items":{"type":"array","items":{"type":"object","properties":{"status":{"type":"object","properties":{"id":{"type":"integer","example":123,"description":"Status ID"},"code":{"type":"string","example":"status_active","description":"Portable status code, stable across environments (the auto-incremented id is not)"},"label":{"type":"string","nullable":true,"example":"Active","description":"Status label"}},"required":["id","code"]},"supertypes":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"integer","example":3,"description":"Supertype ID"},"label":{"type":"string","nullable":true,"example":"Products","description":"Supertype label"}},"required":["id"]},"description":"Array of supertypes (null if not configured)"},"types":{"type":"array","nullable":true,"items":{"type":"object","properties":{"code":{"type":"string","example":"type_product","description":"Portable type code, stable across environments (the auto-incremented id is not)"},"id":{"type":"integer","example":42,"description":"Type ID"},"label":{"type":"string","nullable":true,"example":"Product","description":"Type label"}},"required":["id","code"]},"description":"Array of types (null if not configured)"}},"required":["status"]},"description":"Array of status configurations"}},"required":["type","items"]}],"description":"Children piloting configuration (null if not configured)"},"WorkflowList":{"type":"object","properties":{"results_total":{"type":"integer","example":2,"description":"Total number of workflows returned"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Workflow"},"description":"Array of workflow objects with complete information"}},"required":["results_total","items"]}}}}