Editing an availability

Overview

The "Editing a availability" API allows users to edit an availability.

Usage

Base URL

https://<workspace>.neetocal.com/api/external/v1

Replace the <workspace> with your workspace's subdomain.

Endpoint

PATCH /availabilities/<availability_id>

Replace the <availability_id> with the desired availability ID. The availability ID can be retrieved by going to the particular availability page, and copying it from the URL.

Request header

This endpoint requires authentication. You must include a valid API key in the request header.

Header

Type

Required

Description

X-Api-Key

String

Yes

Bearer token for API access.

Request body

Key

Type

Required

Description

periods

String

Yes

An array containing the periods. More details given below.

periods: This can be used to set the availability. It should be an a list of objects. Each object should have three keys wday, start_time, and end_time. wday is the week day. It can be a value from sunday to saturday. Note that the value should be in lowercase. start_time and end_time should be in the format "HH:MMAM/PM" eg: "09:00AM". If multiple peroids are needed for the same days, it can be mentioned in separate object. Example given below.

[
  {
    "wday": "monday",
    "start_time": "09:00AM",
    "end_time": "05:00PM"
  },
  {
    "wday": "wednesday",
    "start_time": "09:00AM",
    "end_time": "01:00PM"
  },
  {
    "wday": "wednesday",
    "start_time": "02:00PM",
    "end_time": "07:00PM"
  }
]

Example

For updating an availability for the availability, "Weekly hours", with the id 83d9f25a-7ffe-42aa-9350-dae71a3a5858 of workspace "Spinkart" with subdomain spinkart using curl

curl --request POST \
  --url 'https://spinkart.neetocal.com/api/external/v1/availabilities/83d9f25a-7ffe-42aa-9350-dae71a3a5858' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "periods": [
      {
        "wday": "monday",
        "start_time": "09:00AM",
        "end_time": "05:00PM"
      },
      {
        "wday": "wednesday",
        "start_time": "09:00AM",
        "end_time": "01:00PM"
      },
      {
        "wday": "wednesday",
        "start_time": "02:00PM",
        "end_time": "07:00PM"
      }
    ]
  }'

Response Codes

Code

Description

200

OK - Request succeeded

400

Bad Request - Missing/Invalid parameters

401

Unauthorized - Invalid API key

500

Internal server error

Can't find what you're looking for?