Skip to main content
POST
/
members
cURL
curl --request POST \
  --url https://sandbox.withclasp.com/members \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "first_name": "<string>",
  "last_name": "<string>",
  "dob": "2023-12-25",
  "employer": "<string>",
  "address": {
    "line1": "<string>",
    "city": "<string>",
    "zip_code": "<string>",
    "line2": "<string>"
  },
  "hire_date": "2023-12-25",
  "middle_name": "<string>",
  "ssn": "<string>",
  "email": "jsmith@example.com",
  "phone_number": "<string>",
  "termination_date": "2023-12-25",
  "payroll_provider_external_id": "<string>",
  "hours_worked": "<string>",
  "subclasses": [
    "<string>"
  ],
  "business_unit": "<string>",
  "job_title": "<string>",
  "is_union": true,
  "is_seasonal": true,
  "metadata": {}
}
'
import requests

url = "https://sandbox.withclasp.com/members"

payload = {
"first_name": "<string>",
"last_name": "<string>",
"dob": "2023-12-25",
"employer": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"zip_code": "<string>",
"line2": "<string>"
},
"hire_date": "2023-12-25",
"middle_name": "<string>",
"ssn": "<string>",
"email": "jsmith@example.com",
"phone_number": "<string>",
"termination_date": "2023-12-25",
"payroll_provider_external_id": "<string>",
"hours_worked": "<string>",
"subclasses": ["<string>"],
"business_unit": "<string>",
"job_title": "<string>",
"is_union": True,
"is_seasonal": True,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: '<string>',
last_name: '<string>',
dob: '2023-12-25',
employer: '<string>',
address: {line1: '<string>', city: '<string>', zip_code: '<string>', line2: '<string>'},
hire_date: '2023-12-25',
middle_name: '<string>',
ssn: '<string>',
email: 'jsmith@example.com',
phone_number: '<string>',
termination_date: '2023-12-25',
payroll_provider_external_id: '<string>',
hours_worked: '<string>',
subclasses: ['<string>'],
business_unit: '<string>',
job_title: '<string>',
is_union: true,
is_seasonal: true,
metadata: {}
})
};

fetch('https://sandbox.withclasp.com/members', 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/members",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => '<string>',
'last_name' => '<string>',
'dob' => '2023-12-25',
'employer' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'zip_code' => '<string>',
'line2' => '<string>'
],
'hire_date' => '2023-12-25',
'middle_name' => '<string>',
'ssn' => '<string>',
'email' => 'jsmith@example.com',
'phone_number' => '<string>',
'termination_date' => '2023-12-25',
'payroll_provider_external_id' => '<string>',
'hours_worked' => '<string>',
'subclasses' => [
'<string>'
],
'business_unit' => '<string>',
'job_title' => '<string>',
'is_union' => true,
'is_seasonal' => true,
'metadata' => [

]
]),
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/members"

payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"employer\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"hire_date\": \"2023-12-25\",\n \"middle_name\": \"<string>\",\n \"ssn\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone_number\": \"<string>\",\n \"termination_date\": \"2023-12-25\",\n \"payroll_provider_external_id\": \"<string>\",\n \"hours_worked\": \"<string>\",\n \"subclasses\": [\n \"<string>\"\n ],\n \"business_unit\": \"<string>\",\n \"job_title\": \"<string>\",\n \"is_union\": true,\n \"is_seasonal\": true,\n \"metadata\": {}\n}")

