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

# Create a folder

> Create a workspace folder and configure its public short URL.

`POST /v1/folder` requires **Folders: Write** (`link_groups.create`). The API key determines the workspace.

```bash theme={null}
curl -X POST https://biq.li/api/v1/folder \
  -H 'Authorization: Bearer biqli_your_workspace_api_key' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Summer campaign","alias":"summer"}'
```

`name` is required. Optional fields are `description`, `alias`, `domain_id`, `active`, `rotator`, `password`, `activates_at`, `expires_at`, `utm`, `allow_search_engine_indexing`, `geo_rules`, `device_rules`, `platform_rules`, `exp_clicks_rule`, `tag_ids`, and `pixel_ids`. Resource references use `biq_dom_`, `biq_tag_`, and `biq_pxl_` public IDs from this workspace. Alias rules and workspace plan restrictions also apply.

Using `domain_id`, `tag_ids`, or `pixel_ids` additionally requires `custom_domains.view`, `tags.view`, or `tracking_pixels.view`, respectively.

The response is `201 Created` with `{ "folder": { ... }, "status": "success" }`. The folder has a `biq_fld_...` ID and includes its short URL, configuration, public attachment IDs, link/click counts, and timestamps. Passwords are never returned; `has_password` reports whether one is configured.

Duplicate names return `409 folder_name_taken`; an occupied alias returns `409 alias_taken`. Unknown fields return `422 validation_error`.

## Shared API behavior

Authentication is workspace-scoped; see [Authentication](/docs/api-reference/authentication). Errors use the standard envelope and request IDs described in [Errors](/docs/api-reference/errors), and requests are subject to [Rate limits](/docs/api-reference/rate-limits).


## OpenAPI

````yaml POST /v1/folder
openapi: 3.1.0
info:
  title: Biqli API
  version: 1.0.0
  description: Workspace-scoped REST API for Biqli.
servers:
  - url: https://biq.li/api
security:
  - bearerAuth: []
