Folder

Create folder

Create a New Folder

This endpoint allows you to create a new folder by sending an HTTP POST request to the specified URL.

Request Body

  • name (string, required): The name of the folder to be created.

Example:

{
 "name": "Folder name 2"
}

Response

  • status (string): The status of the request.

  • data

  • folderId (string): The ID of the newly created folder.

  • message (string): A message related to the folder creation.

Example:

{
 "status": "",
 "data": {
 "folderId": "",
 "message": ""
 }
}

post/folder

Request

  • Base URL: https://api.speakai.co/v1
  • URL: https://api.speakai.co/v1/folder
  • Auth: API key in header x-speakai-key and API key in header x-access-token

Request body

folderIdstring

An existing folder ID. The create handler ignores this value, so you can leave it out. Optional. Empty string and null are accepted.

namestring required

The name you want to give the folder. Leading and trailing whitespace is stripped before the folder is saved. Required. The schema declares.trim, but the validation middleware discards the schema's converted value, so the trimming you see comes from the handler itself (it calls name.trim for both the duplicate check and the saved value) and from the Folder model, which sets trim: true on name. No maximum length is enforced anywhere.

defaultAssignTostring

A single user ID to assign the folder to. Use assignTo instead. When you send this and omit assignTo, the server wraps the value into a one-item assignTo array. Optional. Empty string and null are accepted. The schema declares a default of an empty string, but that default never reaches the handler because the middleware throws away the schema's converted value.

assignTostring[]

The user IDs you want the folder assigned to. Optional. No cap on the number of entries. The schema declares a default of an empty array, but that default never reaches the handler. Omitting assignTo is exactly what lets defaultAssignTo take effect, because the handler checks Array.isArray(assignTo) first.

descriptionstring

A short description of what the folder holds. It is saved exactly as you send it. Optional. Empty string and null are accepted. The schema declares.trim and a default of an empty string, but neither takes effect: the middleware discards the schema's converted value and the Folder model does not trim description, so leading and trailing whitespace is preserved.

sourceobject

Where the folder's content comes from. The create handler ignores this value, so it only takes effect on PUT /folder/{folderId}. Optional, and null is accepted. Accepts three optional inner keys: type (string, empty string and null allowed), subCategory (string, empty string and null allowed), and fields (array, null allowed, with no item schema declared so any entries pass). Any other inner key is rejected, including goal, which the Folder model stores but this schema does not accept.

Response

OK

statusstring

Changes

No recorded changes to this operation across all 2 revisions of this API.