# SDK
Source: https://docs.withclasp.com/SDK
Steps to embed the Clasp Employer and Employee Component via iFrame.
Clasp components are plug-and-play UIs delivered as secure, magic-link URLs. You **create** the company/employee via API → **request** a component URL → **iframe** it in your app (or open it as a standalone page). That’s it.
## Prerequisites
| What | Why |
| ------------------------- | ---------------------------------------------------------------------------------- |
| **Clasp API key** | Used as a Bearer token from your backend to call the API and mint component links. |
| **Employer & Member IDs** | Returned from the API when you create each record. |
Never expose your long‑lived API key in the browser.\
All API calls that use the Bearer key should originate **server‑side**.
## 1. Employer Component
```bash theme={null}
POST /components/employer
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{ "employer": "er_123" }
```
**Response**
```json theme={null}
{ "url": "https://benefits.withclasp.com/?otp_token=•••" }
```
## 2. Employee (Member) Component
```bash theme={null}
POST /components/member
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{ "member": "mem_456" }
```
**Response**
```json theme={null}
{ "url": "https://benefits.withclasp.com/?otp_token=•••" }
```
Each URL is already scoped to that employer or member via the one‑time token (`otp_token`).
## Embedding the Component
```jsx theme={null}
```
* ✅ Works in any framework that supports iframes (React, Vue, plain HTML, etc.).
* ✅ Can also be opened as a standalone magic link (handy for email‑based flows).
Need help? Ping us at **[support@withclasp.com](mailto:support@withclasp.com)** or your dedicated solutions engineer.
# Delete Beneficiary
Source: https://docs.withclasp.com/api-reference/beneficiaries/delete-beneficiaries
schemas/2023-08-25/schema.yaml delete /beneficiaries/{public_id}
# List Beneficiaries
Source: https://docs.withclasp.com/api-reference/beneficiaries/get-beneficiaries
schemas/2023-08-25/schema.yaml get /beneficiaries
# Retrieve Beneficiary
Source: https://docs.withclasp.com/api-reference/beneficiaries/get-beneficiaries-1
schemas/2023-08-25/schema.yaml get /beneficiaries/{public_id}
# Reveal TIN
Source: https://docs.withclasp.com/api-reference/beneficiaries/get-beneficiaries-reveal_tin
schemas/2023-08-25/schema.yaml get /beneficiaries/{public_id}/reveal_tin
# Update Beneficiary
Source: https://docs.withclasp.com/api-reference/beneficiaries/patch-beneficiaries
schemas/2023-08-25/schema.yaml patch /beneficiaries/{public_id}
# Create Beneficiary
Source: https://docs.withclasp.com/api-reference/beneficiaries/post-beneficiaries
schemas/2023-08-25/schema.yaml post /beneficiaries
# Delete Beneficiary Allocation
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/delete-beneficiary_allocations
schemas/2023-08-25/schema.yaml delete /beneficiary_allocations/{public_id}
# List Beneficiary Allocations
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/get-beneficiary_allocations
schemas/2023-08-25/schema.yaml get /beneficiary_allocations
# Retrieve Beneficiary Allocation
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/get-beneficiary_allocations-1
schemas/2023-08-25/schema.yaml get /beneficiary_allocations/{public_id}
# Update Beneficiary Allocation
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/patch-beneficiary_allocations
schemas/2023-08-25/schema.yaml patch /beneficiary_allocations/{public_id}
# Create Beneficiary Allocation
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/post-beneficiary_allocations
schemas/2023-08-25/schema.yaml post /beneficiary_allocations
# Delete Business Unit
Source: https://docs.withclasp.com/api-reference/business_units/delete-business_units
schemas/2023-08-25/schema.yaml delete /business_units/{public_id}
# List Business Units
Source: https://docs.withclasp.com/api-reference/business_units/get-business_units
schemas/2023-08-25/schema.yaml get /business_units
# Retrieve Business Unit
Source: https://docs.withclasp.com/api-reference/business_units/get-business_units-1
schemas/2023-08-25/schema.yaml get /business_units/{public_id}
# Update Business Unit
Source: https://docs.withclasp.com/api-reference/business_units/patch-business_units
schemas/2023-08-25/schema.yaml patch /business_units/{public_id}
# Create Business Unit
Source: https://docs.withclasp.com/api-reference/business_units/post-business_units
schemas/2023-08-25/schema.yaml post /business_units
# List Carriers
Source: https://docs.withclasp.com/api-reference/carriers/get-carriers
schemas/2023-08-25/schema.yaml get /carriers
Lists all carriers supported by Clasp.
# Retrieve Carrier
Source: https://docs.withclasp.com/api-reference/carriers/get-carriers-1
schemas/2023-08-25/schema.yaml get /carriers/{public_id}
Retrieves info for a single carrier.
# Employer Admin
Source: https://docs.withclasp.com/api-reference/components/post-componentsemployer
schemas/2023-08-25/schema.yaml post /components/employer
Generates a magic link to a portal used by employers to view and manage their company's benefits. Magic links can be embedded directly into your product via iFrame.
# Member Admin
Source: https://docs.withclasp.com/api-reference/components/post-componentsmember
schemas/2023-08-25/schema.yaml post /components/member
Generates a magic link to a portal used by employees to view and manage their benefits. Magic links can be embedded directly into your product via iFrame.
# Delete Dependent
Source: https://docs.withclasp.com/api-reference/dependents/delete-dependents
schemas/2023-08-25/schema.yaml delete /dependents/{public_id}
Permanently deletes a dependent.
# List Dependents
Source: https://docs.withclasp.com/api-reference/dependents/get-dependents
schemas/2023-08-25/schema.yaml get /dependents
Lists all dependents under your provider.
# Retrieve Dependent
Source: https://docs.withclasp.com/api-reference/dependents/get-dependents-1
schemas/2023-08-25/schema.yaml get /dependents/{public_id}
Retrieves a dependent's details.
# Reveal SSN
Source: https://docs.withclasp.com/api-reference/dependents/get-dependents-reveal_ssn
schemas/2023-08-25/schema.yaml get /dependents/{public_id}/reveal_ssn
Reveals the unmasked SSN for the given dependent id.
# Update Dependent
Source: https://docs.withclasp.com/api-reference/dependents/patch-dependents
schemas/2023-08-25/schema.yaml patch /dependents/{public_id}
Updates a dependent's details.
# Create Dependent
Source: https://docs.withclasp.com/api-reference/dependents/post-dependents
schemas/2023-08-25/schema.yaml post /dependents
Creates a dependent and associates it to a member.
# Delete Employer Assignment
Source: https://docs.withclasp.com/api-reference/employer_assignments/delete-employer_assignments
schemas/2023-08-25/schema.yaml delete /employer_assignments/{public_id}
# List Employer Assignments
Source: https://docs.withclasp.com/api-reference/employer_assignments/get-employer_assignments
schemas/2023-08-25/schema.yaml get /employer_assignments
# Retrieve Employer Assignment
Source: https://docs.withclasp.com/api-reference/employer_assignments/get-employer_assignments-1
schemas/2023-08-25/schema.yaml get /employer_assignments/{public_id}
# Create Employer Assignment
Source: https://docs.withclasp.com/api-reference/employer_assignments/post-employer_assignments
schemas/2023-08-25/schema.yaml post /employer_assignments
# Delete Employer Document
Source: https://docs.withclasp.com/api-reference/employer_documents/delete-employer_documents
schemas/2023-08-25/schema.yaml delete /employer_documents/{public_id}
Permanently deletes the employer document.
# List Employer Documents
Source: https://docs.withclasp.com/api-reference/employer_documents/get-employer_documents
schemas/2023-08-25/schema.yaml get /employer_documents
Retrieves the full list of every document uploaded.
# Retrieve Employer Document
Source: https://docs.withclasp.com/api-reference/employer_documents/get-employer_documents-1
schemas/2023-08-25/schema.yaml get /employer_documents/{public_id}
Retrieves the employer document by id.
# Update Employer Document
Source: https://docs.withclasp.com/api-reference/employer_documents/patch-employer_documents
schemas/2023-08-25/schema.yaml patch /employer_documents/{public_id}
Updates the employer document. You must pass a URL of the uploaded document in the file field (e.g., S3).
# Create Employer Document
Source: https://docs.withclasp.com/api-reference/employer_documents/post-employer_documents
schemas/2023-08-25/schema.yaml post /employer_documents
Adds a document and associates it to the specified employer.
# List Employers
Source: https://docs.withclasp.com/api-reference/employers/get-employers
schemas/2023-08-25/schema.yaml get /employers
Retrieves a list of all employers that are defined under your provider.
# Retrieve Employer
Source: https://docs.withclasp.com/api-reference/employers/get-employers-1
schemas/2023-08-25/schema.yaml get /employers/{public_id}
Retrieves a single employer object by employer id.
# Update Employer
Source: https://docs.withclasp.com/api-reference/employers/patch-employers
schemas/2023-08-25/schema.yaml patch /employers/{public_id}
Updates an employer's details.
# Create Employer
Source: https://docs.withclasp.com/api-reference/employers/post-employers
schemas/2023-08-25/schema.yaml post /employers
Defines an employer in Clasp.
# Delete Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/delete-enrollments
schemas/2023-08-25/schema.yaml delete /enrollments/{public_id}
Permanently deletes an enrollment. This should only be used when you are sure you want to remove an enrollment. Otherwise, we recommend just reopening it using the reopen endpoint.
# List Enrollments
Source: https://docs.withclasp.com/api-reference/enrollments/get-enrollments
schemas/2023-08-25/schema.yaml get /enrollments
Lists all enrollments under your provider.
# Retrieve Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/get-enrollments-1
schemas/2023-08-25/schema.yaml get /enrollments/{public_id}
Retrieves a single enrollment.
# Approve Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/post-enrollments-approve
schemas/2023-08-25/schema.yaml post /enrollments/{public_id}/approve
Approves a submitted enrollment and sends it to the carrier.
# Eligible Plans
Source: https://docs.withclasp.com/api-reference/enrollments/post-enrollments-eligible_plans
schemas/2023-08-25/schema.yaml post /enrollments/{public_id}/eligible_plans
Lists all eligible plans under an enrollment.
# Reopen Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/post-enrollments-reopen
schemas/2023-08-25/schema.yaml post /enrollments/{public_id}/reopen
Reopens a submitted enrollment to make changes.
# Submit Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/post-enrollments-save_and_submit
schemas/2023-08-25/schema.yaml post /enrollments/{public_id}/save_and_submit
Stages an enrollment, but does not send to carrier. You are not able to edit submitted enrollments unless you reopen it.
# List EOI Requests
Source: https://docs.withclasp.com/api-reference/eoi_requests/get-eoi_requests
schemas/2023-08-25/schema.yaml get /eoi_requests
Lists Evidence of Insurability (EOI) requests. An EOI request is created when a member or dependent elects a coverage volume above the guaranteed issue amount, and the carrier requires evidence of insurability before the excess volume can go into effect.
# Approve EOI Request
Source: https://docs.withclasp.com/api-reference/eoi_requests/post-eoi_requests-approve
schemas/2023-08-25/schema.yaml post /eoi_requests/approve
Approves an EOI request, recording the volume approved by the carrier and the date it goes into effect. `approved_volume` and `effective_date` are required for this action.
# Dismiss EOI Request
Source: https://docs.withclasp.com/api-reference/eoi_requests/post-eoi_requests-dismiss
schemas/2023-08-25/schema.yaml post /eoi_requests/dismiss
Dismisses an EOI request without approving any additional volume. The previously approved or guaranteed issue volume remains in effect.
# Delete Member Document
Source: https://docs.withclasp.com/api-reference/member_documents/delete-member-documents
schemas/2023-08-25/schema.yaml delete /member_documents/{public_id}
Archives the member document and removes it from normal API and employee access. The private file is retained, and there is no partner-facing restore endpoint. Requires the memberdocument:write scope.
# List Member Documents
Source: https://docs.withclasp.com/api-reference/member_documents/get-member-documents
schemas/2023-08-25/schema.yaml get /member_documents
Retrieves member documents. Filter by member or employer. The file field in each response is a temporary signed URL for the private PDF. Requires the memberdocument:read or memberdocument:write scope.
# Retrieve Member Document
Source: https://docs.withclasp.com/api-reference/member_documents/get-member-documents-1
schemas/2023-08-25/schema.yaml get /member_documents/{public_id}
Retrieves a member document by ID. The file field is a temporary signed URL for the private PDF. Requires the memberdocument:read or memberdocument:write scope.
# Update Member Document
Source: https://docs.withclasp.com/api-reference/member_documents/patch-member-documents
schemas/2023-08-25/schema.yaml patch /member_documents/{public_id}
Updates the document name or type, or replaces the PDF. The member association cannot be changed; delete the incorrect document and create a new one to move it to another member. Requires the memberdocument:write scope.
# Create Member Document
Source: https://docs.withclasp.com/api-reference/member_documents/post-member-documents
schemas/2023-08-25/schema.yaml post /member_documents
Uploads a PDF up to 5 MiB and associates it with a member. Supported document types are 1095_c, insurance_id_card, and general. Requires the memberdocument:write scope.
# Delete Member
Source: https://docs.withclasp.com/api-reference/members/delete-members
schemas/2023-08-25/schema.yaml delete /members/{public_id}
Permanently deletes a member from Clasp. Do not use this if you are simply terminating employee. You must update their termination_date instead. Only use this if you no longer want their record to exist (e.g., entry error).
# List Members
Source: https://docs.withclasp.com/api-reference/members/get-members
schemas/2023-08-25/schema.yaml get /members
Lists all members under your provider.
# Retrieve Member
Source: https://docs.withclasp.com/api-reference/members/get-members-1
schemas/2023-08-25/schema.yaml get /members/{public_id}
Retrieves details for a single member.
# Reveal SSN
Source: https://docs.withclasp.com/api-reference/members/get-members-reveal_ssn
schemas/2023-08-25/schema.yaml get /members/{public_id}/reveal_ssn
Reveals the unmasked SSN for the given member id.
# Update Member
Source: https://docs.withclasp.com/api-reference/members/patch-members
schemas/2023-08-25/schema.yaml patch /members/{public_id}
Updates a member's details.
# Create Member
Source: https://docs.withclasp.com/api-reference/members/post-members
schemas/2023-08-25/schema.yaml post /members
Defines a member in Clasp. Members are the primary policy holder (i.e., the employee receiving benefits).
# Start Open Enrollment
Source: https://docs.withclasp.com/api-reference/members/post-members-begin_open_enrollment
schemas/2023-08-25/schema.yaml post /members/{public_id}/begin_open_enrollment
Triggers the start of a members open enrollment.
# Create New Hire Enrollment
Source: https://docs.withclasp.com/api-reference/members/post-members-new_hire_enrollment
schemas/2023-08-25/schema.yaml post /members/{public_id}/new_hire_enrollment
# Create Qualifying Life Event
Source: https://docs.withclasp.com/api-reference/members/post-members-qualifying_life_event
schemas/2023-08-25/schema.yaml post /members/{public_id}/qualifying_life_event
Creates a qualified life event (QLE) for a member. This will create an enrollment object that needs to be approved and submitted to the carrier.
# List Notifications
Source: https://docs.withclasp.com/api-reference/notifications/get-notifications
schemas/2023-08-25/schema.yaml get /notifications
Lists notifications. A notification is created when something happens in Clasp that a member, broker, or employer should be told about, such as a new hire becoming eligible or a member submitting their enrollment.
# Retrieve Notification
Source: https://docs.withclasp.com/api-reference/notifications/get-notifications-1
schemas/2023-08-25/schema.yaml get /notifications/{public_id}
Retrieves a single notification by ID.
# List Open Enrollment Windows
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows
schemas/2023-08-25/schema.yaml get /open_enrollment_windows
Lists all open enrollment windows under your provider.
# Retrieve Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-1
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}
Retrieves details for a single open enrollment window.
# Get Change Report
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-change_report
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/change_report
# Get Completed Members
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-completed_members
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/completed_members
# Get Enrollment Census
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-enrollment_census
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/enrollment_census
# Get Incomplete Members
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-incomplete_members
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/incomplete_members
# Get Incomplete Members Report
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-incomplete_members_report
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/incomplete_members_report
# Update Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/patch-open-enrollment-windows
schemas/2023-08-25/schema.yaml patch /open_enrollment_windows/{public_id}
# Create Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows
schemas/2023-08-25/schema.yaml post /open_enrollment_windows
# Activate Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows-activate
schemas/2023-08-25/schema.yaml post /open_enrollment_windows/{public_id}/activate
Activate an open enrollment window, changing its status to active.
# Close Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows-close
schemas/2023-08-25/schema.yaml post /open_enrollment_windows/{public_id}/close
# Complete Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows-complete
schemas/2023-08-25/schema.yaml post /open_enrollment_windows/{public_id}/complete
# Reopen Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows-reopen
schemas/2023-08-25/schema.yaml post /open_enrollment_windows/{public_id}/reopen
# Delete Pay Rate
Source: https://docs.withclasp.com/api-reference/pay_rates/delete-pay_rates
schemas/2023-08-25/schema.yaml delete /pay_rates/{public_id}
Deletes a pay rate
# List Pay Pay Rates
Source: https://docs.withclasp.com/api-reference/pay_rates/get-pay_rates
schemas/2023-08-25/schema.yaml get /pay_rates
List all pay rates that have been created
# Retrieve Pay Rate
Source: https://docs.withclasp.com/api-reference/pay_rates/get-pay_rates-1
schemas/2023-08-25/schema.yaml get /pay_rates/{public_id}
Retrieves details for a single pay rate
# Update Pay Rate
Source: https://docs.withclasp.com/api-reference/pay_rates/patch-pay_rates
schemas/2023-08-25/schema.yaml patch /pay_rates/{public_id}
Update a pay rate. Note: effective_start dates may not be updated to cross existing pay rates.
# Create Pay Rate
Source: https://docs.withclasp.com/api-reference/pay_rates/post-pay_rates
schemas/2023-08-25/schema.yaml post /pay_rates
Defines a pay rate in Clasp. Pay rates define the annual salary/hourly wage for a given Member. Note: New pay rates must be created with an effective_start date later than all existing pay_rates
# List Payroll Benefits
Source: https://docs.withclasp.com/api-reference/payroll_benefits/get-payroll_benefits
schemas/2023-08-25/schema.yaml get /payroll_benefits
Returns a list of all payroll benefit deductions.
# Retrieve Payroll Benefit
Source: https://docs.withclasp.com/api-reference/payroll_benefits/get-payroll_benefits-1
schemas/2023-08-25/schema.yaml get /payroll_benefits/{public_id}
Retrieves a single payroll benefit deduction.
# Update Payroll Benefit
Source: https://docs.withclasp.com/api-reference/payroll_benefits/patch-payroll_benefits
schemas/2023-08-25/schema.yaml patch /payroll_benefits/{public_id}
Updates a single payroll benefit deduction. Commonly used to link benefits between Clasp and the payroll provider.
# List Payroll Payments
Source: https://docs.withclasp.com/api-reference/payroll_payments/get-payroll_payments
schemas/2023-08-25/schema.yaml get /payroll_payments
Returns a list of all payroll payments.
# Retrieve Payroll Payment
Source: https://docs.withclasp.com/api-reference/payroll_payments/get-payroll_payments-1
schemas/2023-08-25/schema.yaml get /payroll_payments/{public_id}
# Authentication
Source: https://docs.withclasp.com/guides/authentication
To ensure secure access, all API requests must be authenticated. Follow the steps below to authenticate your requests:
1. Obtain an API Key: Before making requests, obtain your sandbox or live API key. This key uniquely identifies you as a user and grants access to the API features.
2. Include an Authorization Header: With your API key, authenticate each request by including an Authorization header. Use the Bearer token type for authentication.
3. Format Your Request: Your request should include the Authorization header as follows, replacing YOUR\_API\_KEY with the actual key you obtained:
```
Authorization: Bearer YOUR_API_KEY
```
Ensure that you replace YOUR\_API\_KEY with your actual sandbox or live API key. Using this method, your requests are authenticated, allowing you to securely access the API functionalities.
# Error Handling
Source: https://docs.withclasp.com/guides/error_handling
Clasp utilizes standard HTTP response codes to succinctly communicate the status of API requests. The codes are categorized to reflect the nature of the response:
* `2xx` Range: Indicates success. The request was successfully received, understood, and accepted.
* `4xx` Range: Signifies client errors. These codes point to issues with the request made by the client.
* `5xx` Range: Represents server errors. These are errors on Clasp's side, and we strive to resolve them promptly.
### Error Schema
Errors returned by Clasp follow a structured format to aid in understanding and resolution:
* `type` (string): Identifies the error type.
* `message` (string): Provides a detailed description of the error and suggestions for resolution.
* `input_errors` (list): An optional list that, if applicable, includes objects detailing errors related to specific input fields. Each object contains:
* `field` (string): The field associated with the error.
* `field_path` (string): The hierarchical path to the erroneous field.
* `message` (string): Explanation of the error related to the field.
#### Example Error Response
In cases where an API request fails due to specific input errors, Clasp returns a detailed JSON error response. For instance, attempting to update a resource with incomplete data might yield the following error:
```json theme={null}
{
"type": "validation_error",
"message": "Invalid data passed for fields",
"input_errors": [
{
"message": "This field is required.",
"field": "member",
"field_path": ["dependents", "0", "member"]
}
]
}
```
# Component Page Navigation
Source: https://docs.withclasp.com/guides/navigation
Learn to customize Clasp's navigation
Internal navigation in the Clasp component can be handled in a few ways. Depending on where and what parts of the Component you want to surface to your users, this guide will walk you through how to achieve them.
## 1) Query Parameter
The benefit of using a query param is that it leverages the browser history allowing native navigation
## 2) State Based
You can also treat the clasp-components as a controlled component by passing a `claspState` variable and an `onChangeState` function to listen for page state changes.
It's best to opt for the Query Parameter option to leverage the browser's native navigation system.
# External Clasp Navigation
There's a few parts within the enrollment flow where clasp passes control of navigation back to the client
It can be done in two ways
## 1) String
you can pass a string to easily navigate back to the desired page
```tsx theme={null}
export const BenefitsPage = () => {
const navigate = useNavigate();
const clasp_config: ClaspConfig = {
...
links: {
home: "/"
}
}
return (
...
)
}
```
## 2) Function
You can pass a function that can integrate with your routing system
The benefit of passing a function instead of a string is to preserve the SPA feeling
The following example uses react-router
```tsx theme={null}
export const BenefitsPage = () => {
const navigate = useNavigate();
const clasp_config: ClaspConfig = {
...
links: {
home: () => {
navigate("/")
}
}
}
return (
...
)
}
```
# Notifications
Source: https://docs.withclasp.com/guides/notifications
Notifications represent important business events that should typically result in communications to a member, broker, or employer. For example, a new hire becoming eligible for benefits or a member submitting an enrollment will both create Notification objects in Clasp. The Notifications API lets you stay in the loop so that you are able to control communications via your own channels and templates instead of having Clasp send them.
## Overview
When an important business event occurs, such as a new hire becoming eligible for benefits, Clasp creates a notification object. If the notification is "Clasp managed", Clasp will immediately send an email. Otherwise, Clasp will only emit a webhook informing you of the new Notification and will not send an email. Please reach out to Clasp to configure which notification types are Clasp managed vs Partner managed.
## Notification Object
Each notification has the following structure:
```json theme={null}
{
"id": "noti_8Ln4MbSf5uLFurmAOfNr9",
"notification_type": "welcome",
"related_object_type": "member",
"related_object_id": "mem_kBRoHxraaHbXO9K4JXIRP",
"payload": {
"first_name": "John",
"employer_name": "ABC Company"
},
"owner": "partner",
"created_at": "2025-01-06T05:41:19.093833Z"
}
```
### Field Descriptions
* `id`: Unique identifier for the notification
* `notification_type`: Which type of notification this is. For example, `welcome` is created for new hires and `enrollment_submitted` after a member submits their enrollment
* `related_object_type`: The type of object this notification is about (e.g. `member`, `enrollment`, `open_enrollment_window`)
* `related_object_id`: ID of the object this notification is about
* `payload`: Commonly used information for notifications of this type that can be populated into your communications
* `owner`: Who is responsible for delivering this notification (`partner` or `clasp`)
* `created_at`: Timestamp when the notification was created
### Notification Types
| Notification Type | Created When | Related Object Type |
| -------------------------- | ---------------------------------------------------- | ------------------------ |
| `welcome` | A new hire should be welcomed and invited to enroll | `member` |
| `newly_eligible` | A member becomes eligible for benefits | `member` |
| `member_terminated` | A member is terminated | `member` |
| `dependent_age_out` | A member's dependent is about to age out of coverage | `member` |
| `enrollment_submitted` | A member submits their enrollment | `enrollment` |
| `enrollment_approved` | A member's enrollment is approved | `enrollment` |
| `open_enrollment_kickoff` | An open enrollment window opens | `open_enrollment_window` |
| `open_enrollment_reminder` | A member has not yet completed open enrollment | `open_enrollment_window` |
New notification types will be added over time.
## Receiving Notifications via Webhooks
Notifications work together with [webhooks](/guides/webhooks). When a notification is created, Clasp sends a webhook event with `object_type` set to `notification` and the notification's ID:
```json theme={null}
{
"id": "evnt_8Ln4MbSf5uLFurmAOfNr9",
"event_type": "created",
"object_id": "noti_8Ln4MbSf5uLFurmAOfNr9",
"object_type": "notification",
"employer": "er_67Al5UIOFMPsrHbLI8YnU",
"created_at": "2025-01-06T05:41:19.093833Z"
}
```
When you receive this event:
1. Fetch the notification content with `GET /notifications/{object_id}`
2. Check the `owner` field. If the owner is `clasp`, Clasp will have initiated an email already.
3. Leverage the `notification_type`, `related_object_type`, and `related_object_id` to identify what type of communications are required and for whom.
4. Use the `payload` for notification specific data that is snapshotted at the time of the notification being created.
See the [Webhooks guide](/guides/webhooks) for details on configuring your endpoint and verifying event signatures.
# Pagination
Source: https://docs.withclasp.com/guides/pagination
At Clasp, we prioritize efficient data retrieval and manageable response sizes. To achieve this, responses that return lists of objects are paginated. This approach breaks a large dataset into smaller, more manageable chunks called pages, facilitating easier navigation through the data.
#### Understanding Paginated Responses
Endpoints returning lists are designed to provide responses in pages, each containing a maximum of 25 objects by default. However, Clasp allows customization of page size up to a maximum of 100 objects. A typical paginated response includes:
* `next`: URL pointing to the next page of results (or null if no further pages are available).
* `previous`: URL pointing to the previous page of results (or null if this is the first page).
* `results`: The data objects for the current page.
```json theme={null}
{
"next": "string | null",
"previous": "string | null",
"results": [array of objects]
}
```
#### Navigating Through Pages
To navigate through paginated data, follow the URLs provided in the next and previous fields of the response. For instance, to retrieve all entities from a paginated list, start with the initial GET request. The response will include the first page of data along with a next URL for accessing the subsequent page.
Here’s an example of accessing the first page of a list:
```json theme={null}
{
"next": "https://sandbox.withclasp.com/members?cursor=cD0yMDI0LTAy"
}
```
To proceed to the next page, make a GET request using the URL in the next field. If you reach a page where next is null, you've accessed all available data.
#### Customizing Page Size
You can adjust the number of objects returned in each page through the limit query parameter, with valid values ranging from 1 to 100. If not specified, the default page size is 25.
```
https://sandbox.withclasp.com/members?page_size=100
```
This flexibility in page size allows for optimized data retrieval tailored to your application's needs, ensuring both efficiency and scalability when accessing Clasp's API resources.
# Rate Limiting
Source: https://docs.withclasp.com/guides/rate_limiting
To ensure a fair and reliable usage of the Clasp API, we enforce a rate limiting policy. This policy helps protect against excessive requests that could affect service quality.
#### Standard Throttling
Requests Limit: Partners are allowed up to 25 requests per second across all their API keys.
Concurrency Limit: A maximum of 50 concurrent requests per partner is enforced to prevent overload.
#### Handling Limits
When a request exceeds the allowed rate, a `429` HTTP status code is returned, indicating that the request has been throttled. The response provides details on when to retry:
```json theme={null}
{
"type": "throttled",
"message": "Request was throttled. Expected available in 1 second."
}
```
Additionally, the `Retry-After` header offers the exact wait time before the next request attempt, simplifying automated retry logic.
#### Strategies for Managing Limits
Proactive Throttling: Clients should monitor their request frequency to stay within the imposed limits.
Automated Retries: Implementing automatic retries with respect to the `Retry-After` timeframe is recommended for handling `429` responses efficiently.
#### Exceeding Limits
In scenarios requiring higher limits (e.g., bulk operations), partners should contact Clasp developer support to discuss a limit increase. Our goal is to accommodate valid use cases while maintaining system integrity and performance.
This rate limiting policy aims to protect both Clasp and its partners from potential issues arising from excessive API calls, ensuring a stable and responsive service for all users.
# Component Styling
Source: https://docs.withclasp.com/guides/styling
Clasp gives you complete control over the look and feel of the components your embedding
# Theme Object
```ts theme={null}
export interface ColorConfig {
[string]: string[] // 10 different shades of the color specified in the key
}
export interface ClaspTheme {
fontFamily?: string
colors?: ColorConfig
primaryShade?: string
primaryColor?: string
radius?: {
xs: string
sm: string
md: string
lg: string
xl: string
}
fontSizes?: {
xs: string
sm: string
md: string
lg: string
xl: string
}
lineHeights?: {
xs: string
sm: string
md: string
lg: string
xl: string
}
shadows?: {
xs: string
sm: string
md: string
lg: string
xl: string
}
}
```
you can provide a `Partial` to any `ClaspView`. This is the easiest and most consistent way of changing the styling of a clasp component
the most important styles to change are
1. `ClaspTheme.fontFamily` : to align the font family with your application's
# CSS File
```jsx theme={null}
import 'clasp-components/dist/style.css'
import './ClaspStyleOverride.css'
```
if you need more granular management of styles you can create your own css file and override the styles found in the `clasp-components/dist/styles.css`
The best way of finding the style you want to override is to inspect the element in the browser to find the appropriate class name or id
## ClaspStyleOverride.css
```css theme={null}
._button_1a1ab_1{
color: white;
}
```
# Font Family
you can pass any font family to the clasp-components as long as it has been previously imported or is web safe font
# Positioning
the clasp-components views attempt to be unopinionated about positioning, so there is no padding / alignment attached to the views.
As such, wherever you implement a Clasp view you should position it as you want
Here's an example using flex to position the SDK in the middle with a padding of 24px
```css theme={null}
.wrapper {
height: 52px;
display: flex;
justify-content: center;
width: 100%;
padding: 24px;
box-sizing: border-box;
}
```
```jsx theme={null}
import { ClaspEmployerView } from 'clasp-components'
...
export const BenefitsPage = () => {
return (
)
}
```
# Versioning
Source: https://docs.withclasp.com/guides/versioning
Clasp maintains API versions when releasing backwards incompatible changes. Versioning is facilitated by the use of a `Clasp-Version: version_string` request header, which should be included in every request to the Clasp API.
Partners can choose a pinned version, which Clasp will use if requests from that partner do not contain the version header. New partners default to the latest version of the API. If a newer API version than a partner's pinned version is released, and that partner sends a request without the header, the request will be served with a response corresponding to the pinned version of the API. However, if a request contains a version header, that version will take precedence.
Current API Versions:
* `2026-04-24`
* `2023-08-25`
# Webhooks
Source: https://docs.withclasp.com/guides/webhooks
Webhooks are a way to receive real-time updates from Clasp. They allow your application to be notified automatically when certain events occur in Clasp, eliminating the need to continuously poll the API for changes.
## Overview
When an important change happens in your Clasp account (like a member being updated or an employer being created), Clasp generates an event and sends an HTTP POST request to your configured endpoint with details about what changed. Please reach out to Clasp to get started.
## Event Payload
Each event is sent as a JSON payload with the following structure:
```json theme={null}
{
"id": "evnt_8Ln4MbSf5uLFurmAOfNr9",
"event_type": "updated",
"object_id": "er_67Al5UIOFMPsrHbLI8YnU",
"object_type": "employer",
"employer": "er_67Al5UIOFMPsrHbLI8YnU",
"created_at": "2025-01-06T05:41:19.093833Z"
}
```
### Field Descriptions
* `id`: Unique identifier for the event
* `event_type`: The type of change that occurred
* `object_id`: Identifier of the object that changed
* `object_type`: Type of object that changed
* `employer`: Identifier of the employer the object belongs to
* `created_at`: Timestamp when the event occurred
### Supported Events
| Object Types | Event Types |
| -------------------------- | ----------- |
| - `member` | - `created` |
| - `dependent` | - `updated` |
| - `employer` | - `deleted` |
| - `payroll_benefit` | |
| - `open_enrollment_window` | |
| - `enrollment` | |
| - `business_unit` | |
## Security
### Verifying Webhook Signatures
Every webhook request includes two important headers:
1. `Clasp-Event-Timestamp`: When the event was sent
2. `Clasp-Event-Signature`: HMAC signature of the event
To verify the event is legitimate via the signature:
1. Concatenate the event payload with the timestamp: `${payload}.${timestamp}`
2. Create an HMAC SHA-256 digest with the shared secret
3. Compare the calculated signature with `Clasp-Event-Signature`
Here's a Python example of signature verification:
```python theme={null}
import hashlib
import hmac
import json
def verify_event(payload, timestamp, signature, secret):
# Calculate expected signature
message = f"{json.dumps(payload)}.{timestamp}".encode("utf-8")
expected = hmac.new(
secret.encode('utf-8'),
message,
hashlib.sha256
).hexdigest()
# Compare the digests
return hmac.compare_digest(expected, signature)
```
## Best Practices
### 1. Response
* Return a 200 status code as quickly as possible
* Store the event ID to prevent duplicate processing
* New event and object types will be added over time. Ensure a 200 response is returned for all events
* Clasp will retry failed event deliveries up to 10 times when an error response is returned
### 2. Fetching Current Data
* Use the `object_type` and `object_id` to determine which API endpoint to query
* Fetch the current state from the API
# Overview
Source: https://docs.withclasp.com/overview
Building an employee benefits product with Clasp
You can embed health benefits administration directly into your product. Clasp integrates with all the major carriers so your customers can connect their existing plans in just a few clicks. Clasp also integrates with your payroll provider to automatically manage benefits deductions every pay cycle.
## Getting started
Integrate Clasp with just a few lines of code.
The fastest way to get started with Clasp.
Learn more about how to integrate with Clasp's SDK.
## Exploring further
The following guides expand on topics covered in the quickstart guide.
Learn more about embeddable benefits components.
Customize the look and feel of the benefits experience.
# Quickstart Guide
Source: https://docs.withclasp.com/quickstart
Clasp API basics.
## 1. Prerequisites
| What | Why |
| ----------------- | ---------------------------------------------------------------------------------- |
| **Clasp API key** | Used as a Bearer token from your backend to call the API and mint component links. |
Never expose your long‑lived API key in the browser.\
All API calls that use the Bearer key should originate **server‑side**.
## 2. Create an employer
```bash theme={null}
POST /employers
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"legal_name": "Example Legal Name",
"trade_name": "Example Trade Name",
"external_id": "payroll_provider_company_id",
"email": "company@domain.com",
"address": {
"line1": "1600 Pennsylvania Ave",
"city": "Washington",
"state": "DC",
"zip_code": "20500"
}
}
```
The response includes an `id` such as `er_123`. Persist this for future calls.
## 3. Create an employee (members)
```bash theme={null}
POST /members
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"first_name": "Jane",
"last_name": "Doe",
"dob": "1990-05-16",
"ssn": "123456789",
"email": "jane.doe@domain.com",
"employer": "er_123",
"hire_date": "2024-01-08",
"hours_worked": 40,
"pay_frequency": "biweekly"
}
```
Save the returned member `id` (e.g., `mem_456`).
## 4. Create a group structure
```bash theme={null}
POST /groups
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"group_number": "1324234",
"carrier": "carr_xOvpBqHA75scQCtcHNfLS",
"employer": "{{claspEmployerId}}"
}
```
## 5. Create a plan
```bash theme={null}
POST /plans
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"termination_policy": "termination_date",
"waiting_period": "First of Month after 30 Days",
"plan_name": "Platinum HMO",
"plan_type": "hmo",
"line_of_coverage": "medical",
"group": "{{claspGroupId}}",
"premium_type": "composite",
"effective_start": "2025-05-01",
"effective_end": "2026-04-30",
"requires_primary_care_provider": true,
"plan_details": [
{
"label": "Medical Deductible",
"tooltip": "The amount that you must pay before your health plan begins to pay or contribute for any medical services.",
"info_lines": [
"Individual: $1,250",
"Family: $2,500"
]
},
{
"label": "Pharma Deductible",
"tooltip": "The amount that you must pay before your health plan begins to pay or contribute for any prescriptions.",
"info_lines": [
"Individual: $0",
"Family: $0"
]
},
{
"label": "Physician Visit",
"tooltip": "The fixed amount that you will contribute towards physician visits.",
"info_lines": [
"Primary: $35/visit",
"Specialist: $60/visit"
]
},
{
"label": "Out-of-pocket Max",
"tooltip": "The limit on the amount you are obligated to pay during the plan year for any treatment that is covered by your plan.",
"info_lines": [
"Individual: $8,600",
"Family: $17,200"
]
}
],
"composite_rates": {
"member": "395.42",
"member_spouse": "578.40",
"member_child": "530.20",
"member_children": "842.61",
"member_family": "1550.67"
}
}
```
## 6. Define a plan configuration
```bash theme={null}
POST /plan_configurations
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"plan": "{{claspMedicalPlanId}}",
"termination_policy": "termination_date",
"waiting_period": {
"duration": 0,
"period": "day",
"policy": "end_of_waiting_period"
}
}
```
## 7. Set up a contribution strategy for the plan
```bash theme={null}
POST /plan_configurations/{{claspMedicalPlanConfigurationId}}/contribution_strategy
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"member": {
"contribution_type": "employer_percentage",
"contribution": "80",
"monthly_min_threshold": "5",
"monthly_max_threshold": "1200"
},
"member_spouse": {
"contribution_type": "employer_percentage",
"contribution": "50",
"monthly_min_thresold": "5",
"monthly_max_threshold": "1200"
},
"member_child": {
"contribution_type": "employer_percentage",
"contribution": "50",
"monthly_min_threshold": "5",
"monthly_max_threshold": "1200"
},
"member_children": {
"contribution_type": "employer_percentage",
"contribution": "30",
"monthly_min_threshold": "5",
"monthly_max_threshold": "1200"
},
"member_family": {
"contribution_type": "employer_percentage",
"contribution": "25",
"monthly_min_threshold": "5",
"monthly_max_threshold": "1200"
}
}
```
## 8. Generate an Employee Component magic link
```bash theme={null}
POST /components/member
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{ "member": "mem_456" }
```
**Response**
```json theme={null}
{ "url": "https://benefits.withclasp.com/?otp_token=•••" }
```
Congrats! You've just set up your first plan. Open the magic link you just generated to enroll in the plan.
Need help? Ping us at **[support@withclasp.com](mailto:support@withclasp.com)** or your dedicated solutions engineer.
# SDK
Source: https://docs.withclasp.com/SDK
Steps to embed the Clasp Employer and Employee Component via iFrame.
Clasp components are plug-and-play UIs delivered as secure, magic-link URLs. You **create** the company/employee via API → **request** a component URL → **iframe** it in your app (or open it as a standalone page). That’s it.
## Prerequisites
| What | Why |
| ------------------------- | ---------------------------------------------------------------------------------- |
| **Clasp API key** | Used as a Bearer token from your backend to call the API and mint component links. |
| **Employer & Member IDs** | Returned from the API when you create each record. |
Never expose your long‑lived API key in the browser.\
All API calls that use the Bearer key should originate **server‑side**.
## 1. Employer Component
```bash theme={null}
POST /components/employer
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{ "employer": "er_123" }
```
**Response**
```json theme={null}
{ "url": "https://benefits.withclasp.com/?otp_token=•••" }
```
## 2. Employee (Member) Component
```bash theme={null}
POST /components/member
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{ "member": "mem_456" }
```
**Response**
```json theme={null}
{ "url": "https://benefits.withclasp.com/?otp_token=•••" }
```
Each URL is already scoped to that employer or member via the one‑time token (`otp_token`).
## Embedding the Component
```jsx theme={null}
```
* ✅ Works in any framework that supports iframes (React, Vue, plain HTML, etc.).
* ✅ Can also be opened as a standalone magic link (handy for email‑based flows).
Need help? Ping us at **[support@withclasp.com](mailto:support@withclasp.com)** or your dedicated solutions engineer.
# Delete Beneficiary
Source: https://docs.withclasp.com/api-reference/beneficiaries/delete-beneficiaries
schemas/2023-08-25/schema.yaml delete /beneficiaries/{public_id}
# List Beneficiaries
Source: https://docs.withclasp.com/api-reference/beneficiaries/get-beneficiaries
schemas/2023-08-25/schema.yaml get /beneficiaries
# Retrieve Beneficiary
Source: https://docs.withclasp.com/api-reference/beneficiaries/get-beneficiaries-1
schemas/2023-08-25/schema.yaml get /beneficiaries/{public_id}
# Reveal TIN
Source: https://docs.withclasp.com/api-reference/beneficiaries/get-beneficiaries-reveal_tin
schemas/2023-08-25/schema.yaml get /beneficiaries/{public_id}/reveal_tin
# Update Beneficiary
Source: https://docs.withclasp.com/api-reference/beneficiaries/patch-beneficiaries
schemas/2023-08-25/schema.yaml patch /beneficiaries/{public_id}
# Create Beneficiary
Source: https://docs.withclasp.com/api-reference/beneficiaries/post-beneficiaries
schemas/2023-08-25/schema.yaml post /beneficiaries
# Delete Beneficiary Allocation
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/delete-beneficiary_allocations
schemas/2023-08-25/schema.yaml delete /beneficiary_allocations/{public_id}
# List Beneficiary Allocations
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/get-beneficiary_allocations
schemas/2023-08-25/schema.yaml get /beneficiary_allocations
# Retrieve Beneficiary Allocation
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/get-beneficiary_allocations-1
schemas/2023-08-25/schema.yaml get /beneficiary_allocations/{public_id}
# Update Beneficiary Allocation
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/patch-beneficiary_allocations
schemas/2023-08-25/schema.yaml patch /beneficiary_allocations/{public_id}
# Create Beneficiary Allocation
Source: https://docs.withclasp.com/api-reference/beneficiary_allocations/post-beneficiary_allocations
schemas/2023-08-25/schema.yaml post /beneficiary_allocations
# Delete Business Unit
Source: https://docs.withclasp.com/api-reference/business_units/delete-business_units
schemas/2023-08-25/schema.yaml delete /business_units/{public_id}
# List Business Units
Source: https://docs.withclasp.com/api-reference/business_units/get-business_units
schemas/2023-08-25/schema.yaml get /business_units
# Retrieve Business Unit
Source: https://docs.withclasp.com/api-reference/business_units/get-business_units-1
schemas/2023-08-25/schema.yaml get /business_units/{public_id}
# Update Business Unit
Source: https://docs.withclasp.com/api-reference/business_units/patch-business_units
schemas/2023-08-25/schema.yaml patch /business_units/{public_id}
# Create Business Unit
Source: https://docs.withclasp.com/api-reference/business_units/post-business_units
schemas/2023-08-25/schema.yaml post /business_units
# List Carriers
Source: https://docs.withclasp.com/api-reference/carriers/get-carriers
schemas/2023-08-25/schema.yaml get /carriers
Lists all carriers supported by Clasp.
# Retrieve Carrier
Source: https://docs.withclasp.com/api-reference/carriers/get-carriers-1
schemas/2023-08-25/schema.yaml get /carriers/{public_id}
Retrieves info for a single carrier.
# Employer Admin
Source: https://docs.withclasp.com/api-reference/components/post-componentsemployer
schemas/2023-08-25/schema.yaml post /components/employer
Generates a magic link to a portal used by employers to view and manage their company's benefits. Magic links can be embedded directly into your product via iFrame.
# Member Admin
Source: https://docs.withclasp.com/api-reference/components/post-componentsmember
schemas/2023-08-25/schema.yaml post /components/member
Generates a magic link to a portal used by employees to view and manage their benefits. Magic links can be embedded directly into your product via iFrame.
# Delete Dependent
Source: https://docs.withclasp.com/api-reference/dependents/delete-dependents
schemas/2023-08-25/schema.yaml delete /dependents/{public_id}
Permanently deletes a dependent.
# List Dependents
Source: https://docs.withclasp.com/api-reference/dependents/get-dependents
schemas/2023-08-25/schema.yaml get /dependents
Lists all dependents under your provider.
# Retrieve Dependent
Source: https://docs.withclasp.com/api-reference/dependents/get-dependents-1
schemas/2023-08-25/schema.yaml get /dependents/{public_id}
Retrieves a dependent's details.
# Reveal SSN
Source: https://docs.withclasp.com/api-reference/dependents/get-dependents-reveal_ssn
schemas/2023-08-25/schema.yaml get /dependents/{public_id}/reveal_ssn
Reveals the unmasked SSN for the given dependent id.
# Update Dependent
Source: https://docs.withclasp.com/api-reference/dependents/patch-dependents
schemas/2023-08-25/schema.yaml patch /dependents/{public_id}
Updates a dependent's details.
# Create Dependent
Source: https://docs.withclasp.com/api-reference/dependents/post-dependents
schemas/2023-08-25/schema.yaml post /dependents
Creates a dependent and associates it to a member.
# Delete Employer Assignment
Source: https://docs.withclasp.com/api-reference/employer_assignments/delete-employer_assignments
schemas/2023-08-25/schema.yaml delete /employer_assignments/{public_id}
# List Employer Assignments
Source: https://docs.withclasp.com/api-reference/employer_assignments/get-employer_assignments
schemas/2023-08-25/schema.yaml get /employer_assignments
# Retrieve Employer Assignment
Source: https://docs.withclasp.com/api-reference/employer_assignments/get-employer_assignments-1
schemas/2023-08-25/schema.yaml get /employer_assignments/{public_id}
# Create Employer Assignment
Source: https://docs.withclasp.com/api-reference/employer_assignments/post-employer_assignments
schemas/2023-08-25/schema.yaml post /employer_assignments
# Delete Employer Document
Source: https://docs.withclasp.com/api-reference/employer_documents/delete-employer_documents
schemas/2023-08-25/schema.yaml delete /employer_documents/{public_id}
Permanently deletes the employer document.
# List Employer Documents
Source: https://docs.withclasp.com/api-reference/employer_documents/get-employer_documents
schemas/2023-08-25/schema.yaml get /employer_documents
Retrieves the full list of every document uploaded.
# Retrieve Employer Document
Source: https://docs.withclasp.com/api-reference/employer_documents/get-employer_documents-1
schemas/2023-08-25/schema.yaml get /employer_documents/{public_id}
Retrieves the employer document by id.
# Update Employer Document
Source: https://docs.withclasp.com/api-reference/employer_documents/patch-employer_documents
schemas/2023-08-25/schema.yaml patch /employer_documents/{public_id}
Updates the employer document. You must pass a URL of the uploaded document in the file field (e.g., S3).
# Create Employer Document
Source: https://docs.withclasp.com/api-reference/employer_documents/post-employer_documents
schemas/2023-08-25/schema.yaml post /employer_documents
Adds a document and associates it to the specified employer.
# List Employers
Source: https://docs.withclasp.com/api-reference/employers/get-employers
schemas/2023-08-25/schema.yaml get /employers
Retrieves a list of all employers that are defined under your provider.
# Retrieve Employer
Source: https://docs.withclasp.com/api-reference/employers/get-employers-1
schemas/2023-08-25/schema.yaml get /employers/{public_id}
Retrieves a single employer object by employer id.
# Update Employer
Source: https://docs.withclasp.com/api-reference/employers/patch-employers
schemas/2023-08-25/schema.yaml patch /employers/{public_id}
Updates an employer's details.
# Create Employer
Source: https://docs.withclasp.com/api-reference/employers/post-employers
schemas/2023-08-25/schema.yaml post /employers
Defines an employer in Clasp.
# Delete Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/delete-enrollments
schemas/2023-08-25/schema.yaml delete /enrollments/{public_id}
Permanently deletes an enrollment. This should only be used when you are sure you want to remove an enrollment. Otherwise, we recommend just reopening it using the reopen endpoint.
# List Enrollments
Source: https://docs.withclasp.com/api-reference/enrollments/get-enrollments
schemas/2023-08-25/schema.yaml get /enrollments
Lists all enrollments under your provider.
# Retrieve Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/get-enrollments-1
schemas/2023-08-25/schema.yaml get /enrollments/{public_id}
Retrieves a single enrollment.
# Approve Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/post-enrollments-approve
schemas/2023-08-25/schema.yaml post /enrollments/{public_id}/approve
Approves a submitted enrollment and sends it to the carrier.
# Eligible Plans
Source: https://docs.withclasp.com/api-reference/enrollments/post-enrollments-eligible_plans
schemas/2023-08-25/schema.yaml post /enrollments/{public_id}/eligible_plans
Lists all eligible plans under an enrollment.
# Reopen Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/post-enrollments-reopen
schemas/2023-08-25/schema.yaml post /enrollments/{public_id}/reopen
Reopens a submitted enrollment to make changes.
# Submit Enrollment
Source: https://docs.withclasp.com/api-reference/enrollments/post-enrollments-save_and_submit
schemas/2023-08-25/schema.yaml post /enrollments/{public_id}/save_and_submit
Stages an enrollment, but does not send to carrier. You are not able to edit submitted enrollments unless you reopen it.
# List EOI Requests
Source: https://docs.withclasp.com/api-reference/eoi_requests/get-eoi_requests
schemas/2023-08-25/schema.yaml get /eoi_requests
Lists Evidence of Insurability (EOI) requests. An EOI request is created when a member or dependent elects a coverage volume above the guaranteed issue amount, and the carrier requires evidence of insurability before the excess volume can go into effect.
# Approve EOI Request
Source: https://docs.withclasp.com/api-reference/eoi_requests/post-eoi_requests-approve
schemas/2023-08-25/schema.yaml post /eoi_requests/approve
Approves an EOI request, recording the volume approved by the carrier and the date it goes into effect. `approved_volume` and `effective_date` are required for this action.
# Dismiss EOI Request
Source: https://docs.withclasp.com/api-reference/eoi_requests/post-eoi_requests-dismiss
schemas/2023-08-25/schema.yaml post /eoi_requests/dismiss
Dismisses an EOI request without approving any additional volume. The previously approved or guaranteed issue volume remains in effect.
# List Groups
Source: https://docs.withclasp.com/api-reference/groups/get-groups
schemas/2023-08-25/schema.yaml get /groups
# Retrieve Group
Source: https://docs.withclasp.com/api-reference/groups/get-groups-1
schemas/2023-08-25/schema.yaml get /groups/{public_id}
# Update Group
Source: https://docs.withclasp.com/api-reference/groups/patch-groups
schemas/2023-08-25/schema.yaml patch /groups/{public_id}
# Create Group
Source: https://docs.withclasp.com/api-reference/groups/post-groups
schemas/2023-08-25/schema.yaml post /groups
# Delete Member Document
Source: https://docs.withclasp.com/api-reference/member_documents/delete-member-documents
schemas/2023-08-25/schema.yaml delete /member_documents/{public_id}
Archives the member document and removes it from normal API and employee access. The private file is retained, and there is no partner-facing restore endpoint. Requires the memberdocument:write scope.
# List Member Documents
Source: https://docs.withclasp.com/api-reference/member_documents/get-member-documents
schemas/2023-08-25/schema.yaml get /member_documents
Retrieves member documents. Filter by member or employer. The file field in each response is a temporary signed URL for the private PDF. Requires the memberdocument:read or memberdocument:write scope.
# Retrieve Member Document
Source: https://docs.withclasp.com/api-reference/member_documents/get-member-documents-1
schemas/2023-08-25/schema.yaml get /member_documents/{public_id}
Retrieves a member document by ID. The file field is a temporary signed URL for the private PDF. Requires the memberdocument:read or memberdocument:write scope.
# Update Member Document
Source: https://docs.withclasp.com/api-reference/member_documents/patch-member-documents
schemas/2023-08-25/schema.yaml patch /member_documents/{public_id}
Updates the document name or type, or replaces the PDF. The member association cannot be changed; delete the incorrect document and create a new one to move it to another member. Requires the memberdocument:write scope.
# Create Member Document
Source: https://docs.withclasp.com/api-reference/member_documents/post-member-documents
schemas/2023-08-25/schema.yaml post /member_documents
Uploads a PDF up to 5 MiB and associates it with a member. Supported document types are 1095_c, insurance_id_card, and general. Requires the memberdocument:write scope.
# Delete Member
Source: https://docs.withclasp.com/api-reference/members/delete-members
schemas/2023-08-25/schema.yaml delete /members/{public_id}
Permanently deletes a member from Clasp. Do not use this if you are simply terminating employee. You must update their termination_date instead. Only use this if you no longer want their record to exist (e.g., entry error).
# List Members
Source: https://docs.withclasp.com/api-reference/members/get-members
schemas/2023-08-25/schema.yaml get /members
Lists all members under your provider.
# Retrieve Member
Source: https://docs.withclasp.com/api-reference/members/get-members-1
schemas/2023-08-25/schema.yaml get /members/{public_id}
Retrieves details for a single member.
# Create Member
Source: https://docs.withclasp.com/api-reference/members/post-members
schemas/2023-08-25/schema.yaml post /members
Defines a member in Clasp. Members are the primary policy holder (i.e., the employee receiving benefits).
# Create Payroll Payment
Source: https://docs.withclasp.com/api-reference/payroll_payments/post-payroll_payments
schemas/2023-08-25/schema.yaml post /payroll_payments
Creates a payroll payment to represent a paid paycheck for a given member to feed into ACA calculations.
# Retrieve Contribution Strategy
Source: https://docs.withclasp.com/api-reference/plan_configurations/2026-04-24/get-plan-configurations-contribution_strategy
schemas/2026-04-24/schema.yaml get /plan_configurations/{public_id}/contribution_strategy
Retrieves the contribution strategy for a given plan configuration.
# Define Contribution Strategy
Source: https://docs.withclasp.com/api-reference/plan_configurations/2026-04-24/post-plan-configurations-contribution_strategy
schemas/2026-04-24/schema.yaml post /plan_configurations/{public_id}/contribution_strategy
Defines a contribution strategy for a given plan configuration.
# Retrieve Plan Configuration
Source: https://docs.withclasp.com/api-reference/plan_configurations/get-plan-configurations
schemas/2023-08-25/schema.yaml get /plan_configurations/{public_id}
Retrieves details for a single plan configuration.
# List Plan Configurations
Source: https://docs.withclasp.com/api-reference/plan_configurations/get-plan-configurations-list
schemas/2023-08-25/schema.yaml get /plan_configurations
Lists all plan configurations under your provider.
# Create Plan Configuration
Source: https://docs.withclasp.com/api-reference/plan_configurations/post-plan-configurations
schemas/2023-08-25/schema.yaml post /plan_configurations
# Retrieve Premiums
Source: https://docs.withclasp.com/api-reference/plans/get-plan-premiums
schemas/2023-08-25/schema.yaml get /plans/{public_id}/premiums
Retrieves the premiums for a given plan.
# List Plans
Source: https://docs.withclasp.com/api-reference/plans/get-plans
schemas/2023-08-25/schema.yaml get /plans
Lists all plans under your provider.
# Retrieve Plan
Source: https://docs.withclasp.com/api-reference/plans/get-plans-1
schemas/2023-08-25/schema.yaml get /plans/{public_id}
Retrieves details for a single plan.
# Update Plan
Source: https://docs.withclasp.com/api-reference/plans/patch-plans
schemas/2023-08-25/schema.yaml patch /plans/{public_id}
Updates a plan's details.
# Define Premiums
Source: https://docs.withclasp.com/api-reference/plans/post-plan-premiums
schemas/2023-08-25/schema.yaml post /plans/{public_id}/premiums
Defines premiums for a given plan. A plan will have multiple premiums with different criteria. For example a simple 'composite' plan will have 5 premiums defining an 'amount' for each coverage type.
# Create Plan
Source: https://docs.withclasp.com/api-reference/plans/post-plans
schemas/2023-08-25/schema.yaml post /plans
# Calculate Age Banded Table
Source: https://docs.withclasp.com/api-reference/premiums/post-age-banded-table
schemas/2023-08-25/schema.yaml post /premiums/age_banded_table
Calculates a sample age-banded table for a given 21-year-old rate. Many small group medical plans follow a similar age curve. Responds with a full list of premiums that can be passed to the /plans/{public_id}/premiums endpoint.
# Enrollment Census
Source: https://docs.withclasp.com/api-reference/reports/enrollment_census
schemas/2023-08-25/schema.yaml get /employers/{public_id}/reports/enrollment_census
Generates a report containing demographic and election information for employees and their dependents.
# Member Census
Source: https://docs.withclasp.com/api-reference/reports/member_census
schemas/2023-08-25/schema.yaml get /employers/{public_id}/reports/member_census
Generates a report containing a full list of employee demographic information
# Payroll Deductions
Source: https://docs.withclasp.com/api-reference/reports/payroll_deductions
schemas/2023-08-25/schema.yaml get /employers/{public_id}/reports/payroll_deductions
Generates a payroll deduction report for all of the group’s active plans.
# Delete Subclass
Source: https://docs.withclasp.com/api-reference/subclasses/delete-subclass
schemas/2023-08-25/schema.yaml delete /subclasses/{public_id}
Permanently deletes the defined subclass.
# List Subclasses
Source: https://docs.withclasp.com/api-reference/subclasses/get-subclass
schemas/2023-08-25/schema.yaml get /subclasses
Lists all subclasses under your provider.
# Retrieve Subclass
Source: https://docs.withclasp.com/api-reference/subclasses/get-subclass-1
schemas/2023-08-25/schema.yaml get /subclasses/{public_id}
Retrieves the details of a single subclass.
# Update Subclass
Source: https://docs.withclasp.com/api-reference/subclasses/patch-subclass
schemas/2023-08-25/schema.yaml patch /subclasses/{public_id}
Updates the subclass details.
# Create Subclass
Source: https://docs.withclasp.com/api-reference/subclasses/post-subclass
schemas/2023-08-25/schema.yaml post /subclasses
Defines the details of a subclass.
# Delete Task
Source: https://docs.withclasp.com/api-reference/tasks/delete-tasks
schemas/2023-08-25/schema.yaml delete /tasks/{public_id}
Permanently deletes a task.
# List Tasks
Source: https://docs.withclasp.com/api-reference/tasks/get-tasks
schemas/2023-08-25/schema.yaml get /tasks
Lists all tasks for a given provider. Use the completed query parameter to filter between outstanding and completed tasks.
# Retrieve Task
Source: https://docs.withclasp.com/api-reference/tasks/get-tasks-1
schemas/2023-08-25/schema.yaml get /tasks/{public_id}
Retrieves the details of a single task.
# Update Task
Source: https://docs.withclasp.com/api-reference/tasks/patch-tasks
schemas/2023-08-25/schema.yaml patch /tasks/{public_id}
Updates a task. Most commonly used to update the completed_at field when the task is complete.
# Create Task
Source: https://docs.withclasp.com/api-reference/tasks/post-tasks
schemas/2023-08-25/schema.yaml post /tasks
Defines a task in Clasp. Tasks are usually created automatically based on events that occur (e.g., QLE, new hire, etc).
# Authentication
Source: https://docs.withclasp.com/guides/authentication
To ensure secure access, all API requests must be authenticated. Follow the steps below to authenticate your requests:
1. Obtain an API Key: Before making requests, obtain your sandbox or live API key. This key uniquely identifies you as a user and grants access to the API features.
2. Include an Authorization Header: With your API key, authenticate each request by including an Authorization header. Use the Bearer token type for authentication.
3. Format Your Request: Your request should include the Authorization header as follows, replacing YOUR\_API\_KEY with the actual key you obtained:
```
Authorization: Bearer YOUR_API_KEY
```
Ensure that you replace YOUR\_API\_KEY with your actual sandbox or live API key. Using this method, your requests are authenticated, allowing you to securely access the API functionalities.
# Error Handling
Source: https://docs.withclasp.com/guides/error_handling
Clasp utilizes standard HTTP response codes to succinctly communicate the status of API requests. The codes are categorized to reflect the nature of the response:
* `2xx` Range: Indicates success. The request was successfully received, understood, and accepted.
* `4xx` Range: Signifies client errors. These codes point to issues with the request made by the client.
* `5xx` Range: Represents server errors. These are errors on Clasp's side, and we strive to resolve them promptly.
### Error Schema
Errors returned by Clasp follow a structured format to aid in understanding and resolution:
* `type` (string): Identifies the error type.
* `message` (string): Provides a detailed description of the error and suggestions for resolution.
* `input_errors` (list): An optional list that, if applicable, includes objects detailing errors related to specific input fields. Each object contains:
* `field` (string): The field associated with the error.
* `field_path` (string): The hierarchical path to the erroneous field.
* `message` (string): Explanation of the error related to the field.
#### Example Error Response
In cases where an API request fails due to specific input errors, Clasp returns a detailed JSON error response. For instance, attempting to update a resource with incomplete data might yield the following error:
```json theme={null}
{
"type": "validation_error",
"message": "Invalid data passed for fields",
"input_errors": [
{
"message": "This field is required.",
"field": "member",
"field_path": ["dependents", "0", "member"]
}
]
}
```
# Component Page Navigation
Source: https://docs.withclasp.com/guides/navigation
Learn to customize Clasp's navigation
Internal navigation in the Clasp component can be handled in a few ways. Depending on where and what parts of the Component you want to surface to your users, this guide will walk you through how to achieve them.
## 1) Query Parameter
The benefit of using a query param is that it leverages the browser history allowing native navigation
## 2) State Based
You can also treat the clasp-components as a controlled component by passing a `claspState` variable and an `onChangeState` function to listen for page state changes.
It's best to opt for the Query Parameter option to leverage the browser's native navigation system.
# External Clasp Navigation
There's a few parts within the enrollment flow where clasp passes control of navigation back to the client
It can be done in two ways
## 1) String
you can pass a string to easily navigate back to the desired page
```tsx theme={null}
export const BenefitsPage = () => {
const navigate = useNavigate();
const clasp_config: ClaspConfig = {
...
links: {
home: "/"
}
}
return (
...
)
}
```
## 2) Function
You can pass a function that can integrate with your routing system
The benefit of passing a function instead of a string is to preserve the SPA feeling
The following example uses react-router
```tsx theme={null}
export const BenefitsPage = () => {
const navigate = useNavigate();
const clasp_config: ClaspConfig = {
...
links: {
home: () => {
navigate("/")
}
}
}
return (
...
)
}
```
# Notifications
Source: https://docs.withclasp.com/guides/notifications
Notifications represent important business events that should typically result in communications to a member, broker, or employer. For example, a new hire becoming eligible for benefits or a member submitting an enrollment will both create Notification objects in Clasp. The Notifications API lets you stay in the loop so that you are able to control communications via your own channels and templates instead of having Clasp send them.
## Overview
When an important business event occurs, such as a new hire becoming eligible for benefits, Clasp creates a notification object. If the notification is "Clasp managed", Clasp will immediately send an email. Otherwise, Clasp will only emit a webhook informing you of the new Notification and will not send an email. Please reach out to Clasp to configure which notification types are Clasp managed vs Partner managed.
## Notification Object
Each notification has the following structure:
```json theme={null}
{
"id": "noti_8Ln4MbSf5uLFurmAOfNr9",
"notification_type": "welcome",
"related_object_type": "member",
"related_object_id": "mem_kBRoHxraaHbXO9K4JXIRP",
"payload": {
"first_name": "John",
"employer_name": "ABC Company"
},
"owner": "partner",
"created_at": "2025-01-06T05:41:19.093833Z"
}
```
### Field Descriptions
* `id`: Unique identifier for the notification
* `notification_type`: Which type of notification this is. For example, `welcome` is created for new hires and `enrollment_submitted` after a member submits their enrollment
* `related_object_type`: The type of object this notification is about (e.g. `member`, `enrollment`, `open_enrollment_window`)
* `related_object_id`: ID of the object this notification is about
* `payload`: Commonly used information for notifications of this type that can be populated into your communications
* `owner`: Who is responsible for delivering this notification (`partner` or `clasp`)
* `created_at`: Timestamp when the notification was created
### Notification Types
| Notification Type | Created When | Related Object Type |
| -------------------------- | ---------------------------------------------------- | ------------------------ |
| `welcome` | A new hire should be welcomed and invited to enroll | `member` |
| `newly_eligible` | A member becomes eligible for benefits | `member` |
| `member_terminated` | A member is terminated | `member` |
| `dependent_age_out` | A member's dependent is about to age out of coverage | `member` |
| `enrollment_submitted` | A member submits their enrollment | `enrollment` |
| `enrollment_approved` | A member's enrollment is approved | `enrollment` |
| `open_enrollment_kickoff` | An open enrollment window opens | `open_enrollment_window` |
| `open_enrollment_reminder` | A member has not yet completed open enrollment | `open_enrollment_window` |
New notification types will be added over time.
## Receiving Notifications via Webhooks
Notifications work together with [webhooks](/guides/webhooks). When a notification is created, Clasp sends a webhook event with `object_type` set to `notification` and the notification's ID:
```json theme={null}
{
"id": "evnt_8Ln4MbSf5uLFurmAOfNr9",
"event_type": "created",
"object_id": "noti_8Ln4MbSf5uLFurmAOfNr9",
"object_type": "notification",
"employer": "er_67Al5UIOFMPsrHbLI8YnU",
"created_at": "2025-01-06T05:41:19.093833Z"
}
```
When you receive this event:
1. Fetch the notification content with `GET /notifications/{object_id}`
2. Check the `owner` field. If the owner is `clasp`, Clasp will have initiated an email already.
3. Leverage the `notification_type`, `related_object_type`, and `related_object_id` to identify what type of communications are required and for whom.
4. Use the `payload` for notification specific data that is snapshotted at the time of the notification being created.
See the [Webhooks guide](/guides/webhooks) for details on configuring your endpoint and verifying event signatures.
# Pagination
Source: https://docs.withclasp.com/guides/pagination
At Clasp, we prioritize efficient data retrieval and manageable response sizes. To achieve this, responses that return lists of objects are paginated. This approach breaks a large dataset into smaller, more manageable chunks called pages, facilitating easier navigation through the data.
#### Understanding Paginated Responses
Endpoints returning lists are designed to provide responses in pages, each containing a maximum of 25 objects by default. However, Clasp allows customization of page size up to a maximum of 100 objects. A typical paginated response includes:
* `next`: URL pointing to the next page of results (or null if no further pages are available).
* `previous`: URL pointing to the previous page of results (or null if this is the first page).
* `results`: The data objects for the current page.
```json theme={null}
{
"next": "string | null",
"previous": "string | null",
"results": [array of objects]
}
```
#### Navigating Through Pages
To navigate through paginated data, follow the URLs provided in the next and previous fields of the response. For instance, to retrieve all entities from a paginated list, start with the initial GET request. The response will include the first page of data along with a next URL for accessing the subsequent page.
Here’s an example of accessing the first page of a list:
```json theme={null}
{
"next": "https://sandbox.withclasp.com/members?cursor=cD0yMDI0LTAy"
}
```
To proceed to the next page, make a GET request using the URL in the next field. If you reach a page where next is null, you've accessed all available data.
#### Customizing Page Size
You can adjust the number of objects returned in each page through the limit query parameter, with valid values ranging from 1 to 100. If not specified, the default page size is 25.
```
https://sandbox.withclasp.com/members?page_size=100
```
This flexibility in page size allows for optimized data retrieval tailored to your application's needs, ensuring both efficiency and scalability when accessing Clasp's API resources.
# Rate Limiting
Source: https://docs.withclasp.com/guides/rate_limiting
To ensure a fair and reliable usage of the Clasp API, we enforce a rate limiting policy. This policy helps protect against excessive requests that could affect service quality.
#### Standard Throttling
Requests Limit: Partners are allowed up to 25 requests per second across all their API keys.
Concurrency Limit: A maximum of 50 concurrent requests per partner is enforced to prevent overload.
#### Handling Limits
When a request exceeds the allowed rate, a `429` HTTP status code is returned, indicating that the request has been throttled. The response provides details on when to retry:
```json theme={null}
{
"type": "throttled",
"message": "Request was throttled. Expected available in 1 second."
}
```
Additionally, the `Retry-After` header offers the exact wait time before the next request attempt, simplifying automated retry logic.
#### Strategies for Managing Limits
Proactive Throttling: Clients should monitor their request frequency to stay within the imposed limits.
Automated Retries: Implementing automatic retries with respect to the `Retry-After` timeframe is recommended for handling `429` responses efficiently.
#### Exceeding Limits
In scenarios requiring higher limits (e.g., bulk operations), partners should contact Clasp developer support to discuss a limit increase. Our goal is to accommodate valid use cases while maintaining system integrity and performance.
This rate limiting policy aims to protect both Clasp and its partners from potential issues arising from excessive API calls, ensuring a stable and responsive service for all users.
# Component Styling
Source: https://docs.withclasp.com/guides/styling
Clasp gives you complete control over the look and feel of the components your embedding
# Theme Object
```ts theme={null}
export interface ColorConfig {
[string]: string[] // 10 different shades of the color specified in the key
}
export interface ClaspTheme {
fontFamily?: string
colors?: ColorConfig
primaryShade?: string
primaryColor?: string
radius?: {
xs: string
sm: string
md: string
lg: string
xl: string
}
fontSizes?: {
xs: string
sm: string
md: string
lg: string
xl: string
}
lineHeights?: {
xs: string
sm: string
md: string
lg: string
xl: string
}
shadows?: {
xs: string
sm: string
md: string
lg: string
xl: string
}
}
```
you can provide a `Partial` to any `ClaspView`. This is the easiest and most consistent way of changing the styling of a clasp component
the most important styles to change are
1. `ClaspTheme.fontFamily` : to align the font family with your application's
# CSS File
```jsx theme={null}
import 'clasp-components/dist/style.css'
import './ClaspStyleOverride.css'
```
if you need more granular management of styles you can create your own css file and override the styles found in the `clasp-components/dist/styles.css`
The best way of finding the style you want to override is to inspect the element in the browser to find the appropriate class name or id
## ClaspStyleOverride.css
```css theme={null}
._button_1a1ab_1{
color: white;
}
```
# Font Family
you can pass any font family to the clasp-components as long as it has been previously imported or is web safe font
# Positioning
the clasp-components views attempt to be unopinionated about positioning, so there is no padding / alignment attached to the views.
As such, wherever you implement a Clasp view you should position it as you want
Here's an example using flex to position the SDK in the middle with a padding of 24px
```css theme={null}
.wrapper {
height: 52px;
display: flex;
justify-content: center;
width: 100%;
padding: 24px;
box-sizing: border-box;
}
```
```jsx theme={null}
import { ClaspEmployerView } from 'clasp-components'
...
export const BenefitsPage = () => {
return (
)
}
```
# Versioning
Source: https://docs.withclasp.com/guides/versioning
Clasp maintains API versions when releasing backwards incompatible changes. Versioning is facilitated by the use of a `Clasp-Version: version_string` request header, which should be included in every request to the Clasp API.
Partners can choose a pinned version, which Clasp will use if requests from that partner do not contain the version header. New partners default to the latest version of the API. If a newer API version than a partner's pinned version is released, and that partner sends a request without the header, the request will be served with a response corresponding to the pinned version of the API. However, if a request contains a version header, that version will take precedence.
Current API Versions:
* `2026-04-24`
* `2023-08-25`
# Webhooks
Source: https://docs.withclasp.com/guides/webhooks
Webhooks are a way to receive real-time updates from Clasp. They allow your application to be notified automatically when certain events occur in Clasp, eliminating the need to continuously poll the API for changes.
## Overview
When an important change happens in your Clasp account (like a member being updated or an employer being created), Clasp generates an event and sends an HTTP POST request to your configured endpoint with details about what changed. Please reach out to Clasp to get started.
## Event Payload
Each event is sent as a JSON payload with the following structure:
```json theme={null}
{
"id": "evnt_8Ln4MbSf5uLFurmAOfNr9",
"event_type": "updated",
"object_id": "er_67Al5UIOFMPsrHbLI8YnU",
"object_type": "employer",
"employer": "er_67Al5UIOFMPsrHbLI8YnU",
"created_at": "2025-01-06T05:41:19.093833Z"
}
```
### Field Descriptions
* `id`: Unique identifier for the event
* `event_type`: The type of change that occurred
* `object_id`: Identifier of the object that changed
* `object_type`: Type of object that changed
* `employer`: Identifier of the employer the object belongs to
* `created_at`: Timestamp when the event occurred
### Supported Events
| Object Types | Event Types |
| -------------------------- | ----------- |
| - `member` | - `created` |
| - `dependent` | - `updated` |
| - `employer` | - `deleted` |
| - `payroll_benefit` | |
| - `open_enrollment_window` | |
| - `enrollment` | |
| - `business_unit` | |
## Security
### Verifying Webhook Signatures
Every webhook request includes two important headers:
1. `Clasp-Event-Timestamp`: When the event was sent
2. `Clasp-Event-Signature`: HMAC signature of the event
To verify the event is legitimate via the signature:
1. Concatenate the event payload with the timestamp: `${payload}.${timestamp}`
2. Create an HMAC SHA-256 digest with the shared secret
3. Compare the calculated signature with `Clasp-Event-Signature`
Here's a Python example of signature verification:
```python theme={null}
import hashlib
import hmac
import json
def verify_event(payload, timestamp, signature, secret):
# Calculate expected signature
message = f"{json.dumps(payload)}.{timestamp}".encode("utf-8")
expected = hmac.new(
secret.encode('utf-8'),
message,
hashlib.sha256
).hexdigest()
# Compare the digests
return hmac.compare_digest(expected, signature)
```
## Best Practices
### 1. Response
* Return a 200 status code as quickly as possible
* Store the event ID to prevent duplicate processing
* New event and object types will be added over time. Ensure a 200 response is returned for all events
* Clasp will retry failed event deliveries up to 10 times when an error response is returned
### 2. Fetching Current Data
* Use the `object_type` and `object_id` to determine which API endpoint to query
* Fetch the current state from the API
# Overview
Source: https://docs.withclasp.com/overview
Building an employee benefits product with Clasp
You can embed health benefits administration directly into your product. Clasp integrates with all the major carriers so your customers can connect their existing plans in just a few clicks. Clasp also integrates with your payroll provider to automatically manage benefits deductions every pay cycle.
## Getting started
Integrate Clasp with just a few lines of code.
The fastest way to get started with Clasp.
Learn more about how to integrate with Clasp's SDK.
## Exploring further
The following guides expand on topics covered in the quickstart guide.
Learn more about embeddable benefits components.
Customize the look and feel of the benefits experience.
# Quickstart Guide
Source: https://docs.withclasp.com/quickstart
Clasp API basics.
## 1. Prerequisites
| What | Why |
| ----------------- | ---------------------------------------------------------------------------------- |
| **Clasp API key** | Used as a Bearer token from your backend to call the API and mint component links. |
Never expose your long‑lived API key in the browser.\
All API calls that use the Bearer key should originate **server‑side**.
## 2. Create an employer
```bash theme={null}
POST /employers
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"legal_name": "Example Legal Name",
"trade_name": "Example Trade Name",
"external_id": "payroll_provider_company_id",
"email": "company@domain.com",
"address": {
"line1": "1600 Pennsylvania Ave",
"city": "Washington",
"state": "DC",
"zip_code": "20500"
}
}
```
The response includes an `id` such as `er_123`. Persist this for future calls.
## 3. Create an employee (members)
```bash theme={null}
POST /members
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"first_name": "Jane",
"last_name": "Doe",
"dob": "1990-05-16",
"ssn": "123456789",
"email": "jane.doe@domain.com",
"employer": "er_123",
"hire_date": "2024-01-08",
"hours_worked": 40,
"pay_frequency": "biweekly"
}
```
Save the returned member `id` (e.g., `mem_456`).
## 4. Create a group structure
```bash theme={null}
POST /groups
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"group_number": "1324234",
"carrier": "carr_xOvpBqHA75scQCtcHNfLS",
"employer": "{{claspEmployerId}}"
}
```
## 5. Create a plan
```bash theme={null}
POST /plans
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"termination_policy": "termination_date",
"waiting_period": "First of Month after 30 Days",
"plan_name": "Platinum HMO",
"plan_type": "hmo",
"line_of_coverage": "medical",
"group": "{{claspGroupId}}",
"premium_type": "composite",
"effective_start": "2025-05-01",
"effective_end": "2026-04-30",
"requires_primary_care_provider": true,
"plan_details": [
{
"label": "Medical Deductible",
"tooltip": "The amount that you must pay before your health plan begins to pay or contribute for any medical services.",
"info_lines": [
"Individual: $1,250",
"Family: $2,500"
]
},
{
"label": "Pharma Deductible",
"tooltip": "The amount that you must pay before your health plan begins to pay or contribute for any prescriptions.",
"info_lines": [
"Individual: $0",
"Family: $0"
]
},
{
"label": "Physician Visit",
"tooltip": "The fixed amount that you will contribute towards physician visits.",
"info_lines": [
"Primary: $35/visit",
"Specialist: $60/visit"
]
},
{
"label": "Out-of-pocket Max",
"tooltip": "The limit on the amount you are obligated to pay during the plan year for any treatment that is covered by your plan.",
"info_lines": [
"Individual: $8,600",
"Family: $17,200"
]
}
],
"composite_rates": {
"member": "395.42",
"member_spouse": "578.40",
"member_child": "530.20",
"member_children": "842.61",
"member_family": "1550.67"
}
}
```
## 6. Define a plan configuration
```bash theme={null}
POST /plan_configurations
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"plan": "{{claspMedicalPlanId}}",
"termination_policy": "termination_date",
"waiting_period": {
"duration": 0,
"period": "day",
"policy": "end_of_waiting_period"
}
}
```
## 7. Set up a contribution strategy for the plan
```bash theme={null}
POST /plan_configurations/{{claspMedicalPlanConfigurationId}}/contribution_strategy
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{
"member": {
"contribution_type": "employer_percentage",
"contribution": "80",
"monthly_min_threshold": "5",
"monthly_max_threshold": "1200"
},
"member_spouse": {
"contribution_type": "employer_percentage",
"contribution": "50",
"monthly_min_thresold": "5",
"monthly_max_threshold": "1200"
},
"member_child": {
"contribution_type": "employer_percentage",
"contribution": "50",
"monthly_min_threshold": "5",
"monthly_max_threshold": "1200"
},
"member_children": {
"contribution_type": "employer_percentage",
"contribution": "30",
"monthly_min_threshold": "5",
"monthly_max_threshold": "1200"
},
"member_family": {
"contribution_type": "employer_percentage",
"contribution": "25",
"monthly_min_threshold": "5",
"monthly_max_threshold": "1200"
}
}
```
## 8. Generate an Employee Component magic link
```bash theme={null}
POST /components/member
Authorization: Bearer $CLASP_API_KEY
Content-Type: application/json
```
```json theme={null}
{ "member": "mem_456" }
```
**Response**
```json theme={null}
{ "url": "https://benefits.withclasp.com/?otp_token=•••" }
```
Congrats! You've just set up your first plan. Open the magic link you just generated to enroll in the plan.
Need help? Ping us at **[support@withclasp.com](mailto:support@withclasp.com)** or your dedicated solutions engineer.
# List Groups
Source: https://docs.withclasp.com/api-reference/groups/get-groups
schemas/2023-08-25/schema.yaml get /groups
# Retrieve Group
Source: https://docs.withclasp.com/api-reference/groups/get-groups-1
schemas/2023-08-25/schema.yaml get /groups/{public_id}
# Update Group
Source: https://docs.withclasp.com/api-reference/groups/patch-groups
schemas/2023-08-25/schema.yaml patch /groups/{public_id}
# Create Group
Source: https://docs.withclasp.com/api-reference/groups/post-groups
schemas/2023-08-25/schema.yaml post /groups
# Reveal SSN
Source: https://docs.withclasp.com/api-reference/members/get-members-reveal_ssn
schemas/2023-08-25/schema.yaml get /members/{public_id}/reveal_ssn
Reveals the unmasked SSN for the given member id.
# Update Member
Source: https://docs.withclasp.com/api-reference/members/patch-members
schemas/2023-08-25/schema.yaml patch /members/{public_id}
Updates a member's details.
# Start Open Enrollment
Source: https://docs.withclasp.com/api-reference/members/post-members-begin_open_enrollment
schemas/2023-08-25/schema.yaml post /members/{public_id}/begin_open_enrollment
Triggers the start of a members open enrollment.
# Create New Hire Enrollment
Source: https://docs.withclasp.com/api-reference/members/post-members-new_hire_enrollment
schemas/2023-08-25/schema.yaml post /members/{public_id}/new_hire_enrollment
# Create Qualifying Life Event
Source: https://docs.withclasp.com/api-reference/members/post-members-qualifying_life_event
schemas/2023-08-25/schema.yaml post /members/{public_id}/qualifying_life_event
Creates a qualified life event (QLE) for a member. This will create an enrollment object that needs to be approved and submitted to the carrier.
# List Notifications
Source: https://docs.withclasp.com/api-reference/notifications/get-notifications
schemas/2023-08-25/schema.yaml get /notifications
Lists notifications. A notification is created when something happens in Clasp that a member, broker, or employer should be told about, such as a new hire becoming eligible or a member submitting their enrollment.
# Retrieve Notification
Source: https://docs.withclasp.com/api-reference/notifications/get-notifications-1
schemas/2023-08-25/schema.yaml get /notifications/{public_id}
Retrieves a single notification by ID.
# List Open Enrollment Windows
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows
schemas/2023-08-25/schema.yaml get /open_enrollment_windows
Lists all open enrollment windows under your provider.
# Retrieve Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-1
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}
Retrieves details for a single open enrollment window.
# Get Change Report
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-change_report
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/change_report
# Get Completed Members
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-completed_members
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/completed_members
# Get Enrollment Census
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-enrollment_census
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/enrollment_census
# Get Incomplete Members
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-incomplete_members
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/incomplete_members
# Get Incomplete Members Report
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/get-open-enrollment-windows-incomplete_members_report
schemas/2023-08-25/schema.yaml get /open_enrollment_windows/{public_id}/incomplete_members_report
# Update Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/patch-open-enrollment-windows
schemas/2023-08-25/schema.yaml patch /open_enrollment_windows/{public_id}
# Create Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows
schemas/2023-08-25/schema.yaml post /open_enrollment_windows
# Activate Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows-activate
schemas/2023-08-25/schema.yaml post /open_enrollment_windows/{public_id}/activate
Activate an open enrollment window, changing its status to active.
# Close Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows-close
schemas/2023-08-25/schema.yaml post /open_enrollment_windows/{public_id}/close
# Complete Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows-complete
schemas/2023-08-25/schema.yaml post /open_enrollment_windows/{public_id}/complete
# Reopen Open Enrollment Window
Source: https://docs.withclasp.com/api-reference/open_enrollment_windows/post-open-enrollment-windows-reopen
schemas/2023-08-25/schema.yaml post /open_enrollment_windows/{public_id}/reopen
# Delete Pay Rate
Source: https://docs.withclasp.com/api-reference/pay_rates/delete-pay_rates
schemas/2023-08-25/schema.yaml delete /pay_rates/{public_id}
Deletes a pay rate
# List Pay Pay Rates
Source: https://docs.withclasp.com/api-reference/pay_rates/get-pay_rates
schemas/2023-08-25/schema.yaml get /pay_rates
List all pay rates that have been created
# Retrieve Pay Rate
Source: https://docs.withclasp.com/api-reference/pay_rates/get-pay_rates-1
schemas/2023-08-25/schema.yaml get /pay_rates/{public_id}
Retrieves details for a single pay rate
# Update Pay Rate
Source: https://docs.withclasp.com/api-reference/pay_rates/patch-pay_rates
schemas/2023-08-25/schema.yaml patch /pay_rates/{public_id}
Update a pay rate. Note: effective_start dates may not be updated to cross existing pay rates.
# Create Pay Rate
Source: https://docs.withclasp.com/api-reference/pay_rates/post-pay_rates
schemas/2023-08-25/schema.yaml post /pay_rates
Defines a pay rate in Clasp. Pay rates define the annual salary/hourly wage for a given Member. Note: New pay rates must be created with an effective_start date later than all existing pay_rates
# List Payroll Benefits
Source: https://docs.withclasp.com/api-reference/payroll_benefits/get-payroll_benefits
schemas/2023-08-25/schema.yaml get /payroll_benefits
Returns a list of all payroll benefit deductions.
# Retrieve Payroll Benefit
Source: https://docs.withclasp.com/api-reference/payroll_benefits/get-payroll_benefits-1
schemas/2023-08-25/schema.yaml get /payroll_benefits/{public_id}
Retrieves a single payroll benefit deduction.
# Update Payroll Benefit
Source: https://docs.withclasp.com/api-reference/payroll_benefits/patch-payroll_benefits
schemas/2023-08-25/schema.yaml patch /payroll_benefits/{public_id}
Updates a single payroll benefit deduction. Commonly used to link benefits between Clasp and the payroll provider.
# List Payroll Payments
Source: https://docs.withclasp.com/api-reference/payroll_payments/get-payroll_payments
schemas/2023-08-25/schema.yaml get /payroll_payments
Returns a list of all payroll payments.
# Retrieve Payroll Payment
Source: https://docs.withclasp.com/api-reference/payroll_payments/get-payroll_payments-1
schemas/2023-08-25/schema.yaml get /payroll_payments/{public_id}
# Create Payroll Payment
Source: https://docs.withclasp.com/api-reference/payroll_payments/post-payroll_payments
schemas/2023-08-25/schema.yaml post /payroll_payments
Creates a payroll payment to represent a paid paycheck for a given member to feed into ACA calculations.
# Retrieve Plan Configuration
Source: https://docs.withclasp.com/api-reference/plan_configurations/get-plan-configurations
schemas/2023-08-25/schema.yaml get /plan_configurations/{public_id}
Retrieves details for a single plan configuration.
# List Plan Configurations
Source: https://docs.withclasp.com/api-reference/plan_configurations/get-plan-configurations-list
schemas/2023-08-25/schema.yaml get /plan_configurations
Lists all plan configurations under your provider.
# Create Plan Configuration
Source: https://docs.withclasp.com/api-reference/plan_configurations/post-plan-configurations
schemas/2023-08-25/schema.yaml post /plan_configurations
# Retrieve Premiums
Source: https://docs.withclasp.com/api-reference/plans/get-plan-premiums
schemas/2023-08-25/schema.yaml get /plans/{public_id}/premiums
Retrieves the premiums for a given plan.
# List Plans
Source: https://docs.withclasp.com/api-reference/plans/get-plans
schemas/2023-08-25/schema.yaml get /plans
Lists all plans under your provider.
# Retrieve Plan
Source: https://docs.withclasp.com/api-reference/plans/get-plans-1
schemas/2023-08-25/schema.yaml get /plans/{public_id}
Retrieves details for a single plan.
# Update Plan
Source: https://docs.withclasp.com/api-reference/plans/patch-plans
schemas/2023-08-25/schema.yaml patch /plans/{public_id}
Updates a plan's details.
# Define Premiums
Source: https://docs.withclasp.com/api-reference/plans/post-plan-premiums
schemas/2023-08-25/schema.yaml post /plans/{public_id}/premiums
Defines premiums for a given plan. A plan will have multiple premiums with different criteria. For example a simple 'composite' plan will have 5 premiums defining an 'amount' for each coverage type.
# Create Plan
Source: https://docs.withclasp.com/api-reference/plans/post-plans
schemas/2023-08-25/schema.yaml post /plans
# Calculate Age Banded Table
Source: https://docs.withclasp.com/api-reference/premiums/post-age-banded-table
schemas/2023-08-25/schema.yaml post /premiums/age_banded_table
Calculates a sample age-banded table for a given 21-year-old rate. Many small group medical plans follow a similar age curve. Responds with a full list of premiums that can be passed to the /plans/{public_id}/premiums endpoint.
# Enrollment Census
Source: https://docs.withclasp.com/api-reference/reports/enrollment_census
schemas/2023-08-25/schema.yaml get /employers/{public_id}/reports/enrollment_census
Generates a report containing demographic and election information for employees and their dependents.
# Member Census
Source: https://docs.withclasp.com/api-reference/reports/member_census
schemas/2023-08-25/schema.yaml get /employers/{public_id}/reports/member_census
Generates a report containing a full list of employee demographic information
# Payroll Deductions
Source: https://docs.withclasp.com/api-reference/reports/payroll_deductions
schemas/2023-08-25/schema.yaml get /employers/{public_id}/reports/payroll_deductions
Generates a payroll deduction report for all of the group’s active plans.
# Delete Subclass
Source: https://docs.withclasp.com/api-reference/subclasses/delete-subclass
schemas/2023-08-25/schema.yaml delete /subclasses/{public_id}
Permanently deletes the defined subclass.
# List Subclasses
Source: https://docs.withclasp.com/api-reference/subclasses/get-subclass
schemas/2023-08-25/schema.yaml get /subclasses
Lists all subclasses under your provider.
# Retrieve Subclass
Source: https://docs.withclasp.com/api-reference/subclasses/get-subclass-1
schemas/2023-08-25/schema.yaml get /subclasses/{public_id}
Retrieves the details of a single subclass.
# Update Subclass
Source: https://docs.withclasp.com/api-reference/subclasses/patch-subclass
schemas/2023-08-25/schema.yaml patch /subclasses/{public_id}
Updates the subclass details.
# Create Subclass
Source: https://docs.withclasp.com/api-reference/subclasses/post-subclass
schemas/2023-08-25/schema.yaml post /subclasses
Defines the details of a subclass.
# Delete Task
Source: https://docs.withclasp.com/api-reference/tasks/delete-tasks
schemas/2023-08-25/schema.yaml delete /tasks/{public_id}
Permanently deletes a task.
# List Tasks
Source: https://docs.withclasp.com/api-reference/tasks/get-tasks
schemas/2023-08-25/schema.yaml get /tasks
Lists all tasks for a given provider. Use the completed query parameter to filter between outstanding and completed tasks.
# Retrieve Task
Source: https://docs.withclasp.com/api-reference/tasks/get-tasks-1
schemas/2023-08-25/schema.yaml get /tasks/{public_id}
Retrieves the details of a single task.
# Update Task
Source: https://docs.withclasp.com/api-reference/tasks/patch-tasks
schemas/2023-08-25/schema.yaml patch /tasks/{public_id}
Updates a task. Most commonly used to update the completed_at field when the task is complete.
# Create Task
Source: https://docs.withclasp.com/api-reference/tasks/post-tasks
schemas/2023-08-25/schema.yaml post /tasks
Defines a task in Clasp. Tasks are usually created automatically based on events that occur (e.g., QLE, new hire, etc).