paths:
  /v1/folder:
    post:
      tags:
        - Folders
      summary: Create a folder
      description: Creates a folder in the API key workspace. Requires link_groups.create.
      operationId: folder.store
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FolderWrite'
      responses:
        '201':
          description: Folder created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    FolderWrite:
      allOf:
        - $ref: '#/components/schemas/FolderFields'
        - type: object
          required:
            - name
    FolderResponse:
      type: object
      required:
        - folder
        - status
      properties:
        folder:
          $ref: '#/components/schemas/Folder'
        status:
          type: string
          const: success
    FolderFields:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 3
          maxLength: 250
        description:
          type:
            - string
            - 'null'
          maxLength: 250
        alias:
          type:
            - string
            - 'null'
        domain_id:
          type:
            - string
            - 'null'
          pattern: ^biq_dom_[0-9A-HJKMNP-TV-Z]{26}$
        active:
          type: boolean
        rotator:
          type: boolean
        password:
          type:
            - string
            - 'null'
          maxLength: 250
        activates_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        utm:
          type:
            - string
            - 'null'
          maxLength: 2000
        allow_search_engine_indexing:
          type: boolean
        geo_rules:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/PublicRule'
        device_rules:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/PublicRule'
        platform_rules:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/PublicRule'
        exp_clicks_rule:
          oneOf:
            - type: 'null'
            - type: object
              additionalProperties: false
              required:
                - key
              properties:
                key:
                  type: integer
                  minimum: 1
                value:
                  type:
                    - string
                    - 'null'
                  maxLength: 1000
        tag_ids:
          $ref: '#/components/schemas/PublicIdList'
        pixel_ids:
          $ref: '#/components/schemas/PublicIdList'
    Folder:
      type: object
      required:
        - id
        - name
        - short_url
        - alias
        - active
        - rotator
        - has_password
        - geo_rules
        - device_rules
        - platform_rules
        - tag_ids
        - pixel_ids
        - links_count
        - clicks_count
      properties:
        id:
          type: string
          pattern: ^biq_fld_[0-9A-HJKMNP-TV-Z]{26}$
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        short_url:
          type: string
          format: uri
        alias:
          type: string
        domain_id:
          type:
            - string
            - 'null'
        active:
          type: boolean
        rotator:
          type: boolean
        has_password:
          type: boolean
        activates_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        utm:
          type:
            - string
            - 'null'
        allow_search_engine_indexing:
          type: boolean
        geo_rules:
          type: array
          items:
            $ref: '#/components/schemas/PublicRule'
        device_rules:
          type: array
          items:
            $ref: '#/components/schemas/PublicRule'
        platform_rules:
          type: array
          items:
            $ref: '#/components/schemas/PublicRule'
        exp_clicks_rule:
          type:
            - object
            - 'null'
        tag_ids:
          $ref: '#/components/schemas/PublicIdList'
        pixel_ids:
          $ref: '#/components/schemas/PublicIdList'
        links_count:
          type: integer
          minimum: 0
        clicks_count:
          type: integer
          minimum: 0
        clicked_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
    ApiError:
      type: object
      required:
        - error
        - request_id
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - invalid_token
                - insufficient_scope
                - upgrade_required
                - quota_exceeded
                - resource_not_found
                - domain_taken
                - alias_taken
                - external_id_taken
                - folder_name_taken
                - tag_name_taken
                - pixel_name_taken
                - biolink_name_taken
                - method_not_allowed
                - url_blocked
                - dns_verification_failed
                - validation_error
                - rate_limit_exceeded
                - internal_server_error
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        request_id:
          type: string
          description: Request identifier to include when contacting support.
    PublicRule:
      type: object
      additionalProperties: false
      required:
        - key
        - value
      properties:
        key:
          type: string
          maxLength: 250
        value:
          type: string
          maxLength: 1000
    PublicIdList:
      type: array
      maxItems: 100
      uniqueItems: true
      items:
        type: string
  responses:
    Unauthorized:
      $ref: '#/components/responses/ApiErrorResponse'
      description: The workspace API key is missing, invalid, or revoked.
    Forbidden:
      $ref: '#/components/responses/ApiErrorResponse'
      description: >-
        The key lacks a required scope, the workspace must upgrade, or its quota
        is exhausted.
    Conflict:
      $ref: '#/components/responses/ApiErrorResponse'
      description: >-
        A unique alias, external ID, custom domain, or workspace resource name
        is already in use.
    UnprocessableEntity:
      $ref: '#/components/responses/ApiErrorResponse'
      description: >-
        The payload is invalid, a destination was blocked, or domain DNS
        verification is not ready.
    RateLimited:
      description: The workspace exceeded its plan's API rate limit.
      headers:
        RateLimit-Policy:
          description: Current IETF HTTPAPI quota policy as a structured field.
          schema:
            type: string
            example: '"workspace-api";q=1000;w=60'
        RateLimit:
          description: Current IETF HTTPAPI service limit as a structured field.
          schema:
            type: string
            example: '"workspace-api";r=0;t=17'
        Retry-After:
          description: Seconds to wait before retrying the request.
          schema:
            type: integer
            minimum: 0
            example: 17
        X-RateLimit-Limit:
          description: Legacy maximum request count for the current window.
          schema:
            type: integer
            minimum: 1
            example: 1000
        X-RateLimit-Remaining:
          description: Legacy remaining request count.
          schema:
            type: integer
            minimum: 0
            example: 0
        X-RateLimit-Reset:
          description: Legacy reset time as a UTC Unix timestamp.
          schema:
            type: integer
            format: int64
            example: 1788126519
        X-Biq-Request-Id:
          description: Request identifier for support and tracing.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    InternalError:
      $ref: '#/components/responses/ApiErrorResponse'
      description: The request failed unexpectedly.
    ApiErrorResponse:
      description: API error.
      headers:
        X-Biq-Request-Id:
          description: Request identifier for support and tracing.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Workspace API key
      description: A workspace API key beginning with biqli_.

````