req, _ := http.NewRequest("POST", 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.post("https://sandbox.withclasp.com/members")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"employer\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"hire_date\": \"2023-12-25\",\n \"middle_name\": \"<string>\",\n \"ssn\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone_number\": \"<string>\",\n \"termination_date\": \"2023-12-25\",\n \"payroll_provider_external_id\": \"<string>\",\n \"hours_worked\": \"<string>\",\n \"subclasses\": [\n \"<string>\"\n ],\n \"business_unit\": \"<string>\",\n \"job_title\": \"<string>\",\n \"is_union\": true,\n \"is_seasonal\": true,\n \"metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.withclasp.com/members")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"employer\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"zip_code\": \"<string>\",\n \"line2\": \"<string>\"\n },\n \"hire_date\": \"2023-12-25\",\n \"middle_name\": \"<string>\",\n \"ssn\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone_number\": \"<string>\",\n \"termination_date\": \"2023-12-25\",\n \"payroll_provider_external_id\": \"<string>\",\n \"hours_worked\": \"<string>\",\n \"subclasses\": [\n \"<string>\"\n ],\n \"business_unit\": \"<string>\",\n \"job_title\": \"<string>\",\n \"is_union\": true,\n \"is_seasonal\": true,\n \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "first_name": "<string>",
  "last_name": "<string>",
  "dob": "2023-12-25",
  "employer": "<string>",
  "address": {
    "line1": "<string>",
    "city": "<string>",
    "zip_code": "<string>",
    "line2": "<string>"
  },
  "hire_date": "2023-12-25",
  "middle_name": "<string>",
  "ssn_last_four": "<string>",
  "email": "jsmith@example.com",
  "phone_number": "<string>",
  "enrollments": [
    "<string>"
  ],
  "termination_date": "2023-12-25",
  "payroll_provider_external_id": "<string>",
  "hours_worked": "<string>",
  "subclasses": [
    "<string>"
  ],
  "business_unit": "<string>",
  "job_title": "<string>",
  "is_union": true,
  "is_seasonal": true,
  "metadata": {}
}

Authorizations

Authorization
string
header
required

API Key authentication with required prefix "Bearer"

Body

first_name
string
required
Maximum string length: 255
last_name
string
required
Maximum string length: 255
dob
string<date>
required
employer
string
required
address
object
required
hire_date
string<date>
required
middle_name
string | null
Maximum string length: 255
ssn
string
write-only
Pattern: \d{9}
email
string<email> | null
Maximum string length: 254
phone_number
string | null
Maximum string length: 10
termination_date
string<date> | null
payroll_provider_external_id
string | null
Maximum string length: 255
biological_sex
  • male - Male
  • female - Female
Available options:
male,
female
hours_worked
string<decimal>
Pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
pay_frequency
enum<string>
  • weekly - Weekly
  • biweekly - Biweekly
  • semimonthly - Semimonthly
  • monthly - Monthly
Available options:
weekly,
biweekly,
semimonthly,
monthly
employment_status
enum<string>
  • full_time - Full Time
  • part_time - Part Time
  • variable_hours - Variable Hours
Available options:
full_time,
part_time,
variable_hours
subclasses
string[]
business_unit
string | null
job_title
string | null
Maximum string length: 255
is_union
boolean | null

Whether the employee is a union member

is_seasonal
boolean | null

Whether the employee is seasonal

metadata
object

Up to 50 key-value pairs. Keys max 40 characters, values max 500 characters. Set a value to empty string to remove a key. On PATCH, metadata is merged with existing values.

Response

201 - application/json
id
string
required
read-only
Pattern: ^[-a-zA-Z0-9_]+$
first_name
string
required
Maximum string length: 255
last_name
string
required
Maximum string length: 255
dob
string<date>
required
employer
string
required
address
object
required
hire_date
string<date>
required
middle_name
string | null
Maximum string length: 255
ssn_last_four
string
read-only
email
string<email> | null
Maximum string length: 254
phone_number
string | null
Maximum string length: 10
enrollments
string[]
read-only
termination_date
string<date> | null
payroll_provider_external_id
string | null
Maximum string length: 255
biological_sex
  • male - Male
  • female - Female
Available options:
male,
female
hours_worked
string<decimal>
Pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
pay_frequency
enum<string>
  • weekly - Weekly
  • biweekly - Biweekly
  • semimonthly - Semimonthly
  • monthly - Monthly
Available options:
weekly,
biweekly,
semimonthly,
monthly
employment_status
enum<string>
  • full_time - Full Time
  • part_time - Part Time
  • variable_hours - Variable Hours
Available options:
full_time,
part_time,
variable_hours
subclasses
string[]
business_unit
string | null
job_title
string | null
Maximum string length: 255
is_union
boolean | null

Whether the employee is a union member

is_seasonal
boolean | null

Whether the employee is seasonal

metadata
object

Up to 50 key-value pairs. Keys max 40 characters, values max 500 characters. Set a value to empty string to remove a key. On PATCH, metadata is merged with existing values.