Drop2Run docs
Drop2Run.Api | v1

Site folders

The folders an account sorts its sites into, nested a few levels deep. Folders only organise the dashboard: moving a site changes no address, and deleting a folder lifts what it held up to its parent rather than deleting any site.


Reads the whole of the account's folder tree, with the limits it is bounded by.

GET
https://dropto.run
/api/site-folders
d2r_session (cookie)
or
Bearer

Reads the whole of the account's folder tree, with the limits it is bounded by. › Responses

OK

Response of `GET /site-folders`.
​SiteFolderNode[] · required

Every folder the account holds, by name.

maxDepth
​integer | string · int32 · pattern: ^-?(?:0|[1-9]\d*)$ · required

How deeply folders may nest. Sent for the same reason as MaxFolders: the drag target that would break this rule can be refused before the drop rather than after the request.

maxFolders
​integer | string · int32 · pattern: ^-?(?:0|[1-9]\d*)$ · required

How many folders this account may hold in total.

Sent so the dashboard can grey out "New folder" before somebody names one and is refused. A client that had to discover the limit by hitting it would have to discard what they typed.


Makes a folder, at the top level or inside another.

POST
https://dropto.run
/api/site-folders
d2r_session (cookie)
or
Bearer

Makes a folder, at the top level or inside another. › Request Body

Body of `POST /site-folders`.
name
​null | string

What to call the folder. Cleaned the way a site's name is.

parentId
​null | string

Folder to create it inside. Omit it, or send "root", to create it at the top level — see string SiteFolderAccess.RootToken for why a literal token rather than null.

Makes a folder, at the top level or inside another. › Responses

Created

Response of the endpoints that write a single folder.
​SiteFolderNode · required

The folder as it now stands.


Files several sites and folders into one folder, or to the top level, all or nothing.

POST
https://dropto.run
/api/site-folders/move
d2r_session (cookie)
or
Bearer

Files several sites and folders into one folder, or to the top level, all or nothing. › Request Body

Body of `POST /site-folders/move`.
folderIds
​null | array

Folders to move under it. May be empty when only sites move.

siteIds
​null | array

Sites to file there. May be empty when only folders move.

targetId
​null | string

Where everything goes: a folder id, or "root" for the top level. Required — see string SiteFolderAccess.RootToken for why the root is a token rather than an absent value.

Files several sites and folders into one folder, or to the top level, all or nothing. › Responses

OK

Response of `POST /site-folders/move`.
foldersMoved
​integer | string · int32 · pattern: ^-?(?:0|[1-9]\d*)$ · required

Folders that changed parent, counted the same way.

sitesMoved
​integer | string · int32 · pattern: ^-?(?:0|[1-9]\d*)$ · required

Sites that changed folder. Fewer than were sent when some were already there, which is not an error.

targetId
​null | string · required

The folder everything is now in, or null for the top level.


Renames a folder, moves it under another, or both.

PATCH
https://dropto.run
/api/site-folders/{folderId}
d2r_session (cookie)
or
Bearer

Renames a folder, moves it under another, or both. › path Parameters

folderId
​string · required

Renames a folder, moves it under another, or both. › Request Body

Body of `PATCH /site-folders/{folderId}`.
name
​null | string

A new name, or null to leave it alone.

parentId
​null | string

Where to move it: a folder id, or "root" to move it to the top level. Null leaves it where it is — see string SiteFolderAccess.RootToken for why moving to the root needs a token of its own rather than a null.

Renames a folder, moves it under another, or both. › Responses

OK

Response of the endpoints that write a single folder.
​SiteFolderNode · required

The folder as it now stands.


Removes a folder and lifts its folders and sites up to its parent.

DELETE
https://dropto.run
/api/site-folders/{folderId}
d2r_session (cookie)
or
Bearer

Removes a folder and lifts its folders and sites up to its parent. › path Parameters

folderId
​string · required

Removes a folder and lifts its folders and sites up to its parent. › Responses

OK

Response of `DELETE /site-folders/{folderId}`.
folderId
​string · required

The folder that was removed.

foldersMoved
​integer | string · int32 · pattern: ^-?(?:0|[1-9]\d*)$ · required

How many folders were lifted one level.

movedTo
​null | string · required

Where its contents went: the deleted folder's own parent, or null when they are now at the root.

sitesMoved
​integer | string · int32 · pattern: ^-?(?:0|[1-9]\d*)$ · required

How many sites were lifted one level. Reported so the dashboard can say what happened rather than leaving somebody to find their sites somewhere they did not put them.