Create a folder
POST/v1/sidebars/:sidebar_identifier/folders
This route allows you to create a folder in a sidebar. Folders let you organize pages in your platform's navigation.
To learn more about folders, check out the documentation.
Request
Parameters (JSON)
{
"parameters": [
{
"schema": {
"type": "string",
"enum": [
"catalog"
]
},
"in": "path",
"name": "sidebar_identifier",
"required": true,
"description": "The identifier of the sidebar. Currently only `catalog` is supported."
}
]
}Request body schema (JSON)
{
"title": "Body",
"body": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"identifier": {
"type": "string",
"pattern": "^[A-Za-z0-9@_=\\\\-]+$",
"minLength": 1,
"description": "The unique identifier of the folder."
},
"title": {
"type": "string",
"description": "The display title of the folder."
},
"icon": {
"type": "string",
"description": "The display icon of the folder.",
"nullable": true
},
"parent": {
"type": "string",
"nullable": true,
"description": "The identifier of the parent folder. Use `null` to place the folder at the root level of the sidebar."
},
"after": {
"type": "string",
"nullable": true,
"description": "The identifier of the sibling item after which this folder should appear. Use `null` to place the folder at the beginning of its parent."
}
},
"additionalProperties": false,
"required": [
"identifier",
"title"
]
}
}
},
"required": true
}
}Responses
- 201
- 401
- 404
- 413
- 422
Created successfully.
Default Response
A resource with the provided identifier was not found
Request body is too large (limit is 1MiB)
The json provided does not match the route's schema
Responses (JSON)
{
"responses": {
"201": {
"description": "Created successfully.",
"content": {
"application/json": {
"schema": {
"description": "Created successfully.",
"type": "object",
"properties": {
"ok": {
"enum": [
true
]
},
"folder": {
"type": "object",
"properties": {
"identifier": {
"type": "string",
"description": "The unique identifier of the folder."
},
"title": {
"type": "string",
"description": "The display title of the folder."
},
"icon": {
"type": "string",
"nullable": true,
"description": "The display icon of the folder."
},
"sidebar": {
"type": "string",
"description": "The identifier of the sidebar that contains the folder."
},
"parent": {
"type": "string",
"nullable": true,
"description": "The identifier of the parent folder. Omitted when the folder is at the root level of the sidebar."
},
"after": {
"type": "string",
"nullable": true,
"description": "The identifier of the sibling item after which this folder appears. Omitted when the folder is the first item in its parent."
},
"updatedBy": {
"type": "string"
},
"createdBy": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"updatedAt": {
"type": "string",
"format": "date-time"
}
},
"required": [
"identifier",
"title",
"sidebar",
"createdBy",
"updatedBy",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"folder",
"ok"
],
"additionalProperties": false
}
}
}
},
"401": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"404": {
"description": "A resource with the provided identifier was not found",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "A resource with the provided identifier was not found"
}
}
}
},
"413": {
"description": "Request body is too large (limit is 1MiB)",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false,
"description": "Request body is too large (limit is 1MiB)"
}
}
}
},
"422": {
"description": "The json provided does not match the route's schema",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "The json provided does not match the route's schema"
}
}
}
}
}
}