Folderit v2-compatible API
REST v2Read & write
Integration API for copiers, ERPs and external workflows: folders, files, versions, uploads, sharing, search, folder mail-in and audit, with paths compatible with Folderit v2. It acts for the whole account with the permissions chosen for the key (not as one person), so give keys only to trusted systems.
Base URL: https://cwdrive.com/v2
Keys: Herramientas administrativas → API pública (owners and administrators).
For AI assistants and per-person access, use the agent API (v1) instead: it acts as one member and respects their folder permissions.
Authentication
Send the key as a bearer token. Keys start with cwapi_, are shown once when created, and can expire or be revoked at any time.
Authorization: Bearer cwapi_…
| Scope | Allows |
|---|---|
browse | Read accounts, folders, files, versions, search, downloads |
upload | Uploads and new versions |
edit | Create, rename, move and annotate; section order; folder mail-in |
delete | Move to the recycle bin |
share | Create, list and revoke shares |
audit | Read audit logs |
Conventions
- Account path: every path after
/accountsstarts with/accounts/{accountUid}(shown on the API page); a key only reaches its own account. - Pagination:
?page=and?page-size=(max 500). Responses carryX-Pagination-Total-Count,X-Pagination-Page-Count,X-Pagination-Current-Page,X-Pagination-Per-Pageand aLinkheader (first, prev, self, next, last). - X-Folderit-Request-Key: send a unique value with every change; it is recorded in the audit log with the operation so a retry can be traced.
- Errors:
401invalid key,403missing scope,404not found (or another account's item),409conflict (for example a file checked out by someone else),400invalid request, with a JSON error message. - Audit: every change is logged with the key as actor (
api:<keyId>).
Account
GET /v2/accounts
Accounts this key belongs to scope: browse
Returns
Array with the key's account.
Example
curl "https://cwdrive.com/v2/accounts" \ -H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}
Account details scope: browse
Returns
Account.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/section-order
Order of the top-level sections scope: browse
Returns
Array of section uids.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/section-order" \
-H "Authorization: Bearer cwapi_…"
PUT /v2/accounts/{accountUid}/section-order
Reorder the top-level sections scope: edit
Body (JSON)
| Name | Type | Description |
|---|---|---|
(body) required | string[] | Section uids in the new order. |
Returns
The order saved.
Example
curl -X PUT "https://cwdrive.com/v2/accounts/{accountUid}/section-order" \
-H "Authorization: Bearer cwapi_…" \
-H "X-Folderit-Request-Key: <unique-id>" \
-H "Content-Type: application/json" \
-d '["<sectionUid>","<sectionUid>"]'
Entities (folders and files together)
GET /v2/accounts/{accountUid}/entities
Top-level entities scope: browse
Query
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Entities (folders and files).
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/entities" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/entities/all
Every entity, optionally under one folder scope: browse
Query
| Name | Type | Description |
|---|---|---|
parentUid | string | Only entities under this folder. |
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Entities.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/entities/all" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/entities/{uid}
One entity scope: browse
Returns
Entity.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/entities/{uid}" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/entities/{uid}/entities
Children of a folder scope: browse
Query
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Entities.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/entities/{uid}/entities" \
-H "Authorization: Bearer cwapi_…"
PUT /v2/accounts/{accountUid}/entities/{uid}
Rename, move or annotate an entity scope: edit
Body (JSON)
| Name | Type | Description |
|---|---|---|
name | string | New name. |
parentUid | string | Destination folder (files require one). |
extra.note | string | Note (up to 5,000 characters). |
extra.date / extra.dueDate | string | Document and due dates (files). |
Returns
Updated entity.
Example
curl -X PUT "https://cwdrive.com/v2/accounts/{accountUid}/entities/{uid}" \
-H "Authorization: Bearer cwapi_…" \
-H "X-Folderit-Request-Key: <unique-id>" \
-H "Content-Type: application/json" \
-d '{"name":"Nuevo nombre"}'
DELETE /v2/accounts/{accountUid}/entities/{uid}
Move an entity to the recycle bin scope: delete
Returns
The entity, marked deleted (folders with their contents).
Example
curl -X DELETE "https://cwdrive.com/v2/accounts/{accountUid}/entities/{uid}" \
-H "Authorization: Bearer cwapi_…"
Folders
GET /v2/accounts/{accountUid}/folders
Top-level folders (sections) scope: browse
Returns
Folders.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/folders" \
-H "Authorization: Bearer cwapi_…"
POST /v2/accounts/{accountUid}/folders
Create a folder scope: edit
Body (JSON)
| Name | Type | Description |
|---|---|---|
name required | string | Folder name. |
parentUid | string | Parent folder; omit for a new section. |
returnDuplicateFolder | boolean | Return the existing folder instead of failing when the name is taken. |
Returns
Folder.
Example
curl -X POST "https://cwdrive.com/v2/accounts/{accountUid}/folders" \
-H "Authorization: Bearer cwapi_…" \
-H "X-Folderit-Request-Key: <unique-id>" \
-H "Content-Type: application/json" \
-d '{"name":"Facturas 2026","parentUid":"<folderUid>"}'
GET /v2/accounts/{accountUid}/folders/{uid}
One folder scope: browse
Returns
Folder, including its mail-in address when active.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/folders/{uid}" \
-H "Authorization: Bearer cwapi_…"
PUT /v2/accounts/{accountUid}/folders/{uid}
Rename, move or reorder a folder scope: edit
Body (JSON)
| Name | Type | Description |
|---|---|---|
name | string | New name. |
parentUid | string | New parent folder. |
extra.note | string | Note. |
sectionOrder | integer | Position among sections. |
Returns
Folder.
Example
curl -X PUT "https://cwdrive.com/v2/accounts/{accountUid}/folders/{uid}" \
-H "Authorization: Bearer cwapi_…" \
-H "X-Folderit-Request-Key: <unique-id>" \
-H "Content-Type: application/json" \
-d '{"name":"Nuevo nombre"}'
DELETE /v2/accounts/{accountUid}/folders/{uid}
Move a folder and its contents to the recycle bin scope: delete
Returns
Folder, marked deleted.
Example
curl -X DELETE "https://cwdrive.com/v2/accounts/{accountUid}/folders/{uid}" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/folders/{uid}/folders
Subfolders scope: browse
Query
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Folders.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/folders/{uid}/folders" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/folders/{uid}/files
Files in a folder scope: browse
Query
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Files.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/folders/{uid}/files" \
-H "Authorization: Bearer cwapi_…"
POST /v2/accounts/{accountUid}/folders/{uid}/email
Activate, reset or deactivate the folder's mail-in address scope: edit
Body (JSON)
| Name | Type | Description |
|---|---|---|
action | "activate" | "reset" | "deactivate" | Default activate. reset issues a new address. |
Returns
{active, address}.
Example
curl -X POST "https://cwdrive.com/v2/accounts/{accountUid}/folders/{uid}/email" \
-H "Authorization: Bearer cwapi_…" \
-H "X-Folderit-Request-Key: <unique-id>" \
-H "Content-Type: application/json" \
-d '{"action":"activate"}'
DELETE /v2/accounts/{accountUid}/folders/{uid}/email
Deactivate the mail-in address scope: edit
Returns
{active:false, address:null}.
Example
curl -X DELETE "https://cwdrive.com/v2/accounts/{accountUid}/folders/{uid}/email" \
-H "Authorization: Bearer cwapi_…"
Files and versions
GET /v2/accounts/{accountUid}/files/{uid}
One file scope: browse
Returns
File.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/files/{uid}" \
-H "Authorization: Bearer cwapi_…"
PUT /v2/accounts/{accountUid}/files/{uid}
Rename, move or annotate a file scope: edit
Body (JSON)
| Name | Type | Description |
|---|---|---|
name | string | New name. |
parentUid | string | Destination folder. |
extra.note / extra.date / extra.dueDate | string | Note and dates. |
Returns
File.
Example
curl -X PUT "https://cwdrive.com/v2/accounts/{accountUid}/files/{uid}" \
-H "Authorization: Bearer cwapi_…" \
-H "X-Folderit-Request-Key: <unique-id>" \
-H "Content-Type: application/json" \
-d '{"name":"Nuevo nombre"}'
DELETE /v2/accounts/{accountUid}/files/{uid}
Move a file to the recycle bin scope: delete
Returns
File, marked deleted.
Example
curl -X DELETE "https://cwdrive.com/v2/accounts/{accountUid}/files/{uid}" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/files/{uid}/download
Download the current version scope: browse
Returns
File bytes.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/files/{uid}/download" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/files/{uid}/preview
Preview the current version scope: browse
Returns
File bytes (inline).
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/files/{uid}/preview" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/files/{uid}/versions
Versions of a file scope: browse
Query
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Versions.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/files/{uid}/versions" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/files/{uid}/versions/{versionUid}/download
Download one version scope: browse
Returns
File bytes.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/files/{uid}/versions/{versionUid}/download" \
-H "Authorization: Bearer cwapi_…"
Uploads
POST /v2/accounts/{accountUid}/files/upload
Start, follow, finish or abort an upload scope: upload
Uploads go in parts. 1) action:"create" with fileName, fileSize (up to 20 MB), contentType and folderUid (new file) or fileUid (new version); optional parts {"1":{},"2":{}} returns signed part URLs. 2) PUT each part to its URL. 3) action:"complete" with uploadId, key and fileSize. Also action:"part" (URL for one part), "parts" (parts received) and "abort". Uploads expire after 48 hours.
Body (JSON)
| Name | Type | Description |
|---|---|---|
action required | "create" | "part" | "parts" | "complete" | "abort" | Step. |
fileName / fileSize / contentType | string / integer / string | For create; fileSize again for complete. |
folderUid | fileUid | string | Destination folder, or the file to add a version to. |
uploadId / key | string | From create; required for the other actions. |
partNumber | integer | For action part (1–10,000). |
Returns
create: {uploadId, key, urls?}; complete: the file.
Example
curl -X POST "https://cwdrive.com/v2/accounts/{accountUid}/files/upload" \
-H "Authorization: Bearer cwapi_…" \
-H "X-Folderit-Request-Key: <unique-id>" \
-H "Content-Type: application/json" \
-d '{"action":"create","folderUid":"<folderUid>","fileName":"factura.pdf","fileSize":123456,"contentType":"application/pdf"}'
PUT /v2/uploads/{uploadId}/parts/{partNumber}?key={key}
Send one part scope: upload
Body (JSON)
| Name | Type | Description |
|---|---|---|
(body) required | bytes | The part's raw bytes. |
Returns
ETag header.
Example
curl -X PUT "https://cwdrive.com/v2/uploads/{uploadId}/parts/{partNumber}?key={key}" \
-H "Authorization: Bearer cwapi_…" \
-H "X-Folderit-Request-Key: <unique-id>"
Sharing
Search and audit
GET /v2/accounts/{accountUid}/search
Search folders and files by name and notes scope: browse
Query
| Name | Type | Description |
|---|---|---|
query required | string | Text to look for (also accepted as q). |
Returns
Matching folders and files.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/search" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/search/files
Search files only scope: browse
Query
| Name | Type | Description |
|---|---|---|
query required | string | Text to look for. |
Returns
Matching files.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/search/files" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/audit
Account audit log scope: audit
Query
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Audit events.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/audit" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/folders/{uid}/audit
Audit log of a folder scope: audit
Query
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Audit events.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/folders/{uid}/audit" \
-H "Authorization: Bearer cwapi_…"
GET /v2/accounts/{accountUid}/files/{uid}/audit
Audit log of a file scope: audit
Query
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default 1). |
page-size | integer | Items per page (default 100, max 500). |
Returns
Audit events.
Example
curl "https://cwdrive.com/v2/accounts/{accountUid}/files/{uid}/audit" \
-H "Authorization: Bearer cwapi_…"
This reference mirrors the server's /v2 routes.