# Update status Update account status. This endpoint generates an [Account status changed](https://developers.pismo.io/events/docs/account-status-change-2) event. Refer to the [Account status](doc:accounts-overview#account-status) guide for more information. # OpenAPI definition ```json { "openapi": "3.1.0", "info": { "title": "Core platform - Accounts", "version": "1.0.0", "description": "API used to manage accounts domain", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support/" }, "license": { "name": "Copyright Pismo" } }, "servers": [ { "url": "https://sandbox.pismolabs.io", "description": "API server for testing" } ], "tags": [ { "name": "Statuses and reasons", "description": "Endpoints to configure accounts, statuses, and reasons." } ], "components": { "parameters": { "AccountIdPath": { "name": "accountId", "in": "path", "description": "Account ID", "required": true, "schema": { "type": "integer", "format": "int64", "minimum": 1, "example": 123 } } }, "schemas": { "AccountStatus4": { "type": "string", "description": "Account status. The pre-defined account statuses are `DEBIT_ONLY`, `NORMAL`, `BLOCKED`, and `CANCELLED`. You can create your own account statuses with the [Create status](https://developers.pismo.io/pismo-docs/reference/v4-post-account-status) endpoint. \n", "pattern": "^[A-Z_]+$", "maxLength": 200, "example": "BLOCKED" }, "SimpleError": { "title": "SimpleError", "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string", "description": "Error message" } } }, "StatusReasonID": { "type": "integer", "format": "int64", "example": 123, "minimum": 1, "description": "ID of the reason why the account is in its current status. You can create reasons with the [Create status reason](https://developers.pismo.io/pismo-docs/reference/v4-post-account-reason) endpoint. \n" }, "StatusReasonDescription": { "type": "string", "description": "Description of why the account is in its current status", "maxLength": 80, "example": "Registration restriction" }, "UpdateAccountStatusRequest": { "type": "object", "description": "Update account status", "required": [ "status" ], "properties": { "status": { "$ref": "#/components/schemas/AccountStatus4" }, "reason_id": { "$ref": "#/components/schemas/StatusReasonID" }, "description": { "$ref": "#/components/schemas/StatusReasonDescription" }, "update_children": { "$ref": "#/components/schemas/UpdateChildren" } } }, "UpdateChildren": { "type": "boolean", "description": "Should all the account's children linked through the field `parent_account_id` also be updated? Default is `false`.", "default": false, "example": true } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "security": [ { "BearerAuth": [] } ], "x-readme": { "explorer-enabled": true, "proxy-enabled": true, "samples-enabled": true }, "paths": { "/accounts/v2/accounts/{accountId}/status": { "patch": { "operationId": "patch-accounts-v2-accounts-accountId-status", "summary": "Update status", "description": "Update account status. \n\nThis endpoint generates an [Account status changed](https://developers.pismo.io/events/docs/account-status-change-2) event.\n\nRefer to the [Account status](https://developers.pismo.io/pismo-docs/docs/accounts-overview#account-status) guide for more information.\n", "tags": [ "Statuses and reasons" ], "parameters": [ { "$ref": "#/components/parameters/AccountIdPath" } ], "requestBody": { "description": "Status to update", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateAccountStatusRequest" }, "examples": { "Account freeze": { "value": { "status": "BLOCKED" } }, "Reverse account freeze": { "value": { "status": "NORMAL" } } } } } }, "responses": { "204": { "description": "OK" }, "400": { "description": "Status not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" }, "examples": { "Status not found": { "value": { "message": "Status not found" } } } } } }, "404": { "description": "Account not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" }, "examples": { "Account not found": { "value": { "message": "Account not found" } } } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleError" }, "examples": { "Internal server error": { "value": { "message": "Error changing account status" } } } } } } } } } } } ```