{"openapi":"3.0.0","info":{"title":"Afineo Webservices API — types","description":"Module `types` of the Afineo API v3 (8 endpoints).\n\nManage asset types (categories) within a library: create types, update properties, configure status assignments and set group permissions. Types define the classification and permission structure for assets.\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":"types","description":"Manage asset types (categories) within a library: create types, update properties, configure status assignments and set group permissions. Types define the classification and permission structure for assets."}],"paths":{"/api/v3/types/assign-attributes/":{"post":{"tags":["types"],"summary":"Sync attribute assignments for a type (add, update, remove)","description":"## Purpose\n\nSynchronizes which attributes are assigned to a record type, along with per-attribute display options. Send the **complete desired state** for this type: the endpoint computes a diff and applies additions, updates, and removals automatically.\n\n## Library Context\n\nThe library (class_id) is automatically derived from the type — no class_id parameter is required. To discover the class_id of a type, call `POST /api/v3/types/get` with the type `id` — the response includes `class_id`.\n\n## Mode (`replace` vs `add`)\n\nThe `mode` parameter controls **one thing only: whether attributes absent from your list are removed.** In both modes, every attribute you *do* send is created if missing or updated if already present (upsert) — the two modes handle the *unlisted* attributes differently.\n\n- `mode: \"replace\"` (**default**) — full SYNC / authoritative state. Send the complete desired set: attributes **not** in the list are **removed** from the type.\n- `mode: \"add\"` — non-destructive upsert. Attributes absent from the list are **kept** (never removed). Send only the attributes you want to add or change. Use it to touch a few attributes without resending the whole set (avoids accidentally emptying the type).\n\n> ⚠️ `add` is **not** insert-only: an attribute already assigned that you send again **with different options** (editability/hidden) **is updated**. Sent with identical options → `unchanged`. It is never duplicated. The only thing `add` never does is *remove*.\n\n## Per-attribute behavior (both modes)\n\n- Attribute in the list but NOT currently assigned → **added**\n- Attribute in the list AND already assigned → **updated** if options differ, **unchanged** if identical\n- Attribute currently assigned but NOT in the list → **removed** in `replace`, **kept** in `add`\n\nSending `assignments: []` with `mode: \"replace\"` removes **all** attributes from the type. Use with care (or use `mode: \"add\"`, under which an empty list is a no-op).\n\n## Per-attribute options\n\nEach assignment entry supports two optional display options:\n\n**`editability`** — controls editability of the attribute value for this type:\n- `\"default\"` (default) — inherits the attribute's global editability setting\n- `\"read_only\"` — value is always read-only for this type, regardless of the global setting\n- `\"editable\"` — value is always editable for this type, regardless of the global setting\n\nOmitting `editability` is equivalent to `\"default\"`.\n\n**`hidden`** — hides the attribute in the interface for this type:\n- `false` (default) — attribute is visible\n- `true` — attribute is hidden in the interface for this type\n\nOmitting `hidden` is equivalent to `false`.\n\n## Partial Failures\n\nInvalid entries (unknown attribute ID or code, missing fields) do NOT fail the whole request — valid entries are still applied and `status_code` remains 1. All failures are reported in `result.errors`.\n\n## Accepts IDs or Codes\n\n`attribute`: integer (attribute ID) or string (attribute code, case-insensitive). To list available attributes for a type's library, call `POST /api/v3/attributes/list` with the `class_id` returned by `POST /api/v3/types/get`.\n\n## Related Endpoints\n\n- `attributes/assign-types` — inverse: given one attribute, sync all its types\n- `attributes/list` — list available attributes (requires class_id; use `types/get` to retrieve it)\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Sync result response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Always 1 for this endpoint, even when some entries failed (partial failures are reported in result.errors, not via status_code)"},"status_message":{"type":"string","example":"3 added, 1 updated, 1 removed","description":"Summary of changes (e.g. \"3 added, 1 updated, 1 removed\"). Suffix \"(N error(s))\" is appended when result.errors is non-empty. \"No changes\" when nothing changed."},"result":{"type":"object","properties":{"type_id":{"type":"integer","example":12,"description":"Type ID"},"attributes":{"type":"array","description":"Per-attribute action details. Only covers attributes that were in the request or currently assigned — not all attributes in the library.","items":{"type":"object","properties":{"attribute_id":{"type":"integer","example":456,"description":"Resolved attribute ID"},"action":{"type":"string","enum":["added","updated","unchanged","removed"],"example":"added","description":"Operation applied to this attribute assignment"},"editability":{"type":"string","enum":["default","read_only","editable"],"example":"default","description":"Reflects the value sent in the request (not the stored value). Absent when action is \"removed\"."},"hidden":{"type":"boolean","example":false,"description":"Reflects the value sent in the request (not the stored value). Absent when action is \"removed\"."}}}},"total_added":{"type":"integer","example":3},"total_updated":{"type":"integer","example":1},"total_removed":{"type":"integer","example":1},"cache_refreshed":{"type":"boolean","example":true},"errors":{"type":"array","items":{"type":"string"},"description":"Per-entry errors that did not block execution. Valid entries are still applied.","example":["Attribute not found: code_inexistant"]}}}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":2,"description":"Status code 2 when type not found"},"status_message":{"type":"string","example":"Type \"999\" does not exist","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Type ID. Use POST /api/v3/types/list with class_id to get available type IDs.","example":12},"mode":{"type":"string","description":"Assignment mode. Controls ONLY whether attributes absent from the list are removed. \"replace\" (default) = full SYNC: attributes not in the list are REMOVED. \"add\" = non-destructive: attributes absent from the list are KEPT. In BOTH modes, each attribute you send is created if missing or UPDATED if already present with different options (upsert — NOT insert-only; identical options = unchanged; never duplicated). Use \"add\" to add/change a few attributes without resending the complete set.","enum":["replace","add"],"example":"add"},"assignments":{"type":"array","description":"Desired attribute assignments for this type. Each entry must have \"attribute\" (integer ID or string code). Optional: \"editability\" (\"default\", \"read_only\", \"editable\") and \"hidden\" (boolean). In `mode: \"replace\"` (default) this is the COMPLETE desired state — attributes not in this list are REMOVED. In `mode: \"add\"`, only listed attributes are added/updated (others kept). (Array of objects - see example for structure)","example":[{"attribute":"datedecreation","editability":"editable","hidden":false},{"attribute":456,"editability":"default","hidden":true}],"items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"integer"},{"type":"string"}],"description":"Attribute ID (integer) or attribute code (string, case-insensitive). Use POST /api/v3/attributes/list with class_id to discover.","example":"datedecreation"},"editability":{"type":"string","description":"Editability for this attribute on this type. Defaults to \"default\" (inherits global setting).","enum":["default","read_only","editable"],"example":"editable"},"hidden":{"type":"boolean","description":"Hide attribute in interface for this type. Defaults to false.","example":false}},"required":["attribute"],"title":"Item"}}},"required":["id","assignments"]}}}}}},"/api/v3/types/create/":{"post":{"tags":["types"],"summary":"Create a new type in a library","description":"## Purpose\n\nCreates a new asset type (category) in a library with full configuration. If a type with the same label already exists for the given supertype, it returns the existing type without creating a duplicate.\n\n## Required Parameters\n\n- `class_id`: Library where the type will be created\n- `label`: Display name for the type\n- `supertype_id`: Category of type\n\n## Optional Parameters\n\nAll other parameters are optional and allow full type configuration at creation time: icon, color, help text, visibility, export, logging, file management, etc.\n\n## Idempotent Behavior\n\nIf a type with the same label already exists in the same library and supertype, the endpoint returns the existing type with `created: false` instead of creating a duplicate. Optional parameters are NOT applied to existing types.\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Type creation response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"Type created successfully","description":"Status message"},"result":{"type":"object","properties":{"id":{"type":"integer","example":42,"description":"Type ID"},"class_id":{"type":"integer","example":4,"description":"Library ID"},"label":{"type":"string","example":"Product","description":"Type label"},"supertype_id":{"type":"integer","example":2,"description":"Supertype ID"},"created":{"type":"boolean","example":true,"description":"True if newly created, false if already existed"}},"required":["id","class_id","label","supertype_id","created"]}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":2,"description":"Status code (2 = error)"},"status_message":{"type":"string","example":"Type creation failed","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]}]}}}}},"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},"label":{"type":"string","description":"Type label (display name)","example":"Product"},"supertype_id":{"type":"integer","description":"Supertype ID : 1=Groupe de fiches, 2=Fiche, 3=Dossier, 4=Page, 5=Publication, 6=Workspace, 7=Article, 8=Variation de produit","enum":[1,2,3,4,5,6,7,8],"example":2},"help":{"type":"string","description":"Type description/help text","example":"Product type for catalog items"},"icon":{"type":"string","description":"FontAwesome icon class. Overrides the supertype default icon","example":"fa-solid fa-box"},"color":{"type":"string","description":"Hex color code for the type icon. Overrides the supertype default color","example":"#FF5733"},"active":{"type":"boolean","description":"Whether the type is active. Default: true","example":true},"indexed":{"type":"boolean","description":"Whether the type is indexed for search. Default: true","example":true},"not_logged":{"type":"boolean","description":"Disable logging for records of this type. Default: false","example":false},"not_exportable":{"type":"boolean","description":"Prevent export of records of this type. Default: false","example":false},"manage_file":{"type":"boolean","description":"Enable file management for this type. Default: false","example":false},"display_link_tab":{"type":"boolean","description":"Display link tab in the type view. Default: false","example":false},"bundle_option":{"type":"integer","description":"Bundle association option: 1=simple bundle, 2=variant bundle, 3=kit bundle. Leave empty or omit if not applicable","example":1},"display_related_assets":{"type":"integer","description":"Related assets display mode: 1=display related assets tab. Leave empty or omit if not applicable","example":1},"dynamic_search":{"type":"integer","description":"Smart folder / dynamic search setting. Only applied when supertype_id=3 (Folder). Silently ignored for other supertypes. 0=disabled, 1=enabled","example":0},"creation_status":{"type":"integer","description":"Default status ID assigned when creating a new record of this type. Use POST /api/v3/types/statuses with the type ID to get available statuses. Statuses are inherited from the supertype","example":1},"project_status":{"type":"integer","description":"Default status ID assigned when creating a new project of this type. Use POST /api/v3/types/statuses with the type ID to get available statuses. Statuses are inherited from the supertype","example":1},"parent_id":{"type":"integer","description":"Parent type ID for nesting this type under another. Use POST /api/v3/types/list with class_id to get existing types. Must belong to the same library","example":15},"order":{"type":"integer","description":"Display order position. Lower values appear first","example":1}},"required":["class_id","label","supertype_id"]}}}}}},"/api/v3/types/full/":{"post":{"tags":["types"],"summary":"Get all types with full details","description":"## Purpose\n\nReturns all asset types for a class with complete configuration including permissions, statuses, and display settings.\n\n## Filtering\n\nUse `supertype_id` to filter by category (Record, Folder, Page, etc.).\n\n## Comparison\n\nUse `types/list` for simplified output (id, code, label, active status only).\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Asset type list response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"","description":"Status message"},"result":{"type":"object","properties":{"results_total":{"type":"integer","example":5,"description":"Total number of asset types returned"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":15,"description":"Type ID"},"class_id":{"type":"integer","example":4,"description":"Associated class ID"},"code":{"type":"string","example":"my_type_code","description":"Type code"},"label":{"type":"string","example":"Product category","description":"Type label"},"tags":{"type":"array","items":{"type":"string"},"example":["tag1","tag2"],"description":"Array of tags (can be empty)"},"manage_file":{"type":"boolean","nullable":true,"example":true,"description":"Whether the type can load a preview file"},"supertype_id":{"type":"integer","nullable":true,"example":1,"description":"Supertype ID"},"supertype_label":{"type":"string","nullable":true,"example":"Record","description":"Supertype label"},"active":{"type":"boolean","example":true,"description":"Whether the type is active"},"indexed":{"type":"boolean","nullable":true,"example":true,"description":"Whether the type is indexed"},"order":{"type":"integer","nullable":true,"example":1,"description":"Display order"},"help":{"type":"string","nullable":true,"example":"Help text for this type","description":"Help text"},"creation_status":{"type":"integer","nullable":true,"example":1149,"description":"Status at creation"},"project_status":{"type":"integer","nullable":true,"example":1148,"description":"Status when adding project"},"bundle_option":{"type":"integer","nullable":true,"example":3,"description":"Association type : linked asset or not"},"display_link_tab":{"type":"boolean","nullable":true,"example":true,"description":"Displaying \"links\" tab in the asset"},"display_related_assets":{"type":"boolean","nullable":true,"example":false,"description":"Displaying related assets"},"font_awesome_code":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"example":"fa-solid fa-file","description":"Font-Awesome code"},"color":{"type":"string","nullable":true,"example":"#FF5722","description":"Type color in hexadecimal"}},"description":"Font-Awesome code"},"not_logged":{"type":"boolean","nullable":true,"example":true,"description":"Not logged"},"not_exportable":{"type":"boolean","nullable":true,"example":true,"description":"Not exportable"},"dynamic_search":{"type":"integer","nullable":true,"example":0,"description":"Dynamic search"},"image":{"type":"string","nullable":true,"example":"<span><i class=\"fa-solid fa-file\" style=\"font-size: 16px;color:#c0c0c0;\"></i></span>","description":"Image"},"permissions":{"type":"object","nullable":true,"additionalProperties":{"type":"object","properties":{"label":{"type":"string","example":"Group 1","description":"User group label"},"create":{"type":"boolean","example":false,"description":"Create permission"},"edit":{"type":"boolean","example":false,"description":"Edit permission"},"view":{"type":"boolean","example":true,"description":"View permission"}},"required":["label","create","edit","view"]},"example":{"1557":{"label":"Afineo","create":false,"edit":false,"view":true}},"description":"Permissions by user group ID. Each key is a user group ID, and the value contains permissions (create, edit, view)"},"available_statuses":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"example":{"1149":"Archived","1150":"Active"},"description":"Available statuses for this type. Each key is a status ID, and the value is the status label"}},"required":["id","class_id","code","label","tags","supertype_id","supertype_label","active"]},"description":"Array of asset types objects"}},"required":["results_total","items"]}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":3,"description":"Status code (3 = error, 0 = class not found)"},"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"]}]}}}}},"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},"supertype_id":{"type":"integer","description":"Supertype ID : Groupe de fiches,Fiche,Dossier,Page,Publication,Workspace,Article,Variation de produit","enum":[1,2,3,4,5,6,7,8],"example":"Groupe de fiches"}},"required":["class_id"]}}}}}},"/api/v3/types/get/":{"post":{"tags":["types"],"summary":"Get asset type details","description":"## Purpose\n\nReturns complete asset type configuration including permissions, statuses, display settings, and file management options.\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Asset type information response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"","description":"Status message"},"result":{"type":"object","properties":{"id":{"type":"integer","example":15,"description":"Type ID"},"class_id":{"type":"integer","example":4,"description":"Associated class ID"},"code":{"type":"string","example":"my_type_code","description":"Type code"},"label":{"type":"string","example":"Product category","description":"Type label"},"tags":{"type":"array","items":{"type":"string"},"example":["tag1","tag2"],"description":"Array of tags (can be empty)"},"manage_file":{"type":"boolean","nullable":true,"example":true,"description":"Whether the type can load a preview file"},"supertype_id":{"type":"integer","nullable":true,"example":1,"description":"Supertype ID"},"supertype_label":{"type":"string","nullable":true,"example":"Record","description":"Supertype label"},"active":{"type":"boolean","example":true,"description":"Whether the type is active"},"indexed":{"type":"boolean","nullable":true,"example":true,"description":"Whether the type is indexed"},"order":{"type":"integer","nullable":true,"example":1,"description":"Display order"},"help":{"type":"string","nullable":true,"example":"Help text for this type","description":"Help text"},"creation_status":{"type":"integer","nullable":true,"example":1149,"description":"Status at creation"},"project_status":{"type":"integer","nullable":true,"example":1148,"description":"Status when adding project"},"bundle_option":{"type":"integer","nullable":true,"example":3,"description":"Association type : linked asset or not"},"display_link_tab":{"type":"boolean","nullable":true,"example":true,"description":"Displaying \"links\" tab in the asset"},"display_related_assets":{"type":"boolean","nullable":true,"example":false,"description":"Displaying related assets"},"font_awesome_code":{"type":"object","nullable":true,"properties":{"code":{"type":"string","nullable":true,"example":"fa-solid fa-file","description":"Font-Awesome code"},"color":{"type":"string","nullable":true,"example":"#FF5722","description":"Type color in hexadecimal"}},"description":"Font-Awesome code"},"not_logged":{"type":"boolean","nullable":true,"example":true,"description":"Not logged"},"not_exportable":{"type":"boolean","nullable":true,"example":true,"description":"Not exportable"},"dynamic_search":{"type":"integer","nullable":true,"example":0,"description":"Dynamic search"},"image":{"type":"string","nullable":true,"example":"<span><i class=\"fa-solid fa-file\" style=\"font-size: 16px;color:#c0c0c0;\"></i></span>","description":"Image"},"permissions":{"type":"object","nullable":true,"additionalProperties":{"type":"object","properties":{"label":{"type":"string","example":"Group 1","description":"User group label"},"create":{"type":"boolean","example":false,"description":"Create permission"},"edit":{"type":"boolean","example":false,"description":"Edit permission"},"view":{"type":"boolean","example":true,"description":"View permission"}},"required":["label","create","edit","view"]},"example":{"1557":{"label":"Afineo","create":false,"edit":false,"view":true}},"description":"Permissions by user group ID. Each key is a user group ID, and the value contains permissions (create, edit, view)"},"available_statuses":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"example":{"1149":"Archived","1150":"Active"},"description":"Available statuses for this type. Each key is a status ID, and the value is the status label"}},"required":["id","class_id","code","label","tags","supertype_id","supertype_label","active"],"description":"Asset type information"}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":3,"description":"Status code (3 = error, 0 = class not found)"},"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"]}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Asset type ID. Use POST /api/v3/types/list with class_id to get available asset types.","example":407}},"required":["id"]}}}}}},"/api/v3/types/list/":{"post":{"tags":["types"],"summary":"List types by class","description":"## Purpose\n\nReturns simplified asset type list for a class (id, code, label, supertype, active status).\n\n## Filtering\n\nUse `supertype_id` to filter by category (Record, Folder, Page, etc.).\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Asset type list response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"","description":"Status message"},"result":{"type":"object","properties":{"results_total":{"type":"integer","example":5,"description":"Total number of asset types returned"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":15,"description":"Type ID"},"class_id":{"type":"integer","example":4,"description":"Associated class ID"},"code":{"type":"string","example":"my_type_code","description":"Type code"},"label":{"type":"string","example":"Product category","description":"Type label"},"tags":{"type":"array","items":{"type":"string"},"example":["tag1","tag2"],"description":"Array of tags (can be empty)"},"supertype_id":{"type":"integer","nullable":true,"example":1,"description":"Supertype ID"},"supertype_label":{"type":"string","nullable":true,"example":"Record","description":"Supertype label"},"active":{"type":"boolean","example":true,"description":"Whether the type is active"}},"required":["id","class_id","code","label","tags","supertype_id","supertype_label","active"]},"description":"Array of asset types objects"}},"required":["results_total","items"]}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":3,"description":"Status code (3 = error, 0 = class not found)"},"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"]}]}}}}},"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},"supertype_id":{"type":"integer","description":"Supertype ID : Groupe de fiches,Fiche,Dossier,Page,Publication,Workspace,Article,Variation de produit","enum":[1,2,3,4,5,6,7,8],"example":"Groupe de fiches"}},"required":["class_id"]}}}}}},"/api/v3/types/statuses/":{"post":{"tags":["types"],"summary":"Get type status assignments","description":"## Purpose\n\nReturns available workflow statuses for an asset type (includes inherited statuses from supertype).\n\n## Requirement\n\nRequires extension: `ASSIGNMENT_STATUS_TYPES`. This extension must be enabled at the platform level by an administrator. If not enabled, the endpoint will return status_code=2 with message \"Extension not available\".\n\n## Handling Unavailability\n\nIf you receive status_code=2, the extension is not enabled and this endpoint cannot be used. Fall back to POST /api/v3/permissions/statuses/list to get statuses without type-level filtering.\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Status assignments response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"","description":"Empty string on success"},"result":{"type":"object","properties":{"results_total":{"type":"integer","example":3,"description":"Total number of statuses available for this type"},"items":{"type":"object","additionalProperties":{"type":"string"},"example":{"1149":"Archived","1150":"Active"},"description":"Available statuses for the type (includes inherited from supertype). Key is status ID, value is status label"}},"required":["results_total","items"]}},"required":["status_code","status_message","result"]},{"type":"object","title":"Extension Required Error","properties":{"status_code":{"type":"integer","example":2,"description":"Status code (2 = extension required or type not found)"},"status_message":{"type":"string","example":"This endpoint requires the ASSIGNMENT_STATUS_TYPES extension to be enabled","description":"Error message about required extension or type not found"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]},{"type":"object","title":"Not Found Error","properties":{"status_code":{"type":"integer","example":3,"description":"Status code (3 = not found)"},"status_message":{"type":"string","example":"No status assignments found for asset type \"407\"","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Asset type ID. Use POST /api/v3/types/list with class_id to get available asset types.","example":407}},"required":["id"]}}}}}},"/api/v3/types/update-permissions/":{"post":{"tags":["types"],"summary":"Update group permissions for a type","description":"## Purpose\n\nManages group (LCA) permissions on an asset type. Controls which groups can create, edit, or view assets of this type. Type IDs are unique across all libraries.\n\n## Modes\n\n- **synchronize**: Replaces ALL permissions for the type. Groups not listed are removed. Use this to set the complete permission state.\n- **update**: Adds or modifies only the listed groups. Existing groups not mentioned are left unchanged. Recommended for incremental changes.\n- **delete**: Removes permissions for the listed groups. The `create`, `edit`, `view` fields are ignored in this mode.\n\n## Permission Hierarchy\n\nPermissions follow a logical hierarchy enforced server-side:\n- `create: true` automatically enables `edit` and `view`\n- `edit: true` automatically enables `view`\n- `view: false` automatically disables `create` and `edit`\n\n## Discovery Chain\n\n1. Get libraries: `POST /api/v3/administration/classes/list`\n2. Get types for a library: `POST /api/v3/types/list` with `class_id`\n3. Get available groups: `POST /api/v3/permissions/groups/list`\n4. Read current permissions: `POST /api/v3/types/get` with `id`\n\n## Common Errors\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Type not found with id X | Invalid type ID | Use `POST /api/v3/types/list` with `class_id` to get valid IDs |\n| Group ID X does not exist | Invalid group_id | Use `POST /api/v3/permissions/groups/list` to get valid group IDs |\n| Cannot manage permissions on a duplicates handler type | Type is reserved for duplicates management | Choose a different type |\n| Not allowed operation | User lacks admin permission or `lca_manage_type_fiche` right | Requires admin-level API token |\n\n## Example Requests\n\n### Update specific groups\n```json\n{\"id\": 42, \"mode\": \"update\", \"permissions\": [{\"group_id\": 5, \"create\": true, \"edit\": true, \"view\": true}]}\n```\n\n### Synchronize all permissions (replaces everything)\n```json\n{\"id\": 42, \"mode\": \"synchronize\", \"permissions\": [{\"group_id\": 5, \"create\": true, \"edit\": true, \"view\": true}, {\"group_id\": 8, \"create\": false, \"edit\": true, \"view\": true}]}\n```\n\n### Delete group permissions\n```json\n{\"id\": 42, \"mode\": \"delete\", \"permissions\": [{\"group_id\": 8}]}\n```\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Returns the complete permission state after the operation, including all groups with their create/edit/view flags","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"Permissions updated successfully","description":"Status message"},"result":{"type":"object","properties":{"id":{"type":"integer","example":42,"description":"Asset type ID"},"mode":{"type":"string","example":"update","description":"Operation mode used"},"affected_groups":{"type":"integer","example":2,"description":"Number of groups affected by the operation"},"permissions":{"type":"array","description":"Complete permission state after the operation","items":{"type":"object","properties":{"group_id":{"type":"integer","description":"Permission group (LCA) ID"},"label":{"type":"string","description":"Group display name"},"create":{"type":"boolean","description":"Can create assets of this type"},"edit":{"type":"boolean","description":"Can edit assets of this type"},"view":{"type":"boolean","description":"Can view assets of this type"}}}}},"required":["id","mode","affected_groups","permissions"]}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","example":2,"description":"Status code (2 = error)"},"status_message":{"type":"string","example":"Type not found","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Asset type ID. First get a class_id from POST /api/v3/administration/classes/list, then use POST /api/v3/types/list with that class_id to discover type IDs.","example":42},"mode":{"type":"string","description":"Operation mode. \"synchronize\": replaces ALL permissions (groups not listed are removed). \"update\": adds or modifies only listed groups (others unchanged). \"delete\": removes listed groups (create/edit/view fields ignored). Recommendation: use \"update\" for incremental changes, \"synchronize\" for full state management.","enum":["synchronize","update","delete"],"example":"update"},"permissions":{"type":"array","description":"Array of permission objects defining group-level access. In \"update\"/\"synchronize\" modes, each object requires group_id + create/edit/view booleans. In \"delete\" mode, only group_id is needed (other fields are ignored). (Array of objects - see example for structure)","example":[{"group_id":5,"create":true,"edit":true,"view":true},{"group_id":8,"create":false,"edit":true,"view":true}],"items":{"type":"object","properties":{"group_id":{"type":"integer","description":"Permission group (LCA) ID. Use POST /api/v3/permissions/groups/list to get available groups and their IDs."},"create":{"type":"boolean","description":"Can create assets of this type. Default: false. Ignored in delete mode."},"edit":{"type":"boolean","description":"Can edit assets of this type. Default: false. Ignored in delete mode."},"view":{"type":"boolean","description":"Can view assets of this type. Default: false. Ignored in delete mode."}},"required":["group_id"]}}},"required":["id","mode","permissions"]}}}}}},"/api/v3/types/update/":{"post":{"tags":["types"],"summary":"Update an existing type in a library","description":"## Purpose\n\nUpdates properties of an existing asset type (category). Only provided fields are modified — omitted fields remain unchanged.\n\n## What can be updated\n\n- Label, help text, icon, color\n- Active status, indexed, logging, exportability\n- File management, display options, bundle, dynamic search\n- Default statuses (creation, project)\n- Parent type, display order\n\n## What cannot be updated\n\n- `class_id` (immutable — the type belongs to a specific library)\n- `supertype_id` (immutable — changing supertype would break type hierarchy)\n\n## Important\n\nThe `id` parameter refers to the type ID, not the class ID. Use POST /api/v3/types/list with class_id to discover type IDs.\n","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Type update response","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Success Response","properties":{"status_code":{"type":"integer","example":1,"description":"Status code (1 = success)"},"status_message":{"type":"string","example":"Type updated successfully","description":"Status message"},"result":{"type":"object","properties":{"id":{"type":"integer","example":42,"description":"Type ID"},"class_id":{"type":"integer","example":4,"description":"Library ID"},"label":{"type":"string","example":"Product","description":"Type label"},"updated_fields":{"type":"array","items":{"type":"string"},"example":["label","help","icon"],"description":"List of fields that were actually modified"}},"required":["id","class_id","label","updated_fields"]}},"required":["status_code","status_message","result"]},{"type":"object","title":"Error Response","properties":{"status_code":{"type":"integer","enum":[2,997],"example":2,"description":"Status code (2 = validation error, 997 = insufficient permissions)"},"status_message":{"type":"string","example":"Type not found","description":"Error message"},"result":{"type":"array","items":{"type":"object"},"example":[],"description":"Empty array on error"}},"required":["status_code","status_message","result"]}]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Type ID to update. Use POST /api/v3/types/list with class_id to get available types.","example":42},"label":{"type":"string","description":"New type label (display name)","example":"Product"},"help":{"type":"string","description":"Type description/help text","example":"Product type for catalog items"},"icon":{"type":"string","description":"FontAwesome icon class","example":"fa-solid fa-box"},"color":{"type":"string","description":"Hex color code for the type icon","example":"#FF5733"},"active":{"type":"boolean","description":"Whether the type is active","example":true},"indexed":{"type":"boolean","description":"Whether the type is indexed for search","example":true},"not_logged":{"type":"boolean","description":"Disable logging for records of this type","example":false},"not_exportable":{"type":"boolean","description":"Prevent export of records of this type","example":false},"manage_file":{"type":"boolean","description":"Enable file management for this type","example":false},"display_link_tab":{"type":"boolean","description":"Display link tab in the type view","example":false},"bundle_option":{"type":"integer","description":"Bundle association option: 1=simple bundle, 2=variant bundle, 3=kit bundle. Leave empty or omit if not applicable","example":1},"display_related_assets":{"type":"integer","description":"Related assets display mode: 1=display related assets tab. Leave empty or omit if not applicable","example":1},"dynamic_search":{"type":"integer","description":"Smart folder / dynamic search setting. Only applied when supertype is Folder (supertype_id=3). Silently ignored for other supertypes. 0=disabled, 1=enabled","example":0},"creation_status":{"type":"integer","description":"Default status ID assigned when creating a new record of this type. Use POST /api/v3/types/statuses with the type ID to get available statuses","example":1},"project_status":{"type":"integer","description":"Default status ID assigned when creating a new project of this type. Use POST /api/v3/types/statuses with the type ID to get available statuses","example":1},"parent_id":{"type":"integer","description":"Parent type ID for nesting this type under another. Use POST /api/v3/types/list with class_id to get existing types. Must belong to the same library. Set to 0 to remove parent","example":15},"order":{"type":"integer","description":"Display order position. Lower values appear first","example":1}},"required":["id"]}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token generated with /api/v3/token/get/"}}}}