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

# Bulk Bookings

> This endpoint implements Create, Update and Delete of bulk bookings. It is intended for *one time* import operations, or other use cases that require higher performance at the expense of notification and realtime update features.

<Note>`WRITE` access to the `SCHEDULE` module is required to access this endpoint</Note><Warning>Bookings created, edited or deleted using this endpoint won't trigger **email notifications**, **web-hooks** or **realtime schedule updates**</Warning>




## OpenAPI

````yaml /api-reference/openapi-mintlify.yaml post /v2/booking/bulk
openapi: 3.0.0
info:
  title: Sonderplan API
  description: >
    ## Overview

    You can use our REST API to securely access and modify the data within your
    Sonderplan account. This includes all the information within your bookings,
    projects and invoices that you can use to import / export data or create
    integrations with other systems and software that you use


    ### General Notes


    #### Specifying Fields

    The Sonderplan REST API allows you to specify a comma delimited string of
    exactly which fields are returned, using the `fields` parameter. Using this
    parameter has several advantages including:


    1. In future API versions we may change which fields are presented by
    default, so explicitly specifying the fields required overrides the defaults
    and ensure the fields are served

    2. Limiting fields reduces the processing we need to do and allows us to
    send you the data faster

    3. Some search filters only work if the field you are searching is added to
    the `fields` parameter.


    Example:


    ```

    fields=id,name,start,duration_min

    ```


    ### Applying Filters


    The Query Parameters section in each endpoint shows you special options that
    can be added to your request to customise the response we send you.


    Most endpoints offer the following query params:


    | Query Parameter |
    Description                                                    |

    |-----------------|----------------------------------------------------------------|

    | `fields`        | Only send the specified
    fields                                 |

    | `id`            | Specify one or more ids (comma seperated) of records to
    return |

    | `limit`         | The maximum number of records to
    return                        |

    | `page`          | The page number of records to
    return                           |

    | `order_asc` | Specify which field should be used to sort records
    `ascending` |

    | `order_desc` | Specify which field should be used to sort records
    `descending` |


    In addition to the standard `id` param, you can also specify most other
    fields as a query parameter, useful for performing searching and filtering
    of records.


    For example, you can specify `repeat_master_id=<repeat_booking_id>` to
    return all repeat children of that booking.


    #### Other Query Params


    Refer to the specific API endpoint documentation to see which other query
    params can be used.


    For example, some endpoints allow specifying `updated_after=<UNIX
    TIMESTAMP>` which will only send added, edited and even deleted records that
    were modified after the unix timestamp.


    #### Applying multiple filters


    By default, multiple filters are chained together using **OR** (either
    filter can be true and it will be included). You can change this behaviour
    by specifying `filter_operator=AND`, so each filter must be true to be
    included.


    #### Filtering by Custom Field Values


    For modules that include custom fields, you can search by the value of a
    custom field by adding the `custom_field_<field id>` to the URL query
    parameters. You **must** also specify the custom field in the `fields`
    parameter.


    ```

    GET
    https://api.sonderplan.com/v2/booking?fields=id,name,custom_field_238938&custom_field_238938=Offline

    ```


    This will return custom fields that contain the word 'Offline'.
  contact:
    email: info@sonderplan.com
  version: '2.0'
servers:
  - url: https://api.sonderplan.com
    description: Production Server
security: []
tags:
  - name: Booking
    description: Booking related operations
  - name: Project
    description: Project related operations
  - name: Resource
    description: Resource related operations
  - name: Contact
    description: Contact related operations
  - name: Quote
    description: Quote related operations
  - name: Invoice
    description: Invoice related operations
  - name: Invoice Template
    description: Invoice template related operations
  - name: Billable Item
    description: Billable item related operations
  - name: Rate Scheme
    description: Rate scheme related operations
  - name: Tax
    description: Tax related operations
  - name: Workspace
    description: Workspace (formerly Schedule) related operations
  - name: User
    description: User related operations
  - name: Group
    description: Group related operations
  - name: Status
    description: Status related operations
  - name: Custom Field
    description: Custom field related operations
  - name: Calendar Subscription
    description: Calendar Subscription Import related operations
  - name: Time Entry
    description: Time Entry related operations
  - name: Time Activity
    description: Time Activity related operations
