{
  "openapi": "3.1.1",
  "info": {
    "title": "NumeroMoney User API",
    "description": "Read a user's own Bank Accounts, transactions, categories and CSV Import Formats. Create a User API Access Token at /settings/user-api-access-tokens.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://www.numeromoney.com"
    }
  ],
  "paths": {
    "/api/v1/bank-accounts": {
      "get": {
        "tags": [
          "Bank Accounts"
        ],
        "summary": "Lists the Bank Accounts you own.",
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiListResponseOfUserApiBankAccount"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Bank Accounts"
        ],
        "summary": "Creates a Bank Account, with the same default Categories as one created in the application.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateBankAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateBankAccountRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateBankAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiBankAccount"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}": {
      "patch": {
        "tags": [
          "Bank Accounts"
        ],
        "summary": "Renames a Bank Account, sets its overall budget, or changes its currency or timezone while it has no Transactions.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateBankAccountRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateBankAccountRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateBankAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiBankAccount"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/categorisation-rules": {
      "get": {
        "tags": [
          "Categorisation Rules"
        ],
        "summary": "Lists a Bank Account's Categorisation Rules in the order they are tried.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiListResponseOfUserApiCategorisationRule"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Categorisation Rules"
        ],
        "summary": "Creates a Categorisation Rule.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCategorisationRuleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCategorisationRuleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCategorisationRuleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiCategorisationRule"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/categorisation-rules/{ruleId}": {
      "patch": {
        "tags": [
          "Categorisation Rules"
        ],
        "summary": "Changes a Categorisation Rule.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCategorisationRuleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCategorisationRuleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCategorisationRuleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiCategorisationRule"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Categorisation Rules"
        ],
        "summary": "Deletes a Categorisation Rule. Transactions it categorised keep their Splits.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/categorisation-rules/preview": {
      "post": {
        "tags": [
          "Categorisation Rules"
        ],
        "summary": "Lists the uncategorised Transactions that the saved rules, or one unsaved rule, would categorise. Changes nothing, so a Read token can call it.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/UserApiPreviewCategorisationRulesRequest"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/UserApiPreviewCategorisationRulesRequest"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/UserApiPreviewCategorisationRulesRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiCategorisationRuleMatchesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/categorisation-rules/apply": {
      "post": {
        "tags": [
          "Categorisation Rules"
        ],
        "summary": "Puts each uncategorised Transaction that a saved rule matches in the rule's Category.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiCategorisationRuleMatchesResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/categories": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "Lists a Bank Account's categories.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiListResponseOfUserApiCategory"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Categories"
        ],
        "summary": "Creates a Category.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCategoryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCategoryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCategoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiCategory"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/categories/{categoryId}": {
      "patch": {
        "tags": [
          "Categories"
        ],
        "summary": "Changes a Category that you created.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "categoryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCategoryRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCategoryRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCategoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiCategory"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Categories"
        ],
        "summary": "Deletes a Category that you created, and its child Categories, when no Transaction has a Split in them.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "categoryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/csv-import-formats": {
      "get": {
        "tags": [
          "CSV Import Formats"
        ],
        "summary": "Lists your saved CSV Import Formats. They hold column positions and a date format, and no statement data.",
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiListResponseOfUserApiCsvImportFormat"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "CSV Import Formats"
        ],
        "summary": "Creates a CSV Import Format from column positions, for importing CSV statements.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCsvImportFormatRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCsvImportFormatRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiCreateCsvImportFormatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiCsvImportFormat"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/csv-import-formats/{csvImportFormatId}": {
      "patch": {
        "tags": [
          "CSV Import Formats"
        ],
        "summary": "Renames a CSV Import Format.",
        "parameters": [
          {
            "name": "csvImportFormatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCsvImportFormatRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCsvImportFormatRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateCsvImportFormatRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiCsvImportFormat"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "CSV Import Formats"
        ],
        "summary": "Deletes a CSV Import Format. Transactions imported with it stay.",
        "parameters": [
          {
            "name": "csvImportFormatId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/transactions": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "summary": "Lists a Bank Account's transactions, newest first.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Earliest transaction date to return, as YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "Latest transaction date to return, as YYYY-MM-DD. The whole day is included.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "categoryId",
            "in": "query",
            "description": "Returns transactions with a split in this category. Cannot be combined with uncategorisedOnly.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "includeChildCategories",
            "in": "query",
            "description": "Also returns transactions in the direct children of categoryId.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "uncategorisedOnly",
            "in": "query",
            "description": "Returns only transactions with no splits.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive text to find in the description, note or amount.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page to return, starting at 1.",
            "schema": {
              "maximum": 1000000,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The number of transactions per page. The default is 100.",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiPagedResponseOfUserApiTransaction"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Transactions"
        ],
        "summary": "Adds up to 1,000 Transactions, skipping Duplicates. It adds all of them or none.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiAddTransactionsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiAddTransactionsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiAddTransactionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiAddedTransactionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Transactions"
        ],
        "summary": "Sets the note and Splits of up to 500 Transactions. It changes all of them or none.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateTransactionsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateTransactionsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiUpdateTransactionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiListResponseOfUserApiTransaction"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/transactions/delete": {
      "post": {
        "tags": [
          "Transactions"
        ],
        "summary": "Deletes up to 500 Transactions. Ids the Bank Account does not have are listed as notFound.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiDeleteTransactionsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiDeleteTransactionsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiDeleteTransactionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiDeletedTransactionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bank-accounts/{bankAccountId}/statement-imports": {
      "post": {
        "tags": [
          "Transactions"
        ],
        "summary": "Imports a bank statement file of up to 5 MB, skipping Duplicates. OFX, QFX and QBO files import as they are, and a CSV file needs csvImportFormatId.",
        "parameters": [
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "csvImportFormatId": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiAddedTransactionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BudgetPeriod": {
        "enum": [
          "Monthly",
          "Yearly",
          null
        ]
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "UserApiAddedTransactionsResponse": {
        "required": [
          "added",
          "duplicates"
        ],
        "type": "object",
        "properties": {
          "addedCount": {
            "type": "integer",
            "format": "int32"
          },
          "duplicateCount": {
            "type": "integer",
            "format": "int32"
          },
          "categorisedCount": {
            "type": "integer",
            "description": "How many of the added Transactions a Categorisation Rule put in a Category.",
            "format": "int32"
          },
          "added": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiTransaction"
            }
          },
          "duplicates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiDuplicate"
            }
          }
        }
      },
      "UserApiAddTransactionsRequest": {
        "type": "object",
        "properties": {
          "transactions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UserApiNewTransaction"
            },
            "description": "1 to 1,000 Transactions, in statement order."
          }
        }
      },
      "UserApiBankAccount": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "currencyCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "The Bank Account's own ISO 4217 currency, or the user's default when it has none."
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ],
            "description": "The Bank Account's own IANA timezone, or the user's default when it has none."
          },
          "overallBudgetAmount": {
            "type": [
              "null",
              "number"
            ],
            "description": "The budget for all spending in the Bank Account, or null when it has none.",
            "format": "double"
          },
          "overallBudgetPeriod": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BudgetPeriod"
              }
            ]
          }
        }
      },
      "UserApiCategorisationRule": {
        "required": [
          "matchType",
          "matchText",
          "categoryName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "matchType": {
            "type": "string",
            "description": "merchant_key, contains or starts_with."
          },
          "matchText": {
            "type": "string"
          },
          "categoryId": {
            "type": "string",
            "format": "uuid"
          },
          "categoryName": {
            "type": "string"
          },
          "amountMin": {
            "type": [
              "null",
              "number"
            ],
            "description": "The lowest signed amount the rule matches, inclusive.",
            "format": "double"
          },
          "amountMax": {
            "type": [
              "null",
              "number"
            ],
            "description": "The highest signed amount the rule matches, inclusive.",
            "format": "double"
          },
          "position": {
            "type": "integer",
            "description": "Rules are tried from the lowest position. Equal positions are tried oldest first.",
            "format": "int32"
          }
        }
      },
      "UserApiCategorisationRuleMatch": {
        "required": [
          "transaction",
          "categoryName"
        ],
        "type": "object",
        "properties": {
          "transaction": {
            "$ref": "#/components/schemas/UserApiTransaction"
          },
          "categoryId": {
            "type": "string",
            "format": "uuid"
          },
          "categoryName": {
            "type": "string"
          },
          "ruleId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The rule that matched. Null for an unsaved rule.",
            "format": "uuid"
          }
        }
      },
      "UserApiCategorisationRuleMatchesResponse": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiCategorisationRuleMatch"
            }
          }
        }
      },
      "UserApiCategory": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "parentName": {
            "type": [
              "null",
              "string"
            ]
          },
          "isTransfer": {
            "type": "boolean"
          },
          "isIncome": {
            "type": "boolean"
          },
          "budgetAmount": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "budgetPeriod": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BudgetPeriod"
              }
            ]
          }
        }
      },
      "UserApiCreateBankAccountRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "2 to 100 characters, and different from the names of your other Bank Accounts, ignoring case."
          },
          "currencyCode": {
            "type": [
              "null",
              "string"
            ],
            "description": "An ISO 4217 currency code. Leave it out to use your default currency."
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ],
            "description": "An IANA timezone. Leave it out to use your default timezone."
          }
        }
      },
      "UserApiCreateCategorisationRuleRequest": {
        "type": "object",
        "properties": {
          "matchType": {
            "type": [
              "null",
              "string"
            ],
            "description": "merchant_key: the transaction's merchantKey equals matchText. contains or starts_with: the description contains or starts with matchText. All three ignore case and treat a run of spaces as one."
          },
          "matchText": {
            "type": [
              "null",
              "string"
            ],
            "description": "1 to 100 characters."
          },
          "categoryId": {
            "type": [
              "null",
              "string"
            ],
            "description": "A Category of the same Bank Account.",
            "format": "uuid"
          },
          "amountMin": {
            "type": [
              "null",
              "number"
            ],
            "description": "The lowest signed amount the rule matches, inclusive. Leave it out for no lower limit.",
            "format": "double"
          },
          "amountMax": {
            "type": [
              "null",
              "number"
            ],
            "description": "The highest signed amount the rule matches, inclusive. Leave it out for no upper limit.",
            "format": "double"
          },
          "position": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Rules are tried from the lowest position. Leave it out to put the rule after the others.",
            "format": "int32"
          }
        }
      },
      "UserApiCreateCategoryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Up to 35 characters, and different from the Bank Account's other Category names, ignoring case."
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "A top-level Category of the same Bank Account. A child Category has its parent's isTransfer and isIncome values.",
            "format": "uuid"
          },
          "isTransfer": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Leave it out to take the parent's value, or false for a top-level Category."
          },
          "isIncome": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Leave it out to take the parent's value, or false for a top-level Category."
          },
          "budgetAmount": {
            "type": [
              "null",
              "number"
            ],
            "description": "Greater than zero, with budgetPeriod. Transfer and income Categories have no budget.",
            "format": "double"
          },
          "budgetPeriod": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BudgetPeriod"
              }
            ]
          }
        }
      },
      "UserApiCreateCsvImportFormatRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "Up to 100 characters, and different from your other CSV Import Format names, ignoring case."
          },
          "amountsReversed": {
            "type": "boolean",
            "description": "True to flip the sign of each amount, for a statement that shows money out as a positive number."
          },
          "columnMappings": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserApiCsvColumnMappings"
              }
            ]
          }
        }
      },
      "UserApiCsvColumnMappings": {
        "type": "object",
        "properties": {
          "dateColumnIndex": {
            "type": "integer",
            "format": "int32"
          },
          "dateFormat": {
            "type": [
              "null",
              "string"
            ],
            "description": "The .NET date format of the date column, such as dd/MM/yyyy. Null means the format is detected on import."
          },
          "descriptionColumnIndex": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "amountColumnIndex": {
            "type": "integer",
            "description": "Negative when the format does not use an amount column.",
            "format": "int32"
          },
          "debitColumnIndex": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "creditColumnIndex": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "amountTypeColumnIndex": {
            "type": [
              "null",
              "integer"
            ],
            "description": "A column that marks each amount as a debit or a credit.",
            "format": "int32"
          },
          "noteColumnIndex": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "categoryColumnIndex": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "hasHeaderRow": {
            "type": "boolean",
            "description": "False when the file's first row is a Transaction rather than column names. Defaults to true."
          }
        },
        "description": "Zero-based column positions in a CSV bank statement. A format reads the debit and credit columns when both are set, and otherwise the amount column."
      },
      "UserApiCsvImportFormat": {
        "required": [
          "name",
          "bankAccountIds"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "amountsReversed": {
            "type": "boolean",
            "description": "True when the import flips the sign of each amount, for a statement that shows money out as a positive number."
          },
          "columnMappings": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UserApiCsvColumnMappings"
              }
            ]
          },
          "createdUtc": {
            "type": "string",
            "format": "date-time"
          },
          "lastUsedUtc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "bankAccountIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The user's own Bank Accounts that have imported with this format."
          }
        }
      },
      "UserApiDeletedTransactionsResponse": {
        "required": [
          "deleted",
          "notFound"
        ],
        "type": "object",
        "properties": {
          "deletedCount": {
            "type": "integer",
            "format": "int32"
          },
          "deleted": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "notFound": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Ids that the Bank Account does not have, for example because an earlier attempt of the same request deleted them."
          }
        }
      },
      "UserApiDeleteTransactionsRequest": {
        "type": "object",
        "properties": {
          "ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "1 to 500 Transaction ids."
          }
        }
      },
      "UserApiDuplicate": {
        "required": [
          "description"
        ],
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "description": "The zero-based position of the Transaction in the request or the statement file.",
            "format": "int32"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        },
        "description": "A Transaction that was not added, because the Bank Account already has one with the same date, description and amount."
      },
      "UserApiErrorResponse": {
        "required": [
          "error",
          "message"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UserApiItemError"
            },
            "description": "With validation_failed on a request that lists items: each failing item, by its zero-based position in the request."
          },
          "transactionCount": {
            "type": [
              "null",
              "integer"
            ],
            "description": "With category_in_use: how many Transactions have a Split in the Category or its child Categories.",
            "format": "int32"
          }
        }
      },
      "UserApiItemError": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "UserApiListResponseOfUserApiBankAccount": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiBankAccount"
            }
          }
        }
      },
      "UserApiListResponseOfUserApiCategorisationRule": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiCategorisationRule"
            }
          }
        }
      },
      "UserApiListResponseOfUserApiCategory": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiCategory"
            }
          }
        }
      },
      "UserApiListResponseOfUserApiCsvImportFormat": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiCsvImportFormat"
            }
          }
        }
      },
      "UserApiListResponseOfUserApiTransaction": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiTransaction"
            }
          }
        }
      },
      "UserApiNewTransaction": {
        "type": "object",
        "properties": {
          "date": {
            "type": [
              "null",
              "string"
            ],
            "description": "The date on the bank statement, as YYYY-MM-DD.",
            "format": "date"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "The description on the bank statement, up to 500 characters."
          },
          "amount": {
            "type": [
              "null",
              "number"
            ],
            "description": "Negative means money out. It cannot be zero.",
            "format": "double"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UserApiPagedResponseOfUserApiTransaction": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiTransaction"
            }
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UserApiPreviewCategorisationRulesRequest": {
        "type": "object",
        "properties": {
          "rule": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "A rule to try without saving it. Leave it out to preview the saved rules.",
                "$ref": "#/components/schemas/UserApiCreateCategorisationRuleRequest"
              }
            ]
          }
        }
      },
      "UserApiSplitInput": {
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "string",
            "description": "A Category of the same Bank Account.",
            "format": "uuid"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UserApiSuggestion": {
        "required": [
          "source"
        ],
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "type": "string",
            "description": "rule: a Categorisation Rule matched. description: earlier transactions with the same description. merchant: earlier transactions with the same merchantKey."
          },
          "confidence": {
            "type": "number",
            "description": "The share of the earlier transactions counted that are in the Category, from 0.6 to 1. Always 1 for a rule.",
            "format": "double"
          },
          "basedOn": {
            "type": "integer",
            "description": "How many earlier transactions were counted. 0 for a rule.",
            "format": "int32"
          },
          "ruleId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The rule that matched, when source is rule.",
            "format": "uuid"
          }
        }
      },
      "UserApiTransaction": {
        "required": [
          "description",
          "splits"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "date": {
            "type": "string",
            "description": "The date from the bank statement, without timezone conversion.",
            "format": "date"
          },
          "description": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "description": "Negative means money out.",
            "format": "double"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          },
          "splits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiTransactionSplit"
            },
            "description": "How the transaction is categorised. An empty list means it is uncategorised."
          },
          "merchantKey": {
            "type": [
              "null",
              "string"
            ],
            "description": "The part of the description that stays the same from one payment at a merchant to the next: its first 18 characters, upper case, without words that contain a digit. Null when that leaves fewer than three letters, as for most transfers."
          },
          "suggestedCategoryId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The same as suggestion.categoryId. Kept for clients written before suggestion.",
            "format": "uuid"
          },
          "suggestion": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "A Category for an uncategorised transaction, from a Categorisation Rule or from the bank account's history. Present only when there is one.",
                "$ref": "#/components/schemas/UserApiSuggestion"
              }
            ]
          }
        }
      },
      "UserApiTransactionSplit": {
        "required": [
          "categoryName"
        ],
        "type": "object",
        "properties": {
          "categoryId": {
            "type": "string",
            "format": "uuid"
          },
          "categoryName": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UserApiTransactionUpdate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "note": {
            "type": [
              "null",
              "string"
            ],
            "description": "Null removes the note."
          },
          "splits": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UserApiSplitInput"
            },
            "description": "Replaces all of the Transaction's Splits. The amounts must add up exactly to the Transaction's amount. An empty list makes the Transaction uncategorised."
          }
        },
        "description": "Leave out note or splits to keep them as they are."
      },
      "UserApiUpdateBankAccountRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "currencyCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "timezone": {
            "type": [
              "null",
              "string"
            ]
          },
          "overallBudgetAmount": {
            "type": [
              "null",
              "number"
            ],
            "description": "Greater than zero, with overallBudgetPeriod. Null removes the overall budget.",
            "format": "double"
          },
          "overallBudgetPeriod": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BudgetPeriod"
              }
            ]
          }
        },
        "description": "Send only the fields to change. Currency and timezone can change only while the Bank Account has no Transactions."
      },
      "UserApiUpdateCategorisationRuleRequest": {
        "type": "object",
        "properties": {
          "matchType": {
            "type": [
              "null",
              "string"
            ]
          },
          "matchText": {
            "type": [
              "null",
              "string"
            ]
          },
          "categoryId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "amountMin": {
            "type": [
              "null",
              "number"
            ],
            "description": "Null removes the lower limit.",
            "format": "double"
          },
          "amountMax": {
            "type": [
              "null",
              "number"
            ],
            "description": "Null removes the upper limit.",
            "format": "double"
          },
          "position": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        },
        "description": "Send only the fields to change."
      },
      "UserApiUpdateCategoryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Null makes the Category top-level.",
            "format": "uuid"
          },
          "isTransfer": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "isIncome": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "budgetAmount": {
            "type": [
              "null",
              "number"
            ],
            "description": "Null removes the budget.",
            "format": "double"
          },
          "budgetPeriod": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BudgetPeriod"
              }
            ]
          }
        },
        "description": "Send only the fields to change. Changing isTransfer or isIncome on a parent Category changes its children too, and removes their budgets."
      },
      "UserApiUpdateCsvImportFormatRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Only the name can change. To change the columns, create a new CSV Import Format."
      },
      "UserApiUpdateTransactionsRequest": {
        "type": "object",
        "properties": {
          "transactions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UserApiTransactionUpdate"
            },
            "description": "1 to 500 Transactions of the Bank Account. Each id can appear once."
          }
        }
      }
    },
    "securitySchemes": {
      "UserApiAccessToken": {
        "type": "http",
        "description": "A User API Access Token, in the form nm_uat_...",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "UserApiAccessToken": [ ]
    }
  ],
  "tags": [
    {
      "name": "Bank Accounts"
    },
    {
      "name": "Categorisation Rules"
    },
    {
      "name": "Categories"
    },
    {
      "name": "CSV Import Formats"
    },
    {
      "name": "Transactions"
    }
  ]
}