Create a new folder

post/folders
Internal-Use Only

Creates a new empty folder. Members can be added to the folder using the /folders/{folderId}/members endpoint. This service maintains name uniqueness at any given level in the folder structure. In other words, if you try to create a root folder named "newRootFolder", and a root folder with that name exists, the operation fails with a 409 status. If you try to create a subfolder using the ?parentFolderUri parameter, and the parent already has a subfolder with the same name, the operation fails with a 409 status.

Request Samples

1

Response Samples

1{
2 "creationTimeStamp": "2019-08-08T12:55:20.420Z",
3 "modifiedTimeStamp": "2019-08-08T12:55:20.420Z",
4 "createdBy": "testuser",
5 "modifiedBy": "testuser",
6 "id": "f3277e88-01f2-4f2f-9ce2-cb575e849238",
7 "name": "Test Folder 1",
8 "parentFolderUri": "/folders/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450",
9 "type": "folder",
10 "memberCount": 0,
11 "links": [
12 {
13 "method": "GET",
14 "rel": "self",
15 "href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
16 "uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
17 "type": "application/vnd.sas.content.folder"
18 },
19 {
20 "method": "GET",
21 "rel": "up",
22 "href": "/folders/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450",
23 "uri": "/folders/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450",
24 "type": "application/vnd.sas.content.folder"
25 },
26 {
27 "method": "PUT",
28 "rel": "validateRename",
29 "href": "/folders/commons/validations/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450/members/35def691-e932-4bf2-a38a-9f38e906eb5e/name?value={newname}&type=folder",
30 "uri": "/folders/commons/validations/folders/c0e8ccf9-ac43-4303-a1ce-40d7ffbd7450/members/35def691-e932-4bf2-a38a-9f38e906eb5e/name?value={newname}&type=folder"
31 },
32 {
33 "method": "PUT",
34 "rel": "validateNewMemberName",
35 "href": "/folders/commons/validations/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members/@new/name?value={newname}&type={newtype}",
36 "uri": "/folders/commons/validations/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members/@new/name?value={newname}&type={newtype}"
37 },
38 {
39 "method": "GET",
40 "rel": "ancestors",
41 "href": "/folders/ancestors?childUri=/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
42 "uri": "/folders/ancestors?childUri=/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
43 "type": "application/vnd.sas.content.folder.ancestor"
44 },
45 {
46 "method": "PUT",
47 "rel": "update",
48 "href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
49 "uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
50 "type": "application/vnd.sas.content.folder",
51 "responseType": "application/vnd.sas.content.folder"
52 },
53 {
54 "method": "DELETE",
55 "rel": "delete",
56 "href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
57 "uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238"
58 },
59 {
60 "method": "DELETE",
61 "rel": "deleteRecursively",
62 "href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238?recursive=true",
63 "uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238?recursive=true"
64 },
65 {
66 "method": "GET",
67 "rel": "members",
68 "href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members",
69 "uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members",
70 "type": "application/vnd.sas.collection",
71 "itemType": "application/vnd.sas.content.folder.member"
72 },
73 {
74 "method": "POST",
75 "rel": "addMember",
76 "href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members",
77 "uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238/members",
78 "type": "application/vnd.sas.content.folder.member"
79 },
80 {
81 "method": "POST",
82 "rel": "createChild",
83 "href": "/folders/folders?parentFolderUri=/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
84 "uri": "/folders/folders?parentFolderUri=/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
85 "type": "application/vnd.sas.content.folder"
86 },
87 {
88 "method": "GET",
89 "rel": "transferExport",
90 "href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
91 "uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
92 "responseType": "application/vnd.sas.transfer.object"
93 },
94 {
95 "method": "PUT",
96 "rel": "transferImportUpdate",
97 "href": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
98 "uri": "/folders/folders/f3277e88-01f2-4f2f-9ce2-cb575e849238",
99 "type": "application/vnd.sas.transfer.object",
100 "responseType": "application/vnd.sas.summary"
101 },
102 {
103 "method": "POST",
104 "rel": "transferImport",
105 "href": "/folders/folders",
106 "uri": "/folders/folders",
107 "type": "application/vnd.sas.transfer.object",
108 "responseType": "application/vnd.sas.summary"
109 }
110 ],
111 "version": 1
112}

Query Parameters

NameTypeRequiredDescription
parentFolderUri
string<relative URI>
true

URI of folder to add new folder as a child. This parameter is required. An explicit value of "none" indicates that the client wants to create a root folder.

Request Body

Folder

The schema for creating a new folder.

Example:
{"name":"Test Folder 1","description":"A Test Folder","type":"folder"}
NameTypeRequiredDescription
name
string
true

Localizable folder name.

description
string
false

Localizable folder description.

type
string
false

Specialized subtype for this folder. The default value is 'folder'.

Default:
folder
parentFolderUri
string
false

The URI of this folder's parent folder. This is writable by the client. In order to perform a move, PUT this folder with an updated parentFolderUri pointing to the new parent. It is valid for this field to be null, which indicates a root folder.

version
integer
false

This media type's schema version number. This representation is version 1.

Responses

StatusMeaningDescription
201CreatedA folder was created.HeadersSchema
400Bad RequestThe request was invalid. The parentFolderUri is not a valid folder, or does not exist. A malformed request body also returns this status.Schema
404Not FoundNo folder exists at the requested path.Schema