{
  "openapi": "3.1.0",
  "info": {
    "version": "2.0",
    "title": "Introduction",
    "summary": "V2 of the TidyHQ API",
    "description": "The TidyHQ API allows access to your organisations data (both read and write operations).\n\nV2 is an incremental change over API V1 - API V1 still exists and is supported, but we'll slowly be porting across functionality to use the new responses and structures in V2 as time goes on.\n\nToday, V2 brings improved insight into your organisations structure, as well as the ability to create and manage subscriptions more succinctly.\n\nThe full OpenAPI specification for this version is available at [https://api.tidyhq.com/v2/openapi.json](https://api.tidyhq.com/v2/openapi.json).\n",
    "termsOfService": "https://www.tidyhq.com/terms-of-service",
    "contact": {
      "name": "TidyHQ",
      "url": "https://www.tidyhq.com/"
    }
  },
  "servers": [
    {
      "url": "https://api.tidyhq.com/v2",
      "description": "Primary"
    }
  ],
  "paths": {
    "/invoices": {
      "get": {
        "tags": [
          "Finances"
        ],
        "summary": "List Invoices",
        "description": "Returns a list of all invoices",
        "operationId": "list-invoices",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter invoice to only those selected, allows multiple with comma.",
            "schema": {
              "enum": [
                "activated",
                "cancelled"
              ],
              "default": "activated"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "post": {
        "tags": [
          "Finances"
        ],
        "summary": "Create an Invoice",
        "description": "Creates a new invoice, taking in user defined line items.",
        "operationId": "create-invoices",
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string"
                  },
                  "contact_id": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "string"
                  },
                  "due_date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "line_items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "quantity": {
                          "type": "integer"
                        },
                        "account_id": {
                          "type": "integer"
                        },
                        "tax_mode": {
                          "enum": [
                            "none",
                            "on_top",
                            "included"
                          ]
                        },
                        "transfer_to_organisation_code": {
                          "type": "string"
                        },
                        "transfer_description": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "amount",
                        "quantity",
                        "account_id",
                        "tax_mode"
                      ]
                    }
                  }
                },
                "required": [
                  "due_date",
                  "line_items"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/invoices/{invoiceID}": {
      "get": {
        "tags": [
          "Finances"
        ],
        "summary": "Get An Invoice",
        "description": "Gets a single specified invoice",
        "operationId": "get-invoice",
        "parameters": [
          {
            "name": "invoiceID",
            "in": "path",
            "description": "The id of the given invoice",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "patch": {
        "tags": [
          "Finances"
        ],
        "summary": "Update an Invoice",
        "description": "Updates a specified invoice",
        "operationId": "update-invoice",
        "parameters": [
          {
            "name": "invoiceID",
            "in": "path",
            "description": "The id of the given invoice",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string"
                  },
                  "contact_id": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "string"
                  },
                  "due_date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "line_items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Set to the id of an existing line item to update / remove, If no id is given, a new line item will be added."
                        },
                        "_destroy": {
                          "type": "boolean",
                          "description": "Pass true in combination with id to remove a line item."
                        },
                        "name": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "quantity": {
                          "type": "integer"
                        },
                        "account_id": {
                          "type": "integer"
                        },
                        "tax_mode": {
                          "enum": [
                            "none",
                            "on_top",
                            "included"
                          ]
                        },
                        "transfer_to_organisation_code": {
                          "type": "string"
                        },
                        "transfer_description": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "amount",
                        "quantity",
                        "account_id",
                        "tax_mode"
                      ]
                    }
                  }
                },
                "required": [
                  "due_date",
                  "line_items"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "delete": {
        "tags": [
          "Finances"
        ],
        "summary": "Delete an Invoice",
        "description": "Removes a specified invoice",
        "operationId": "delete-invoice",
        "parameters": [
          {
            "name": "invoiceID",
            "in": "path",
            "description": "The id of the given invoice",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/memberships": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "List Memberships",
        "description": "List all memberships for the current organisation",
        "operationId": "get-memberships",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "all",
            "in": "query",
            "description": "If true, returns all visible (pending + cancelled subscriptions) - otherwise, only reportable (activated, partial and expired) - Memberships",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "active",
            "in": "query",
            "description": "If given, returns only active / inactive memberships (active is partial and activated status)",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Membership"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/memberships/{membershipID}": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "Get a Membership",
        "description": "Returns a single membership, given by the specified ID.",
        "operationId": "get-membership",
        "parameters": [
          {
            "name": "membershipID",
            "in": "path",
            "description": "The ID of the given membership",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/memberships/{membershipID}/subscriptions": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "List Membership Subscriptions",
        "description": "Lists all of the subscriptions attached to a given membership.",
        "operationId": "get-membership-subscriptions",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "active",
            "in": "query",
            "description": "Returns only active (or, conversely, inactive) subscriptions.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "membershipID",
            "in": "path",
            "description": "The ID of the given membership",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Subscription"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "post": {
        "tags": [
          "Memberships"
        ],
        "summary": "Renew / Create a Subscription for the given Membership",
        "description": "Creates a new subscription (e.g. renewal) within a specified membership.",
        "operationId": "create-membership-subscription",
        "parameters": [
          {
            "name": "membershipID",
            "in": "path",
            "description": "The ID of the given membership",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "member": {
                    "$ref": "#/components/schemas/Matchable-Contact",
                    "description": "On an individual membership level, change who it belongs to."
                  },
                  "adults": {
                    "type": "array",
                    "description": "For family memberships, changes the associated adults.",
                    "items": {
                      "$ref": "#/components/schemas/Matchable-Contact"
                    }
                  },
                  "children": {
                    "type": "array",
                    "description": "For family memberships, changes the associated children.",
                    "items": {
                      "$ref": "#/components/schemas/Matchable-Contact"
                    }
                  },
                  "variations": {
                    "type": "object",
                    "description": "A object mapping variation ids to variation value ids."
                  },
                  "payment_type": {
                    "enum": [
                      "paid",
                      "invoice",
                      "pay_now"
                    ],
                    "description": "Payment status of subscription, note that paid covers partially paid subscriptions."
                  },
                  "payment_method": {
                    "enum": [
                      "cash",
                      "card",
                      "cheque",
                      "bank",
                      "other"
                    ],
                    "description": " Required when payment_type is paid, How the paid amount was paid. One of \"cash\", \"card\", \"cheque\", \"bank\", \"other\""
                  },
                  "partial_payment_amount": {
                    "type": "string",
                    "description": "When marked as paid, and it's already partially-paid, an amount that has already been paid."
                  },
                  "ref_no": {
                    "type": "string",
                    "description": "When marked as paid, allows overriding the transaction ref for the given paid transaction. If left blank, will be automatically generated."
                  },
                  "due_date": {
                    "type": "string",
                    "description": "When paying by invoice, when said invoice is due.\n"
                  },
                  "send_welcome_mail": {
                    "type": "boolean",
                    "description": "Send a membership welcome email.",
                    "default": true
                  },
                  "send_invoice_mail": {
                    "type": "boolean",
                    "description": "When paying by invoice, should we send an email with invoice details. "
                  },
                  "auto_assign_users": {
                    "type": "boolean",
                    "description": "When processing contacts on the membership, should we automatically assign (either find existing, or create a new) user for them in Tidy. If users are created, will automatically send an account sign up email as well. For users to be automatically created / assigned, they require all of a first name, last name and an email address.",
                    "default": true
                  },
                  "auto_renew": {
                    "type": "boolean",
                    "description": "Will set explicitly if the membership should auto renew, if possible. Defaults to use the value set on the membership level, but can overwrite if needed."
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "payment_type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Subscription"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "payment_url": {
                          "type": "string",
                          "description": "when valid, a URL (pre-authed) a user can use to pay for the membership."
                        },
                        "invoice_id": {
                          "type": "string",
                          "description": "when valid, the ID of the appropriate Invoice to be used with the invoices API"
                        },
                        "membership": {
                          "$ref": "#/components/schemas/Membership",
                          "description": "A preview of the membership"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/subscriptions": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "List All Subscriptions",
        "description": "Lists all subscriptions, with the given filtering applied.",
        "operationId": "get-subscriptions",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "active",
            "in": "query",
            "description": "Returns only active (or, conversely, inactive) subscriptions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Subscription"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/subscriptions/{subscriptionID}": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "Get a Subscription",
        "description": "Retrieves a specific, single subscription by ID.",
        "operationId": "get-subscription",
        "parameters": [
          {
            "name": "subscriptionID",
            "in": "path",
            "description": "The ID of the given subscription",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/memberships/{membershipID}/subscriptions/{subscriptionID}": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "Get a Subscription within a Membership",
        "description": "Returns a single subscription under a given membership.",
        "operationId": "get-membership-subscription",
        "parameters": [
          {
            "name": "membershipID",
            "in": "path",
            "description": "The ID of the given membership",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subscriptionID",
            "in": "path",
            "description": "The ID of the given subscription under the given membership",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "patch": {
        "tags": [
          "Memberships"
        ],
        "summary": "Update a Specific Subscription in a Membership",
        "description": "Updates a single subscription, to change the start / end date, or current state of said subscription.",
        "operationId": "update-subscription",
        "parameters": [
          {
            "name": "membershipID",
            "in": "path",
            "description": "The ID of the given membership",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subscriptionID",
            "in": "path",
            "description": "The ID of the given subscription under the given membership",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_date": {
                    "type": "string",
                    "description": "When provided, updates the given subscriptions start date and recalculates state.",
                    "format": "date"
                  },
                  "end_date": {
                    "type": "string",
                    "description": "When provided, updates the given subscriptions end date and recalculates state.",
                    "format": "date"
                  },
                  "state": {
                    "enum": [
                      "active",
                      "partial",
                      "expired",
                      "cancelled"
                    ],
                    "description": "When provided, allows manually overriding the state of the given subscription"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "List Contacts",
        "description": "Fetchs  list of all contacts in the current org, with optional lookup filtering applied.",
        "operationId": "get-contacts",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "registered",
            "in": "query",
            "description": "When given, returns only users with / without a user account attached.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "all",
            "in": "query",
            "description": "When given, returns all (including inactive) - defaults to only returning visible / active.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "When given (as a comma-seperated list), filters to those matching the given IDs. Can be combined with scope to specify the type of ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "If specified, applies ids to the specified type. If not given, will default to check the id reference or the id.",
            "schema": {
              "enum": [
                "sports_australia_connect",
                "contact_id_number"
              ]
            }
          },
          {
            "name": "search_terms",
            "in": "query",
            "description": "If given, applies search terms (e.g. name / email) to filter the collection",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter_equals[first_name]",
            "in": "query",
            "description": "Filter contacts to those whose first name exactly matches the given value. Can be supplied multiple times.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter_equals[last_name]",
            "in": "query",
            "description": "Filter contacts to those whose last name exactly matches the given value. Can be supplied multiple times.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter_equals[company]",
            "in": "query",
            "description": "Filter contacts to those whose company exactly matches the given value. Can be supplied multiple times.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter_equals[email_address]",
            "in": "query",
            "description": "Filter contacts to those whose email address exactly matches the given value. Can be supplied multiple times.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter_equals[phone_number]",
            "in": "query",
            "description": "Filter contacts to those whose phone number exactly matches the given value. Can be supplied multiple times.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter_equals[kind]",
            "in": "query",
            "description": "Filter contacts to those whose kind exactly matches the given value. Can be supplied multiple times.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter_equals[contact_id_number]",
            "in": "query",
            "description": "Filter contacts to those whose contact ID number exactly matches the given value. Can be supplied multiple times.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Contact"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Create a Contact",
        "operationId": "create-contact",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "properties": {
                        "field_name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Creates a new contact with the given data",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Contact"
              }
            }
          }
        }
      }
    },
    "/contacts/me": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get The Current Contact",
        "description": "Returns the contact associated with the contact whose API token you're currently using.\n\nThis is useful as an \"identity\" call, e.g. to get information requires for authentication within a system.",
        "operationId": "get-contacts-me",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/contacts/{contactID}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Get a Contact",
        "description": "Fetches a single contact by the ID. Note, you can also provide `scope` as you would on the index list, in which case we're query according to the specified ID.",
        "operationId": "get-contact",
        "parameters": [
          {
            "name": "contactID",
            "in": "path",
            "description": "The contact ID, for whom to get the response.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "patch": {
        "tags": [
          "Contacts"
        ],
        "summary": "Update a Contact",
        "operationId": "update-contact",
        "parameters": [
          {
            "name": "contactID",
            "in": "path",
            "description": "The contact ID, for whom to get the response.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "object",
                      "properties": {
                        "field_name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Updates a given contact",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Contact"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a Contact",
        "operationId": "delete-contact",
        "parameters": [
          {
            "name": "contactID",
            "in": "path",
            "description": "The contact ID, for whom to get the response.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "description": "Deletes a specified contact"
      }
    },
    "/association/organizations": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "List Associated Organisations",
        "description": "Returns the list of all associated organisations attached to the current org.",
        "operationId": "get-associated-organizations",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Organisation"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/association/organizations/{organizationID}": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "Get an Associated Organisation",
        "description": "Gets a single specified associated organisation.",
        "operationId": "get-associated-organization",
        "parameters": [
          {
            "name": "organizationID",
            "in": "path",
            "description": "The associated organisation's ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organisation"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/association/organizations/{organizationID}/admins": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "List Admins of an Associated Organization",
        "description": "Gets the admins declared for one of your associated organisations.",
        "operationId": "get-association-organizations-organizationID-admins",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "organizationID",
            "in": "path",
            "description": "The associated organisation's ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Contact"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/association/organizations/{organizationID}/roles": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "List an Associated Organisations Roles",
        "description": "Gets the roles declared for one of your associated organisations.",
        "operationId": "get-association-organizations-organizationID-roles",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "organizationID",
            "in": "path",
            "description": "The associated organisation's ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Role"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/contacts/{contactID}/memberships": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "List a given Contacts Memberships",
        "description": "Gets all memberships for a given single contact.",
        "operationId": "get-contact-memberships",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "contactID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Membership"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/contacts/{contactID}/memberships/{membershipID}": {
      "get": {
        "tags": [
          "Memberships",
          "Contacts"
        ],
        "summary": "Get a Membership for a specific Contact",
        "description": "Get a specified membership for a given contact.",
        "operationId": "get-membership-for-contact",
        "parameters": [
          {
            "name": "contactID",
            "in": "path",
            "description": "The contact for whom you wish to get the membership",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipID",
            "in": "path",
            "description": "The specific membership ID you wish to get.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/contacts/{contactID}/memberships/{membershipID}/subscriptions": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "List Subscriptions for a given Contacts specific Membership",
        "description": "For a given contact + membership, returns the list of subscriptions associated with them.",
        "operationId": "get-contacts-contactID-memberships-membershipID-subscriptions",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "active",
            "in": "query",
            "description": "Returns only active (or, conversely, inactive) subscriptions.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "contactID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Subscription"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/contacts/{contactID}/memberships/{membershipID}/subscriptions/{subscriptionID}": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "Get a specific suscription within a specific membership / contact",
        "description": "Returns a specific subscription, scoped to a given contact and membership.",
        "operationId": "get-contacts-contactID-memberships-membershipID-subscriptions-sibscriptionID",
        "parameters": [
          {
            "name": "contactID",
            "in": "path",
            "description": "The contact for whom you wish to get a subscription for",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipID",
            "in": "path",
            "description": "The membership for whom you wish to get the subscription for",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subscriptionID",
            "in": "path",
            "description": "The subscription itself",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/membership_levels": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "List Membership Levels",
        "description": "Returns all membership levels currently configured for the given organisation.",
        "operationId": "get-membership_levels",
        "parameters": [
          {
            "name": "all",
            "in": "query",
            "description": "When given, returns all (including deleted) - defaults to only returning visible / non-deleted levels.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Membership-Level"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/membership_levels/{membershipLevelID}": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "Get a specified Membership Level",
        "description": "Retrieves a single specified membership level.",
        "operationId": "get-membership-level",
        "parameters": [
          {
            "name": "membershipLevelID",
            "in": "path",
            "description": "The membership level which to get",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership-Level"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/membership_levels/{membershipLevelID}/pricing_variations": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "Get the Pricing Variations for a given Membership Level",
        "description": "When enabled, returns the pricing variations configured under a specified membership level along with any nested items.",
        "operationId": "get-membership_levels-membershipLevelID-pricing_variations",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "membershipLevelID",
            "in": "path",
            "description": "The membership level to query under.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Pricing-Variation"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/membership_levels/{membershipLevelID}/pricing_variations/{pricingVariationID}": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "summary": "Get a specific Pricing Variation for a given Membership Level",
        "description": "Gets a single pricing variation for a given membersship level.",
        "operationId": "get-membership_levels-membershipLevelID-pricing_variations-pricingVariationID",
        "parameters": [
          {
            "name": "membershipLevelID",
            "in": "path",
            "description": "The membership level to query under.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pricingVariationID",
            "in": "path",
            "description": "The pricing variation to retrieve",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pricing-Variation"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/organization": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "Get the current organisation",
        "description": "Returns the organisation the current token is associated with, including their domain prefix etc.",
        "operationId": "get-organization",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organisation"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/organization/admins": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "List Admins for the Current Organisation",
        "description": "Returns all admins configured / provisioned for the current organisation.",
        "operationId": "get-organization-admins",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Contact"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/organization/roles": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "List Roles for the Current Organisation",
        "description": "Gets the roles for the current organisation",
        "operationId": "get-organization-roles",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Role"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/membership_levels/{membershipLevelID}/subscriptions": {
      "post": {
        "tags": [
          "Memberships"
        ],
        "summary": "Create a new Membership / Subscription",
        "description": "Creates a new subscription, which will in turn create an associated membership.\n\nThis endpoint allows the progmatic addition of members, and associated control over the details of the given member.",
        "operationId": "create-membership-level-subscription",
        "parameters": [
          {
            "name": "membershipLevelID",
            "in": "path",
            "description": "The membership level to subscribe to.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "member": {
                    "$ref": "#/components/schemas/Matchable-Contact",
                    "description": "Required if an individual membership level, denotes who it belongs to."
                  },
                  "adults": {
                    "type": "array",
                    "description": "For family memberships, the associated adults.",
                    "items": {
                      "$ref": "#/components/schemas/Matchable-Contact"
                    }
                  },
                  "children": {
                    "type": "array",
                    "description": "For family memberships, the associated children.\n",
                    "items": {
                      "$ref": "#/components/schemas/Matchable-Contact"
                    }
                  },
                  "variations": {
                    "type": "object",
                    "description": "A object mapping variation ids to variation value ids."
                  },
                  "payment_type": {
                    "enum": [
                      "paid",
                      "invoice",
                      "pay_now"
                    ],
                    "description": "Payment status of subscription, note that paid covers partially paid subscriptions."
                  },
                  "payment_method": {
                    "enum": [
                      "cash",
                      "card",
                      "cheque",
                      "bank",
                      "other"
                    ],
                    "description": " Required when payment_type is paid, How the paid amount was paid. One of \"cash\", \"card\", \"cheque\", \"bank\", \"other\""
                  },
                  "partial_payment_amount": {
                    "type": "string",
                    "description": "When marked as paid, and it's already partially-paid, an amount that has already been paid."
                  },
                  "ref_no": {
                    "type": "string",
                    "description": "When marked as paid, allows overriding the transaction ref for the given paid transaction. If left blank, will be automatically generated."
                  },
                  "due_date": {
                    "type": "string",
                    "description": "When paying by invoice, when said invoice is due.\n"
                  },
                  "send_welcome_mail": {
                    "type": "boolean",
                    "description": "Send a membership welcome email.",
                    "default": true
                  },
                  "send_invoice_mail": {
                    "type": "boolean",
                    "description": "When paying by invoice, should we send an email with invoice details. "
                  },
                  "auto_assign_users": {
                    "type": "boolean",
                    "description": "When processing contacts on the membership, should we automatically assign (either find existing, or create a new) user for them in Tidy. If users are created, will automatically send an account sign up email as well. For users to be automatically created / assigned, they require all of a first name, last name and an email address.",
                    "default": true
                  },
                  "auto_renew": {
                    "type": "boolean",
                    "description": "Will set explicitly if the membership should auto renew, if possible. Defaults to use the value set on the membership level, but can overwrite if needed."
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "payment_type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Subscription"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "payment_url": {
                          "type": "string",
                          "description": "when valid, a URL (pre-authed) a user can use to pay for the membership."
                        },
                        "invoice_id": {
                          "type": "string",
                          "description": "when valid, the ID of the appropriate Invoice to be used with the invoices API"
                        },
                        "membership": {
                          "$ref": "#/components/schemas/Membership",
                          "description": "A preview of the membership"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/contacts/{contactID}/links": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Link two contacts",
        "description": "Given a source contact, links them to another contact.",
        "operationId": "create-contact-link",
        "parameters": [
          {
            "name": "contactID",
            "in": "path",
            "description": "Contact who is the source of the link",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "related_id": {
                    "type": "string",
                    "description": "Contact ID of the contact to link to."
                  },
                  "type": {
                    "enum": [
                      "child",
                      "parent",
                      "adult",
                      "associated",
                      "personnel",
                      "personnel_of"
                    ],
                    "description": "Type of relation to make"
                  },
                  "title": {
                    "type": "string",
                    "description": "If relevant, a custom title for the link."
                  }
                },
                "required": [
                  "related_id",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact-Link"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/contacts/{contactID}/links/{linkedContactID}": {
      "patch": {
        "tags": [
          "Contacts"
        ],
        "summary": "Update Contact Link",
        "description": "Given two contacts, updates the existing link between them.",
        "operationId": "update-contact-link",
        "parameters": [
          {
            "name": "contactID",
            "in": "path",
            "description": "Contact who is the source of the link",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkedContactID",
            "in": "path",
            "description": "Contact who is the target of the link",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "enum": [
                      "child",
                      "parent",
                      "adult",
                      "associated",
                      "personnel",
                      "personnel_of"
                    ]
                  },
                  "title": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact-Link"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Remove Contact Link",
        "description": "Given two contacts, removes the existing link between them.",
        "operationId": "delete-contacts-link",
        "parameters": [
          {
            "name": "contactID",
            "in": "path",
            "description": "Contact who is the source of the link",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkedContactID",
            "in": "path",
            "description": "Contact who is the target of the link",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact-Link"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/triggered_events": {
      "get": {
        "tags": [
          "Triggered Events"
        ],
        "summary": "List Triggered Events",
        "description": "Returns a list of webhook events generated by the given organization, up to a maximum retention limit. Events are sorted newest to oldest. Only events from the past 30 days are included, and the objects (such as a contact or event) are included in their current version, not necessarily the version when the event was created. You must be an administrator to access this API.",
        "operationId": "get-triggered_events",
        "parameters": [
          {
            "$ref": "#/components/parameters/updated_since"
          },
          {
            "$ref": "#/components/parameters/updated_before"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "name": "kinds[]",
            "in": "query",
            "description": "Filter to a specific kind of event (specify the parameter multiple times to filter to multiple kinds).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TriggeredEvent"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/triggered_events/{triggeredEventID}": {
      "get": {
        "tags": [
          "Triggered Events"
        ],
        "summary": "Get a Triggered Event",
        "description": "Returns a particular webhook event. You must be an administrator to access this API.",
        "operationId": "get-triggered_event",
        "parameters": [
          {
            "name": "triggeredEventID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggeredEvent"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List Webhooks",
        "description": "Returns a list of webhooks. You must be an administrator to access this API.",
        "operationId": "get-webhooks",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Webhook"
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a Webhook",
        "description": "Creates a new webhook with the given parameters. You must be an administrator to access this API.",
        "operationId": "create-webhook",
        "requestBody": {
          "description": "See webhook documentation for description on this parameters.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "examples": [
                      "https://example.com/my-webhook-url"
                    ]
                  },
                  "matching_kind": {
                    "type": "string",
                    "pattern": "^(((([a-z]+\\.)+([a-z]+|\\*))(,|$))|\\*)+$",
                    "examples": [
                      "contact.*,test.*"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "examples": [
                      "My description"
                    ]
                  },
                  "allow_state_changes": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/webhooks/{webhookId}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a Webhook",
        "description": "Returns a particular webhook. You must be an administrator to access this API.",
        "operationId": "get-webhook",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a Webhook",
        "description": "Deletes a particular webhook. You must be an administrator to access this API.",
        "operationId": "delete-webhook",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully Deleted"
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/webhooks/{webhookId}/activate": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Activate a Webhook",
        "description": "Sets a webhook to the active state, if it allows state changes. You must be an administrator to access this API.",
        "operationId": "activate-webhook",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully Activated"
          },
          "422": {
            "description": "Webhook does not permit state changes, or is already in this state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/webhooks/{webhookId}/deactivate": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Deactivate a Webhook",
        "description": "Sets a webhook to the disabled state, if it allows state changes. You must be an administrator to access this API.",
        "operationId": "deactivate-webhook",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successfully Deactivated"
          },
          "422": {
            "description": "Webhook does not permit state changes, or is already in this state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://api.tidyhq.com/v2",
            "description": "Primary"
          }
        ]
      }
    },
    "/custom_fields": {
      "get": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "List Custom Fields",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Custom-Field-Schema"
                  }
                }
              }
            }
          }
        },
        "operationId": "list-custom-fields",
        "description": "Returns a list of all custom fields currently configured for the given organization."
      }
    },
    "/invoices/{invoiceID}/notes": {
      "parameters": [
        {
          "schema": {
            "type": "string"
          },
          "name": "invoiceID",
          "in": "path",
          "required": true
        }
      ],
      "post": {
        "tags": [
          "Finances"
        ],
        "summary": "Create Invoice Note",
        "operationId": "create-invoice-note",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          }
        },
        "description": "Adds a note to a specified invoice.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        }
      }
    },
    "/invoices/{invoiceID}/notes/{noteId}": {
      "parameters": [
        {
          "schema": {
            "type": "string"
          },
          "name": "invoiceID",
          "in": "path",
          "required": true
        },
        {
          "schema": {
            "type": "string"
          },
          "name": "noteId",
          "in": "path",
          "required": true
        }
      ],
      "delete": {
        "tags": [
          "Finances"
        ],
        "summary": "Delete Invoice Note",
        "operationId": "delete-invoice-note",
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "description": "Deletes a specified note from a specified invoice."
      }
    },
    "/contacts/{contactId}/notes": {
      "parameters": [
        {
          "schema": {
            "type": "string"
          },
          "name": "contactId",
          "in": "path",
          "required": true
        }
      ],
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Create Contact Note",
        "operationId": "create-contact-note",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          }
        },
        "description": "Adds a note to a specified contact.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        }
      }
    },
    "/contacts/{contactId}/notes/{noteId}": {
      "parameters": [
        {
          "schema": {
            "type": "string"
          },
          "name": "contactId",
          "in": "path",
          "required": true
        },
        {
          "schema": {
            "type": "string"
          },
          "name": "noteId",
          "in": "path",
          "required": true
        }
      ],
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Delete Contact Note",
        "operationId": "delete-contact-note",
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "description": "Deletes a specified note from a specified contact."
      }
    },
    "/memberships/{membershipId}/notes": {
      "parameters": [
        {
          "schema": {
            "type": "string"
          },
          "name": "membershipId",
          "in": "path",
          "required": true
        }
      ],
      "post": {
        "tags": [
          "Memberships"
        ],
        "summary": "Create Membership Note",
        "operationId": "create-membership-note",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Note"
                }
              }
            }
          }
        },
        "description": "Adds a note to a specified membership.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        }
      }
    },
    "/memberships/{membershipId}/notes/{noteId}": {
      "parameters": [
        {
          "schema": {
            "type": "string"
          },
          "name": "membershipId",
          "in": "path",
          "required": true
        },
        {
          "schema": {
            "type": "string"
          },
          "name": "noteId",
          "in": "path",
          "required": true
        }
      ],
      "delete": {
        "tags": [
          "Memberships"
        ],
        "summary": "Delete Membership Note",
        "operationId": "delete-membership-note",
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "description": "Deletes a specified note from a specified membership."
      }
    }
  },
  "tags": [
    {
      "name": "Contacts"
    },
    {
      "name": "Finances"
    },
    {
      "name": "Memberships"
    },
    {
      "name": "Organisations"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Custom Fields"
    }
  ],
  "x-tagGroups": [
    {
      "name": "API Resources",
      "tags": [
        "Contacts",
        "Finances",
        "Memberships",
        "Organisations",
        "Webhooks",
        "Custom Fields"
      ]
    },
    {
      "name": "Webhooks Documentation",
      "tags": [
        "Managing Webhooks",
        "Webhook Events",
        "Signature Verification",
        "Self-Notification"
      ]
    }
  ],
  "components": {
    "parameters": {
      "updated_since": {
        "name": "updated_since",
        "in": "query",
        "description": "ISO8601 formatted timestamp, only returns results last updated since the given time.",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "description": "How many items per page to return",
        "required": false,
        "schema": {
          "type": "integer"
        }
      },
      "offset": {
        "name": "offset",
        "in": "query",
        "description": "Paginated offset of items (how many to skip)",
        "required": false,
        "schema": {
          "type": "integer"
        }
      },
      "updated_before": {
        "name": "updated_before",
        "in": "query",
        "description": "ISO8601 formatted timestamp, only returns results last updated before the given time.",
        "required": false,
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "securitySchemes": {
      "your-api-key": {
        "type": "oauth2",
        "flows": {
          "password": {
            "refreshUrl": "",
            "tokenUrl": "https://accounts.tidyhq.com/oauth/token",
            "scopes": {}
          },
          "implicit": {
            "refreshUrl": "",
            "authorizationUrl": "https://accounts.tidyhq.com/oauth/authorize",
            "scopes": {}
          },
          "authorizationCode": {
            "authorizationUrl": "https://accounts.tidyhq.com/oauth/authorize",
            "scopes": {},
            "tokenUrl": "https://accounts.tidyhq.com/oauth/token"
          }
        }
      }
    },
    "schemas": {
      "Invoice": {
        "type": "object",
        "description": "The generic invoice model type.",
        "properties": {
          "id": {
            "type": "string"
          },
          "ref_no": {
            "type": "string"
          },
          "subtype": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "due_date": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "pre_tax_amount": {
            "type": "number"
          },
          "included_tax_total": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "description": {
            "type": "null"
          },
          "paid_amount": {
            "type": "number"
          },
          "outstanding_amount": {
            "type": "number"
          },
          "paid": {
            "type": "boolean"
          },
          "payment_type": {
            "type": "string"
          },
          "paid_date": {
            "type": "string"
          },
          "payments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "paid_at": {
                  "type": "string"
                },
                "payment_type": {
                  "type": "string"
                },
                "total": {
                  "type": "number"
                },
                "fee_total": {
                  "type": "number"
                },
                "receipt_url": {
                  "type": "string"
                }
              }
            }
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "issuer": {
            "$ref": "#/components/schemas/Contact"
          },
          "line_items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "amount": {
                  "type": "number"
                },
                "category": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "tax_mode": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    }
                  }
                },
                "pre_tax_amount": {
                  "type": "number"
                },
                "included_tax_total": {
                  "type": "number"
                }
              }
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          }
        },
        "examples": []
      },
      "Membership": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Human-readable version of state."
          },
          "membership_id_reference": {
            "type": "integer"
          },
          "auto_renew_on": {
            "type": "boolean"
          },
          "auto_renew": {
            "type": "boolean"
          },
          "membership_level_id": {
            "type": "string"
          },
          "contact_id": {
            "type": "string"
          },
          "adult_members_contact_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "child_members_contact_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "start_date": {
            "type": "string",
            "format": "date",
            "examples": [
              "2023-03-01"
            ]
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "examples": [
              "2023-03-31"
            ]
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          }
        }
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Human-readable version of state."
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "start_date": {
            "type": "string"
          },
          "end_date": {
            "type": "string"
          },
          "membership_id": {
            "type": "string"
          },
          "variations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "visibility": {
                  "type": "string"
                },
                "price": {
                  "type": "string"
                },
                "answer": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  }
                },
                "destination": {
                  "$ref": "#/components/schemas/Pricing-Variation-Value-Destination"
                },
                "autofill_group": {
                  "$ref": "#/components/schemas/Pricing-Variation-Value-Autofill-Group"
                },
                "question": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Pricing-Variation-Value-Destination": {
        "type": "object",
        "title": "Pricing-Variation-Value-Destination",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "descrption": null
          },
          "title": {
            "type": "string",
            "description": "Human-readable version of the type of destination"
          },
          "name": {
            "type": "string",
            "description": "the name of the destination"
          }
        }
      },
      "Pricing-Variation-Value-Autofill-Group": {
        "type": "object",
        "title": "Pricing-Variation-Value-Autofill-Group",
        "properties": {
          "id": {
            "type": "string"
          },
          "group_id_reference": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Matchable-Contact": {
        "type": "object",
        "title": "Matchable-Contact",
        "properties": {
          "contact_id": {
            "type": "string",
            "description": "If provided, the alphanumeric code of an existing member."
          },
          "email_address": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "contact_id_reference": {
            "type": "integer"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "nick_name": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "email_address": {
            "type": "string"
          },
          "phone_number": {
            "type": "string"
          },
          "address1": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "birthday": {
            "type": "string"
          },
          "facebook": {
            "type": "string"
          },
          "linkedin": {
            "type": "string"
          },
          "instagram": {
            "type": "string"
          },
          "website": {
            "type": "null"
          },
          "twitter": {
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "subscribed": {
            "type": "boolean"
          },
          "metadata": {
            "type": "null"
          },
          "emergency_contact_person": {
            "type": "string"
          },
          "emergency_contact_number": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "is_company": {
            "type": "boolean"
          },
          "contact_id_number": {
            "type": "string"
          },
          "sports_connect_id": {
            "type": "string"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "is_primary": {
                "type": "boolean"
              },
              "email_address": {
                "type": "string",
                "format": "email"
              },
              "email_verified": {
                "type": "boolean"
              }
            }
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "member_since": {
            "type": "string"
          },
          "profile_image": {
            "type": "null"
          },
          "status": {
            "type": "string"
          },
          "custom_fields": {
            "type": "object",
            "properties": {
              "<custom_field_id>": {
                "$ref": "#/components/schemas/Custom-Field"
              }
            }
          },
          "organization": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "domain_prefix": {
                "type": "string"
              },
              "permissions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Group"
            }
          },
          "contact_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact-Link"
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          }
        }
      },
      "Custom-Field": {
        "type": "object",
        "title": "Custom-Field",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "enum": [
              "string",
              "text",
              "boolean",
              "checkbox_group",
              "radio_group",
              "file",
              "dropdown",
              "date"
            ]
          },
          "value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array"
              },
              {
                "type": "object"
              },
              {
                "type": "boolean"
              }
            ]
          }
        }
      },
      "Group": {
        "type": "object",
        "title": "Group",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "group_id_reference": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "datetime"
          },
          "updated_at": {
            "type": "string",
            "format": "datetime"
          },
          "size": {
            "type": "integer",
            "description": "How many contacts are within this group"
          },
          "image": {
            "type": "string",
            "description": "The URL representing this groups image.",
            "format": "url"
          }
        }
      },
      "Contact-Link": {
        "type": "object",
        "title": "Contact-Link",
        "properties": {
          "relationship_type": {
            "enum": [
              "family",
              "organization"
            ]
          },
          "title": {
            "type": "string",
            "description": "If specified, the title of the contact link."
          },
          "metadata": {
            "type": "object",
            "description": "Optional arbitrary metadata attached to the object."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "display_name": {
            "type": "string",
            "description": "Humanized version of the type field, suitable for display.\n"
          },
          "type": {
            "enum": [
              "child",
              "parent",
              "adult",
              "associated",
              "personnel",
              "personnel_of"
            ]
          },
          "contact_id": {
            "type": "string",
            "description": "Alphanumeric ID associated with the contact this link is towards."
          }
        },
        "required": [
          "relationship_type",
          "updated_at",
          "created_at",
          "display_name",
          "type"
        ]
      },
      "Organisation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "domain_prefix": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "website": {
            "type": "string"
          },
          "twitter": {
            "type": "string"
          },
          "facebook": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "time_zone": {
            "type": "string"
          },
          "public_contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "position": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "phone_number": {
                  "type": "string"
                }
              }
            }
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "logo_url": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "plan": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "quota": {
                "type": "object",
                "properties": {
                  "emails": {
                    "type": "object",
                    "properties": {
                      "limit": {
                        "type": "integer"
                      },
                      "sent": {
                        "type": "integer"
                      },
                      "count": {
                        "type": "integer"
                      }
                    }
                  },
                  "contacts": {
                    "type": "object",
                    "properties": {
                      "limit": {
                        "type": "integer"
                      },
                      "count": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "parent_organizations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "child_organizations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "id",
          "name",
          "domain_prefix",
          "email",
          "created_at",
          "updated_at"
        ]
      },
      "Role": {
        "type": "object",
        "title": "Role",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email_address": {
            "type": "string",
            "description": "If enabled, the email address to contact the members of this role.",
            "format": "email"
          },
          "responsibilities": {
            "type": "string"
          },
          "contact_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "responsibilities",
          "contact_ids",
          "created_at",
          "updated_at"
        ]
      },
      "Membership-Level": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "membership_level_id_reference": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "duration": {
            "type": "integer",
            "description": "(May contain HTML)"
          },
          "unit_period": {
            "type": "string"
          },
          "active_since": {
            "type": "string",
            "format": "date"
          },
          "amount": {
            "type": "number"
          },
          "bundle": {
            "type": "boolean"
          },
          "bundle_amounts": {
            "type": "array",
            "description": "Optional, present when bundle is true. Defines pricing for different member types in a family membership.",
            "items": {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{1,2}$"
                },
                "subsequent": {
                  "type": "boolean"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "adult",
                    "child"
                  ]
                }
              },
              "required": [
                "amount",
                "subsequent",
                "type"
              ]
            }
          },
          "plan_type": {
            "type": "string"
          },
          "auto_renew": {
            "type": "boolean"
          },
          "allow_renewal": {
            "type": "boolean"
          },
          "update_information_on_renewal": {
            "type": "boolean"
          },
          "renewable_from_period": {
            "type": [
              "integer",
              "null"
            ]
          },
          "renewable_for_period": {
            "type": [
              "integer",
              "null"
            ]
          },
          "extend_days_before_end": {
            "type": [
              "integer",
              "null"
            ]
          },
          "start_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "visible": {
            "enum": [
              "admin",
              "permitted",
              "anyone",
              "linked"
            ],
            "default": "anyone"
          }
        }
      },
      "Pricing-Variation": {
        "type": "object",
        "title": "Pricing-Variation",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "required": {
            "enum": [
              "Yes",
              "No"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "variation_values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pricing-Variation-Value"
            }
          }
        }
      },
      "Pricing-Variation-Value": {
        "type": "object",
        "title": "Pricing-Variation-Value",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "string",
            "pattern": "\\d+\\.\\d{0,2}",
            "examples": [
              "24.50"
            ]
          },
          "destination": {
            "$ref": "#/components/schemas/Pricing-Variation-Value-Destination"
          },
          "autofill_group": {
            "$ref": "#/components/schemas/Pricing-Variation-Value-Autofill-Group"
          },
          "visibility": {
            "type": "string"
          },
          "variations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pricing-Variation"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "amount",
          "visibility",
          "created_at",
          "updated_at"
        ]
      },
      "TriggeredEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created": {
            "type": "integer"
          },
          "data": {
            "type": "object"
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "matching_kind": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "signing_key_b64": {
            "type": "string"
          },
          "allow_state_changes": {
            "type": "boolean"
          }
        }
      },
      "Error": {
        "type": "object",
        "title": "Error",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "Custom-Field-Schema": {
        "type": "object",
        "title": "Custom-Field-Schema",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "enum": [
              "string",
              "text",
              "boolean",
              "checkbox_group",
              "radio_group",
              "file",
              "dropdown",
              "date"
            ]
          },
          "helper_text": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "multi_choice": {
            "type": "boolean"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        },
        "required": [
          "id",
          "title",
          "type",
          "helper_text",
          "position",
          "created_at",
          "updated_at"
        ]
      },
      "Note": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "author": {
            "type": "object"
          }
        },
        "title": "Note"
      }
    }
  }
}