   (try
     ;; Create the new org from the data provided
     (let [org-map (:data ctx)
+          org-name (:name org-map)
           author (:user ctx)]
-      {:new-org (api-common/rep (org-res/->org org-map author))})
+      (if (and (<= (count org-name) org-name-max-length)
+               (>= (count org-name) org-name-min-length))
+        {:new-org (api-common/rep (org-res/->org org-map author))}
+        [false, {:reason (str "Org name too long. Max allowed length is " org-name-max-length)}]))
 
     (catch clojure.lang.ExceptionInfo e
       [false, {:reason (.getMessage e)}]))) ; Not a valid new org

  (if-let [org (org-res/get-org conn slug)]
    (let [samples? (:samples org-props)
          updated-props (if samples? (dissoc org-props :samples :boards) org-props)
          updated-org (merge org (org-res/ignore-props updated-props))]
      (if (lib-schema/valid? common-res/Org updated-org)
        {:existing-org (api-common/rep org) :updated-org (api-common/rep updated-org)
         :samples (api-common/rep samples?) :boards (api-common/rep (:boards org-props))}
        [false, {:updated-org (api-common/rep updated-org)}])) ; invalid update

            [oc.storage.resources.entry :as entry-res]))

;; ----- Utility functions -----

(def org-name-min-length 50)
(def org-name-max-length 50)

(defn- board-with-access-level
  "
