# Update hierarchy Updates a hierarchy's name. # OpenAPI definition ```json { "openapi": "3.0.0", "info": { "title": "Banking - Transaction banking", "version": "0.9.0", "description": "Transaction banking API", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support/" }, "license": { "name": "Copyright Pismo" } }, "servers": [ { "url": "https://sandbox.pismolabs.io", "description": "Sandbox API server for testing" } ], "security": [ { "BearerAuth": [] } ], "tags": [ { "name": "Hierarchies", "description": "Hierarchy-related endpoints" } ], "components": { "parameters": { "HierarchyIdPath": { "name": "hierarchyId", "in": "path", "description": "Hierarchy ID", "schema": { "type": "string" }, "required": true, "example": "1234" } }, "schemas": { "ErrorCode": { "description": "Error code\n`minLength: 1`\n`maxLength: 12`\n", "type": "string", "minLength": 1, "maxLength": 12, "example": "WPMT0017" }, "ErrorMessage": { "description": "Error message\n`minLength: 1`\n`maxLength: 1000`\n", "type": "string", "minLength": 1, "maxLength": 1000, "example": "Invalid JSON payload received: Error unmarshalling request" }, "ErrorResponse": { "type": "object", "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "message": { "$ref": "#/components/schemas/ErrorMessage" } } }, "HierarchyName": { "type": "string", "description": "Hierarchy name", "maxLength": 40 }, "PatchHierarchyRequest": { "description": "Patch hierarchy request body", "type": "object", "properties": { "name": { "$ref": "#/components/schemas/HierarchyName" } } } }, "responses": { "204NoContent": { "description": "No Content" }, "401Unauthorized": { "description": "Access token is missing or invalid" }, "403Forbidden": { "description": "The request has been lost" }, "500InternalServer": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Generic internal error": { "value": { "code": "ECMN9999", "message": "Internal error" } } } } } } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "paths": { "/corporate/v1/hierarchies/{hierarchyId}": { "patch": { "summary": "Update hierarchy", "operationId": "patch-hierarchy", "description": "Updates a hierarchy's name.", "parameters": [ { "$ref": "#/components/parameters/HierarchyIdPath" } ], "tags": [ "Hierarchies" ], "requestBody": { "description": "Patch hierarchy request body", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchHierarchyRequest" }, "examples": { "Patch hierarchy": { "value": { "name": "Hierarchy Name" } } } } } }, "responses": { "204": { "$ref": "#/components/responses/204NoContent" }, "400": { "description": "A Bad Request validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Invalid JSON payload": { "value": { "code": "WHIE0001", "message": "Invalid JSON payload received: Error unmarshalling request" } }, "Hierarchy name exceed size": { "value": { "code": "WHIE0002", "message": "name must be a maximum of 40 characters in length" } } } } } }, "401": { "$ref": "#/components/responses/401Unauthorized" }, "403": { "$ref": "#/components/responses/403Forbidden" }, "404": { "description": "Hierarchy Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Hierarchy Not Found": { "value": { "code": "WHIE0006", "message": "Hierarchy with ID {hierarchyId} not found" } } } } } }, "500": { "$ref": "#/components/responses/500InternalServer" } } } } } } ```