---
agentTools:
  projectIndex: https://safehavenmfb.readme.io/llms.txt
---

# Update Virtual Account

Updates an existing virtual account, for example its `callbackUrl`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Safe Haven IBS API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.sandbox.safehavenmfb.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://example.com/oauth2/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/virtual-accounts/{id}": {
      "put": {
        "summary": "Update Virtual Account",
        "description": "Updates an existing virtual account, for example its `callbackUrl`.",
        "operationId": "update-virtual-account",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The `_id` of the account to update.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ClientID",
            "in": "header",
            "description": "Your ibs_client_id, returned by Exchange Client Credentials.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callbackUrl": {
                    "type": "string",
                    "description": "An endpoint to receive payment webhook notifications. Must start with `https://`"
                  }
                }
              },
              "examples": {
                "New callback URL": {
                  "value": {
                    "callbackUrl": "https://example.com/new-webhook"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 200,\n    \"message\": \"Virtual Account updated successfully.\",\n    \"data\": {\n        \"_id\": \"65f0c1a2b3c4d5e6f7a8b9c1\",\n        \"callbackUrl\": \"https://example.com/new-webhook\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 200,
                      "default": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "Virtual Account updated successfully."
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string",
                          "example": "65f0c1a2b3c4d5e6f7a8b9c1"
                        },
                        "callbackUrl": {
                          "type": "string",
                          "example": "https://example.com/new-webhook"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 400,\n    \"message\": \"Virtual Account not found.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "Virtual Account not found."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "61e69ed05b7bd4006a962eed:62a33e2728e0a400b7ff5241"
}
```