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

# Create File Share

> Share Directories and Files with a Customer or via a public link



## OpenAPI

````yaml /openapi.yaml post /file-shares
openapi: 3.1.1
info:
  title: MijnKlantportaal API
  version: v1
servers:
  - url: https://api.mijnklantportaal.nl/v1
security:
  - APIKey: []
tags:
  - name: Agreements API
  - name: Appointments API
  - name: Customers API
  - name: Customer Groups API
  - name: Customer Invoices API
  - name: Customer Offers API
  - name: Customer Subscriptions API
  - name: Customer Subscription Packages API
  - name: Files API
  - name: File Request API
  - name: File Share API
  - name: Invoices API
  - name: Payment Links API
  - name: Punch Cards API
  - name: Tickets API
  - name: Webhooks API
paths:
  /file-shares:
    post:
      tags:
        - File Share API
      summary: Create File Share
      description: Share Directories and Files with a Customer or via a public link
      operationId: create-file-share
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - content
              properties:
                content:
                  type: array
                  example:
                    - fsd_abc123456789
                    - fsf_abc123456789
                  items:
                    type: string
                  description: >-
                    An array of Directory and/or File IDs which you want to
                    share
                customerId:
                  type: string
                  example: cst_abc123456789
                  description: >-
                    The ID of the Customer you want to share the content with.
                    Omit if you want to use a public link
      responses:
        '201':
          description: Returning the created File Share
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileShare'
        '422':
          description: Something is wrong with the posted data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_ApiError'
components:
  schemas:
    FileShare:
      type: object
      description: File Share
      properties:
        id:
          type: string
          example: fss_abc12345678
          description: ID of the File Share, always starting with `fss_`.
        sharedWithCustomerId:
          type: string
          example: cst_abc12345678
          nullable: true
          description: ID of the customer this File Share is shared with, if any.
        sharedContent:
          type: array
          description: >-
            An array with File and Directory objects which are shared via this
            File Share.
        createdAt:
          type: string
          example: '2024-04-29T21:00:00+02:00'
          description: >-
            Date and time when the File Share was created. Written in ATOM
            format.
        links:
          type: object
          properties:
            customer:
              type: object
              nullable: true
              description: Only available if shared with a Customer
              properties:
                href:
                  type: string
                  description: Endpoint to the Get Customer API
                  example: >-
                    https://api.mijnklantportaal.nl/v1/customers/cst_abc12345def678
                type:
                  type: string
                  description: Type of the content the endpoint will return
            publicShare:
              type: object
              nullable: true
              description: Only available if shared via a public link
              properties:
                href:
                  type: string
                  description: Endpoint to the webpage with the files
                type:
                  type: string
                  description: Type of the content the endpoint will return
    Error_ApiError:
      type: object
      properties:
        message:
          type: string
          description: Explanation what went wrong
  securitySchemes:
    APIKey:
      type: http
      scheme: bearer

````