cURL
curl --request PATCH \
--url https://sandbox.withclasp.com/enrollment_windows/{public_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25"
}
'import requests
url = "https://sandbox.withclasp.com/enrollment_windows/{public_id}"
payload = {
"start_date": "2023-12-25",
"end_date": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({start_date: '2023-12-25', end_date: '2023-12-25'})
};
fetch('https://sandbox.withclasp.com/enrollment_windows/{public_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.withclasp.com/enrollment_windows/{public_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'start_date' => '2023-12-25',
'end_date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.withclasp.com/enrollment_windows/{public_id}"
payload := strings.NewReader("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://sandbox.withclasp.com/enrollment_windows/{public_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.withclasp.com/enrollment_windows/{public_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"member": "<string>",
"open_enrollment_window": "<string>",
"type": "new_hire",
"event_date": "2023-12-25",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"dates_adjusted_at": "2023-11-07T05:31:56Z"
}Enrollment Windows
Update Enrollment Window
Extends or shortens a window by setting its start_date or end_date.
PATCH
/
enrollment_windows
/
{public_id}
cURL
curl --request PATCH \
--url https://sandbox.withclasp.com/enrollment_windows/{public_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-12-25",
"end_date": "2023-12-25"
}
'import requests
url = "https://sandbox.withclasp.com/enrollment_windows/{public_id}"
payload = {
"start_date": "2023-12-25",
"end_date": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({start_date: '2023-12-25', end_date: '2023-12-25'})
};
fetch('https://sandbox.withclasp.com/enrollment_windows/{public_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.withclasp.com/enrollment_windows/{public_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'start_date' => '2023-12-25',
'end_date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.withclasp.com/enrollment_windows/{public_id}"
payload := strings.NewReader("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://sandbox.withclasp.com/enrollment_windows/{public_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.withclasp.com/enrollment_windows/{public_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"member": "<string>",
"open_enrollment_window": "<string>",
"type": "new_hire",
"event_date": "2023-12-25",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"dates_adjusted_at": "2023-11-07T05:31:56Z"
}Authorizations
API Key authentication with required prefix "Bearer"
Path Parameters
Response
200 - application/json
Member ID, or an expanded member object when using expand[].
Open enrollment window ID, for open_enrollment windows.
new_hire- Opened by the member being hired or rehired.open_enrollment- Opened by the employer's open enrollment.
Available options:
new_hire, open_enrollment The hire date for new_hire windows, or the renewal date for open_enrollment windows.
The first day the member may make elections.
The last day the member may make elections.
When the dates were last edited through the API.