paths:
  /v2/booking/bulk:
    post:
      tags:
        - Booking
      summary: Bulk Bookings
      description: >
        This endpoint implements Create, Update and Delete of bulk bookings. It
        is intended for *one time* import operations, or other use cases that
        require higher performance at the expense of notification and realtime
        update features.


        <Note>`WRITE` access to the `SCHEDULE` module is required to access this
        endpoint</Note><Warning>Bookings created, edited or deleted using this
        endpoint won't trigger **email notifications**, **web-hooks** or
        **realtime schedule updates**</Warning>
      operationId: c6da57cb1614e12e530a7d493ade4821
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingBulkEdit'
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                properties:
                  save:
                    properties:
                      success:
                        description: True if the save operation was successful
                        type: array
                        items:
                          properties:
                            id:
                              type: integer
                              example: 2340
                            external_id:
                              type: string
                              example: 1234j@kf9i094-090-9435aasdas
                          type: object
                    type: object
                  delete:
                    properties:
                      id:
                        properties:
                          success:
                            type: boolean
                        type: object
                      external_id:
                        properties:
                          success:
                            type: boolean
                        type: object
                      calendar_subscription_id:
                        properties:
                          success:
                            type: boolean
                        type: object
                    type: object
                type: object
        '400':
          description: Request failed validation
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: The HTTP error code
                        type: integer
                        example: 400
                      message:
                        description: More detail about why the request failed validation
                        type: integer
                        example: name is required... Name of the tax
                    type: object
                type: object
        '401':
          description: Authorization information is missing or invalid
      security:
        - bearer: []
components:
  schemas:
    BookingBulkEdit:
      title: Booking Bulk Edit Model
      description: Allows bulk creation, modification and deletion of bookings
      properties:
        save:
          description: >-
            Create new or update existing bookings (be sure to include an
            `external_id` column so we know which bookings to update
          properties:
            common_properties:
              description: Define the parameters common across all bookings being saved
              type: array
              items:
                properties:
                  calendar_subscription_id:
                    description: ID of calendar subscription to attach to each booking
                    type: integer
                    example: 234982
                  resources:
                    type: array
                    items:
                      properties:
                        id:
                          description: ID of the resource to attach to each booking
                          type: integer
                          example: 34982
                      type: object
                  project:
                    type: array
                    items:
                      properties:
                        id:
                          description: ID of the project to attach to each booking
                          type: integer
                          example: 239909
                      type: object
                  status:
                    type: array
                    items:
                      properties:
                        id:
                          description: ID of the status to attach to each booking
                          type: integer
                          example: 40123
                      type: object
                  client:
                    type: array
                    items:
                      properties:
                        uuid:
                          description: UUID of the contact to attach to each booking
                          type: string
                          example: p209809
                      type: object
                type: object
            columns:
              description: >-
                Define the columns that we are inserting. The order of these
                must be the order must match the `values` array.
              type: array
              items:
                enum:
                  - external_id
                  - start
                  - end
                  - name
                  - notes
              example:
                - external_id
                - start
                - end
                - name
                - notes
            values:
              description: An array of values in the order defined in `columns` array.
              type: array
              items:
                example:
                  - 1234j@kf9i094-090-9435aasdas
                  - 1685691600
                  - 1685695200
                  - Test Booking
                  - Booking Notes
          type: object
        delete:
          description: >-
            Delete existing bookings by either `id`, `external_id` or
            `calendar_subscription_id`
          properties:
            id:
              type: array
              items:
                type: integer
                example: 98923
              example:
                - 98923
                - 19812
                - 23838
            external_id:
              type: array
              items:
                type: string
                example: 1234j@kf9i094-090-9435aasdas
              example:
                - 1234j@kf9i094-090-9435aasdas
            calendar_subscription_id:
              type: array
              items:
                type: integer
                example: 989232349
              example:
                - 989232349
          type: object
      type: object
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````