> ## Documentation Index
> Fetch the complete documentation index at: https://syteca.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Folder

> Syteca ACB REST API endpoint to create a new folder for organizing secrets — with name, description, parent, and initial permission grants.

Creates a new folder for organizing secrets. Returns the created folder including its assigned ID.

<Note>
  For ACB deployments updated from a version prior to 1.2, switch to the `https://{hostname}/EkranACB` server in the Playground.
</Note>

### Permissions required

The user owning the Access Token must have **Owner** role on the parent folder (or be allowed to create root-level folders).

### Tips

* **`parent_folder_id` and `parent_folder_name` are mutually exclusive.** Use one or the other to identify the parent.
* **Set permissions at the folder level** when onboarding many secrets — granting an API consumer **Editor** on the folder cascades to every secret it contains.

### Errors

See [Status codes](/docs/api/acb/api-reference#status-codes). Common errors:

* **400 Bad Request** — name missing or invalid permissions structure.
* **403 Forbidden** — user lacks Owner role on the parent folder.
* **409 Conflict** — folder name already exists in the target parent.

## Related

<CardGroup cols={2}>
  <Card title="Get folder" icon="folder-open" href="/docs/api/acb/endpoints/get-folder">Read folder details.</Card>
  <Card title="Update folder" icon="folder-pen" href="/docs/api/acb/endpoints/update-folder">Modify an existing folder.</Card>
  <Card title="Bulk add" icon="layers" href="/docs/api/acb/endpoints/bulk-add">Create folders + secrets in a single call.</Card>
  <Card title="Add secret" icon="plus" href="/docs/api/acb/endpoints/add-secret">Add secrets to this folder.</Card>
</CardGroup>


## OpenAPI

````yaml POST /api/folders
openapi: 3.0.3
info:
  title: Application Credentials Broker API
  description: >-
    API for managing secrets and folders in the Application Credentials Broker
    system
  version: 1.4.0
  contact:
    name: API Support
    email: support@example.com
servers:
  - url: https://your-syteca-host/SytecaACB
    description: On-premises Syteca ACB service (v1.2 or later)
    variables:
      hostname:
        default: your-syteca-host.example.com
        description: Your Syteca Application Server hostname
  - url: https://your-syteca-host/EkranACB
    description: Legacy URL prefix for ACB deployments updated from pre-v1.2
    variables:
      hostname:
        default: your-syteca-host.example.com
        description: Your Syteca Application Server hostname
security:
  - AccessTokenAuth: []
paths:
  /api/folders:
    post:
      tags:
        - Folders
      summary: Add new folder
      description: Creates a new folder with the provided data
      operationId: addFolder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FolderRequestDto'
      responses:
        '201':
          description: Folder created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderResponseDto'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    FolderRequestDto:
      type: object
      properties:
        name:
          type: string
          maxLength: 512
          description: Name of the folder
        description:
          type: string
          maxLength: 2000
          description: Description of the folder
        parent_folder_id:
          type: integer
          format: int32
          minimum: 0
          description: ID of the parent folder
        parent_folder_name:
          type: string
          maxLength: 512
          description: Name of the parent folder
        permissions:
          $ref: '#/components/schemas/Permissions'
      required:
        - name
    FolderResponseDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
          description: Unique identifier of the folder
        name:
          type: string
          description: Name of the folder
        description:
          type: string
          description: Description of the folder
        parent_folder_id:
          type: integer
          format: int32
          description: ID of the parent folder
        permissions:
          $ref: '#/components/schemas/Permissions'
      required:
        - id
        - name
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Error message
      required:
        - status
        - message
    Permissions:
      type: object
      properties:
        inherit_users_and_roles:
          type: boolean
          default: false
          description: Whether to inherit users and roles from parent
        inherit_features:
          type: boolean
          default: false
          description: Whether to inherit features from parent
        users:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
          description: User permissions
        user_groups:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
          description: User group permissions
    Permission:
      type: object
      properties:
        name:
          type: string
          description: User or group name
        access_type:
          $ref: '#/components/schemas/SecretPermissionType'
        features:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalFeature'
          description: Additional features granted
      required:
        - name
        - access_type
    SecretPermissionType:
      type: string
      enum:
        - None
        - PAMUser
        - Owner
        - Viewer
      description: Secret permission type
    AdditionalFeature:
      type: string
      enum:
        - CopyPassword
        - ViewPassword
        - FileTransfer
      description: Additional features for permissions
  securitySchemes:
    AccessTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Access token for authentication

````