Skip To Content
ArcGIS Developers
Dashboard

/assignCategorySchema: Assign Category Schema (Organization)

  • URL:https://[root]/portals/[portalID]/assignCategorySchema(POST only)

Example usage

Below is a sample ArcGIS Online POST request for the assignCategorySchema operation:

POST /sharing/rest/portals/0123456789ABCDEF/assignCategorySchema HTTP/1.1
Host: org.arcgis.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

categorySchema={
  "categorySchema": [
    {
      "title": "Categories",
      "categories": [
        {
          "title": "Basemaps",
          "categories": [
            {
              "title": "Partner Basemap"
            },
            {
              "title": "Esri Basemaps",
              "categories": [
                {
                  "title": "Esri Raster Basemap"
                },
                {
                  "title": "Esri Vector Basemap"
                }
              ]
            }
          ]
        },
        {
          "title": "Imagery",
          "categories": [
            {
              "title": "Multispectral Imagery"
            },
            {
              "title": "Temporal Imagery"
            }
          ]
        }
      ]
    },
    {
      "title": "Region",
      "categories": [
        {
          "title": "US"
        },
        {
          "title": "World"
        }
      ]
    }
  ]
}&f=pjson

Below is a sample ArcGIS Enterprise POST request for the assignCategorySchema operation:

POST /webadaptor/sharing/rest/portals/0123456789ABCDEF/assignCategorySchema HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

categorySchema={
  "categorySchema": [
    {
      "title": "Categories",
      "categories": [
        {
          "title": "Basemaps",
          "categories": [
            {
              "title": "Partner Basemap"
            },
            {
              "title": "Esri Basemaps",
              "categories": [
                {
                  "title": "Esri Raster Basemap"
                },
                {
                  "title": "Esri Vector Basemap"
                }
              ]
            }
          ]
        },
        {
          "title": "Imagery",
          "categories": [
            {
              "title": "Multispectral Imagery"
            },
            {
              "title": "Temporal Imagery"
            }
          ]
        }
      ]
    },
    {
      "title": "Region",
      "categories": [
        {
          "title": "US"
        },
        {
          "title": "World"
        }
      ]
    }
  ]
}&f=pjson

Description

The assignCategorySchema operation (POST only) allows organization administrators to set up content categories for organization that is a hierarchical set of classes to help organize and browse items.

An organization can have a max of 5 category trees with each category schema can have up to 4 hierarchical levels. The maximum number of categories an organization can have in total is 200 with each category of less than 100 characters title and 300 characters description.

The operation is available to both Esri default administrators and custom roles with the portal:admin:updateItemCategorySchema privilege.

Request parameters

ParameterDetails
categorySchema

A categorySchema object that consists of an array of JSON objects representing top level categories. Each object has title, description and categories properties where categories consists of an array of objects with each having the same properties and represents the descendant categories or subcategories and so on.

Example:

{
  "categorySchema": [
    {
      "title": "Categories",
      "categories": [
        {
          "title": "Basemaps",
          "categories": [
            {
              "title": "Partner Basemap"
            },
            {
              "title": "Esri Basemaps",
              "categories": [
                {
                  "title": "Esri Raster Basemap"
                },
                {
                  "title": "Esri Vector Basemap"
                }
              ]
            }
          ]
        },
        {
          "title": "Imagery",
          "categories": [
            {
              "title": "Multispectral Imagery"
            },
            {
              "title": "Temporal Imagery"
            }
          ]
        }
      ]
    },
    {
      "title": "Region",
      "categories": [
        {
          "title": "US"
        },
        {
          "title": "World"
        }
      ]
    }
  ]
}
f

The response format. The default format is html.

Values: html | json | pjson

Response properties

PropertyDetails
success

Indicates if the operation was successful.

JSON Response syntax

{
  "success": true
}

JSON Response example

Below is a sample success response:

{
  "success": true
}

Below is a sample error message:

{
  "error": {
    "code": 400,
    "messageCode": "ORG_1132",
    "message": "Unable to assign category schema.",
    "details": ["Category schema exceeds max tree size or empty."]
  }
}