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

# Update folder

> Update a folder's name.

Errors:
    400 invalid_request: No fields were given to update.
    401 authentication_required: API key or token is missing, invalid, or revoked.
    403 permission_denied: Your plan does not include API access, or this folder is not in your org.
    404 resource_not_found: No folder with that ID exists.
    429 rate_limit_exceeded: You sent too many requests this minute.



## OpenAPI

````yaml public-openapi.json patch /api/businesses/{business_id}/folders/{folder_id}
openapi: 3.1.0
info:
  title: Marky Public API
  version: '2026-04-08'
  description: Create and schedule posts, manage businesses, library, media, and webhooks.
servers:
  - url: https://api.mymarky.ai
    description: Production
security: []
paths:
  /api/businesses/{business_id}/folders/{folder_id}:
    patch:
      tags:
        - public-api
      summary: Update folder
      description: |-
        Update a folder's name.

        Errors:
            400 invalid_request: No fields were given to update.
            401 authentication_required: API key or token is missing, invalid, or revoked.
            403 permission_denied: Your plan does not include API access, or this folder is not in your org.
            404 resource_not_found: No folder with that ID exists.
            429 rate_limit_exceeded: You sent too many requests this minute.
      operationId: update_folder
      parameters:
        - name: business_id
          in: path
          required: true
          schema:
            type: string
            description: A UUID identifier.
            title: Business Id
          description: A UUID identifier.
        - name: folder_id
          in: path
          required: true
          schema:
            type: string
            description: A UUID identifier.
            title: Folder Id
          description: A UUID identifier.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FolderUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderResponse'
        '400':
          description: Error (Stripe-style envelope — match on error.code, not the message)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Error (Stripe-style envelope — match on error.code, not the message)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Error (Stripe-style envelope — match on error.code, not the message)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Error (Stripe-style envelope — match on error.code, not the message)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '409':
          description: Error (Stripe-style envelope — match on error.code, not the message)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Error (Stripe-style envelope — match on error.code, not the message)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Error (Stripe-style envelope — match on error.code, not the message)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - HTTPBearer: []
components:
  schemas:
    FolderUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: New folder name
      additionalProperties: false
      type: object
      title: FolderUpdateRequest
    FolderResponse:
      properties:
        id:
          type: string
          title: Id
          description: Folder ID
        business_id:
          type: string
          title: Business Id
          description: Business this folder belongs to
        name:
          type: string
          title: Name
          description: Folder name
        path:
          type: string
          title: Path
          description: Full folder path
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
          description: Parent folder ID
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the folder was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: Last update time
      type: object
      required:
        - id
        - business_id
        - name
        - path
        - created_at
      title: FolderResponse
    ErrorEnvelope:
      description: >-
        The body of every non-2xx response.


        `detail` is retained on internal routes for backward-compatibility while
        the

        frontend migrates to reading `error.code`.
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      title: ErrorEnvelope
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorDetail:
      properties:
        type:
          type: string
          title: Type
          description: >-
            Broad error category derived from the HTTP status
            (invalid_request_error, authentication_error, permission_error,
            not_found_error, rate_limit_error, api_error).
        code:
          $ref: '#/components/schemas/ErrorCode'
          description: >-
            Stable, machine-readable error code. Match on THIS, never on the
            message. Codes never change even when the message is reworded.
        message:
          type: string
          title: Message
          description: Human-readable explanation. For display/logging only — do not parse.
        doc_url:
          type: string
          title: Doc Url
          description: Link to the docs entry for this error code.
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: The offending request field, when the error is field-specific.
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: >-
            The id of this request (also returned as the X-Request-Id header).
            Quote it to support so they can find the exact request in our logs.
      type: object
      required:
        - type
        - code
        - message
        - doc_url
      title: ErrorDetail
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ErrorCode:
      type: string
      enum:
        - authentication_required
        - permission_denied
        - resource_not_found
        - rate_limit_exceeded
        - validation_error
        - internal_error
        - already_exists
        - invalid_request
        - WORKSPACE_NOT_SUPPORTED
        - INSUFFICIENT_CREDITS
        - BUSINESS_CREDIT_LIMIT_EXCEEDED
        - NO_ENABLED_TOPICS
        - GENERATION_CAP_REACHED
        - CHECKOUT_BLOCKED
        - INVALID_API_KEY
        - SOCIAL_TOKEN_EXPIRED
        - PAYMENT_REQUIRED
        - NO_CONNECTED_SOCIALS
        - NOT_ENOUGH_POSTS_FOR_TOPICS
        - WORKSPACE_LIMIT_EXCEEDED
        - PHONE_NOT_VERIFIED
        - FILE_TOO_LARGE
        - SUBSCRIPTION_ALREADY_ACTIVE
        - UPSTREAM_PROVIDER_ERROR
        - PLATFORM_MEDIA_UNSUPPORTED
        - SOCIAL_CONNECT_FAILED
        - NO_PHOTO_SOURCE
        - TEMPLATE_FORMAT_MISMATCH
        - INVALID_CSV_ROW
        - IMAGE_GENERATION_FAILED
        - POST_RENDER_FAILED
        - POST_DESIGN_SELECTION_FAILED
        - POST_CONTENT_GENERATION_FAILED
        - POST_IDEATION_FAILED
        - IDEMPOTENCY_KEY_CONFLICT
      title: ErrorCode
      description: >-
        The full set of stable `error.code` values the API can return.


        Two groups: (1) GENERIC codes the global handler derives from the HTTP
        status

        or message keyword for plain raises (see api_errors._error_code + the
        handlers),

        and (2) the typed BUSINESS codes (mirror of ErrorType) for raises the
        frontend

        must tell apart from other same-status errors.


        This enum exists so OpenAPI emits an `enum` for error.code — a canonical
        list in

        the docs and a typed union for codegen — instead of a bare string. It
        does NOT

        validate runtime responses (those are plain dicts built in
        _build_error_response),

        so a code missing here only means incomplete docs, never a 500. The

        test_error_code_enum_covers_* tests keep it in sync with ErrorType +
        _error_code

        so it can't silently drift.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````