Skip to Content

Create a folder

You're viewing API version 2026-09, which is deprecated and stops working on October 1, 2027. To move your integration, see Upgrading to 2026-10.
POST
/api/v1/folders

Create a new folder for documents or templates.

type selects which entity the folder organizes. Pass parentFolderId to nest under an existing folder.

Authorization

headerAuthorizationBearer <token>

Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.

Header Parameters

authorization*string

Bearer token for API authentication

Idempotency-Key?string

Makes retries safe. A retry with the same key and the same request replays the stored response for 24 hours (header Idempotent-Replayed: true); the same key with a different request returns 400.

Lengthlength <= 255

Request Body

Body

application/json
  1. body
name*string

Folder name

Length1 <= length
type*string

Folder type: DOCUMENT or TEMPLATE

Value in"DOCUMENT""TEMPLATE"
parentFolderId?|

Parent folder to nest under. Omit for a top-level folder.

Response Body

200

application/json
  1. response
id*string

Unique folder identifier

name*string

Folder name

type*string

Folder type: DOCUMENT or TEMPLATE

Value in"DOCUMENT""TEMPLATE"
parentFolderId*|

Parent folder id, or null for top-level folders

workspaceId*string
createdById*string
createdAt*unknown
updatedAt*unknown
childFolderCount?integer

Number of direct child folders (non-deleted)

Range-9007199254740991 <= value <= 9007199254740991
itemCount?integer

Number of documents or templates directly in this folder

Range-9007199254740991 <= value <= 9007199254740991
Example Request
curl -X POST 'https://app.sajn.se/api/v1/folders' \  -H 'authorization: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "type": "DOCUMENT"}'
Example Response
{  "id": "string",  "name": "string",  "type": "DOCUMENT",  "parentFolderId": "string",  "workspaceId": "string",  "createdById": "string",  "createdAt": null,  "updatedAt": null,  "childFolderCount": -9007199254740991,  "itemCount": -9007199254740991}

Was this page helpful?