SDK reference
Interfaces
Section titled “Interfaces”LexOptiClient
Section titled “LexOptiClient”The client: one method per operation, grouped by resource
(lexopti.clients.create, lexopti.checks.get…), typed from the API
contract. An interface, so that it is named wherever it appears.
Extends
Section titled “Extends”JsonifiedClient<ContractRouterClient<typeofpublicContract>>
Properties
Section titled “Properties”alerts
Section titled “alerts”alerts: object;get: Client<Record<never, never>, { id: string;}, { case_id: string | null; change: string | null; client_id: string; created_at: string; detail: string | null; entity_id: string; id: string; level: "simplified" | "standard" | "enhanced"; review_notes: string | null; reviewed_at: string | null; source: | "international_sanctions" | "eu_sanctions" | "french_asset_freezes" | "politically_exposed_persons" | "high_risk_countries" | "bodacc_announcements" | "bodacc_insolvency" | "company_register" | "adverse_media" | null; source_name: string; status: "pending" | "reviewed" | "dismissed" | "confirmed"; subject: string | null; url: string | null;}, Error>;list: Client<Record<never, never>, { client_id?: string; client_ids?: string; cursor?: string; limit?: number; status?: "pending" | "reviewed" | "dismissed" | "confirmed";}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;update
Section titled “update”update: Client<Record<never, never>, { id: string; notes?: string; status: "reviewed" | "dismissed" | "confirmed";}, { case_id: string | null; change: string | null; client_id: string; created_at: string; detail: string | null; entity_id: string; id: string; level: "simplified" | "standard" | "enhanced"; review_notes: string | null; reviewed_at: string | null; source: | "international_sanctions" | "eu_sanctions" | "french_asset_freezes" | "politically_exposed_persons" | "high_risk_countries" | "bodacc_announcements" | "bodacc_insolvency" | "company_register" | "adverse_media" | null; source_name: string; status: "pending" | "reviewed" | "dismissed" | "confirmed"; subject: string | null; url: string | null;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.alerts
cases: object;create
Section titled “create”create: Client<Record<never, never>, { clients: object[]; external_ref?: string; label?: string; launch_checks?: boolean; parties?: ( | { address?: { city?: string; country?: string; line?: string; postal_code?: string; }; external_ref?: string; person: { birth_city?: string; birth_country?: string; birth_date?: string; first_name: string; last_name: string; nationalities?: string[]; usage_name?: string; }; role: | "demandeur" | "defendeur" | "appelant" | "intime" | "intervenant" | "partie_adverse" | "vendeur" | "acquereur" | "cedant" | "cessionnaire" | "contrepartie" | "bailleur" | "locataire" | "preteur" | "emprunteur" | "caution" | "tiers_payeur" | "donateur" | "donataire" | "heritier_legataire" | "mandant" | "mandataire" | "representant_legal" | "intermediaire" | "associe" | "constituant" | "fiduciaire" | "beneficiaire" | "tiers" | "autre"; type: "person"; } | { address?: { city?: string; country?: string; line?: string; postal_code?: string; }; company: { legal_form?: string; name: string; rcs?: string; registration_country?: string; siren?: string; siret?: string; }; external_ref?: string; role: | "demandeur" | "defendeur" | "appelant" | "intime" | "intervenant" | "partie_adverse" | "vendeur" | "acquereur" | "cedant" | "cessionnaire" | "contrepartie" | "bailleur" | "locataire" | "preteur" | "emprunteur" | "caution" | "tiers_payeur" | "donateur" | "donataire" | "heritier_legataire" | "mandant" | "mandataire" | "representant_legal" | "intermediaire" | "associe" | "constituant" | "fiduciaire" | "beneficiaire" | "tiers" | "autre"; type: "company"; })[]; type_label?: string; types: string[];}, { analyses_launched: boolean; classification_state: "to_complete" | "in_progress" | "validated" | "revalidate"; client_id: string | null; client_ids: string[]; clients: object[]; created_at: string; credits_charged: number; external_ref: string | null; has_pending_alert: boolean; id: string; label: string | null; monitoring_enabled: boolean; parties: object[]; pending_alert_count: number; risk_level: "simplified" | "standard" | "enhanced" | null; status: "pending" | "completed" | "failed" | "running"; transaction_amount: string | null; type: string | null; type_label: string | null; types: string[]; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;deleteExternalRef
Section titled “deleteExternalRef”deleteExternalRef: Client<Record<never, never>, { id: string;}, { classification_state: "to_complete" | "in_progress" | "validated" | "revalidate"; client_id: string | null; client_ids: string[]; clients: object[]; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; label: string | null; monitoring_enabled: boolean; parties: object[]; pending_alert_count: number; risk_level: "simplified" | "standard" | "enhanced" | null; status: "pending" | "completed" | "failed" | "running"; transaction_amount: string | null; type: string | null; type_label: string | null; types: string[]; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;deletePartyExternalRef
Section titled “deletePartyExternalRef”deletePartyExternalRef: Client<Record<never, never>, { id: string; party_id: string;}, { classification_state: "to_complete" | "in_progress" | "validated" | "revalidate"; client_id: string | null; client_ids: string[]; clients: object[]; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; label: string | null; monitoring_enabled: boolean; parties: object[]; pending_alert_count: number; risk_level: "simplified" | "standard" | "enhanced" | null; status: "pending" | "completed" | "failed" | "running"; transaction_amount: string | null; type: string | null; type_label: string | null; types: string[]; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;get: Client<Record<never, never>, { id: string;}, { classification_state: "to_complete" | "in_progress" | "validated" | "revalidate"; client_id: string | null; client_ids: string[]; clients: object[]; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; label: string | null; monitoring_enabled: boolean; parties: object[]; pending_alert_count: number; risk_level: "simplified" | "standard" | "enhanced" | null; status: "pending" | "completed" | "failed" | "running"; transaction_amount: string | null; type: string | null; type_label: string | null; types: string[]; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;getClassification
Section titled “getClassification”getClassification: Client<Record<never, never>, { id: string;}, { answers: object[]; case_id: string | null; client_id: string | null; excluded_axes: "axe5"[]; level: "simplified" | "standard" | "enhanced" | null; missing_answers: { count: number; question_ids: string[]; }; policy: { id: string; version: number; }; score: number | null; state: "to_complete" | "in_progress" | "validated" | "revalidate"; subject: "client" | "case"; validated_at: string | null; validated_by: | { channel: "app" | "embed" | "api" | "mcp" | null; user_id: string | null; } | null;}, Error>;getReport
Section titled “getReport”getReport: Client<Record<never, never>, { id: string;}, { case_id: string; content_type: "application/pdf"; download_url: string; excluded_axes: "axe5"[]; expires_at: string; generated_at: string; language: "fr" | "en"; sha256: string; version: string;}, Error>;launchChecks
Section titled “launchChecks”launchChecks: Client<Record<never, never>, { id: string;}, { checks: object[]; classification_state: "to_complete" | "in_progress" | "validated" | "revalidate"; client_id: string | null; client_ids: string[]; clients: object[]; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; label: string | null; monitoring_enabled: boolean; parties: object[]; pending_alert_count: number; risk_level: "simplified" | "standard" | "enhanced" | null; status: "pending" | "completed" | "failed" | "running"; transaction_amount: string | null; type: string | null; type_label: string | null; types: string[]; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;list: Client<Record<never, never>, { client_id?: string; cursor?: string; external_ref?: string; ids?: string; limit?: number; party_external_ref?: string;}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;listDocuments
Section titled “listDocuments”listDocuments: Client<Record<never, never>, { cursor?: string; id: string; limit?: number;}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;preview
Section titled “preview”preview: Client<Record<never, never>, { clients: object[]; external_ref?: string; label?: string; launch_checks?: boolean; parties?: ( | { address?: { city?: string; country?: string; line?: string; postal_code?: string; }; external_ref?: string; person: { birth_city?: string; birth_country?: string; birth_date?: string; first_name: string; last_name: string; nationalities?: string[]; usage_name?: string; }; role: | "demandeur" | "defendeur" | "appelant" | "intime" | "intervenant" | "partie_adverse" | "vendeur" | "acquereur" | "cedant" | "cessionnaire" | "contrepartie" | "bailleur" | "locataire" | "preteur" | "emprunteur" | "caution" | "tiers_payeur" | "donateur" | "donataire" | "heritier_legataire" | "mandant" | "mandataire" | "representant_legal" | "intermediaire" | "associe" | "constituant" | "fiduciaire" | "beneficiaire" | "tiers" | "autre"; type: "person"; } | { address?: { city?: string; country?: string; line?: string; postal_code?: string; }; company: { legal_form?: string; name: string; rcs?: string; registration_country?: string; siren?: string; siret?: string; }; external_ref?: string; role: | "demandeur" | "defendeur" | "appelant" | "intime" | "intervenant" | "partie_adverse" | "vendeur" | "acquereur" | "cedant" | "cessionnaire" | "contrepartie" | "bailleur" | "locataire" | "preteur" | "emprunteur" | "caution" | "tiers_payeur" | "donateur" | "donataire" | "heritier_legataire" | "mandant" | "mandataire" | "representant_legal" | "intermediaire" | "associe" | "constituant" | "fiduciaire" | "beneficiaire" | "tiers" | "autre"; type: "company"; })[]; type_label?: string; types: string[];}, { credits: { balance: number; needed: number; }; entities: number; livemode: boolean; sufficient_credits: boolean; tranches: number;}, Error>;setExternalRef
Section titled “setExternalRef”setExternalRef: Client<Record<never, never>, { external_ref: string; id: string;}, { classification_state: "to_complete" | "in_progress" | "validated" | "revalidate"; client_id: string | null; client_ids: string[]; clients: object[]; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; label: string | null; monitoring_enabled: boolean; parties: object[]; pending_alert_count: number; risk_level: "simplified" | "standard" | "enhanced" | null; status: "pending" | "completed" | "failed" | "running"; transaction_amount: string | null; type: string | null; type_label: string | null; types: string[]; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;setPartyExternalRef
Section titled “setPartyExternalRef”setPartyExternalRef: Client<Record<never, never>, { external_ref: string; id: string; party_id: string;}, { classification_state: "to_complete" | "in_progress" | "validated" | "revalidate"; client_id: string | null; client_ids: string[]; clients: object[]; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; label: string | null; monitoring_enabled: boolean; parties: object[]; pending_alert_count: number; risk_level: "simplified" | "standard" | "enhanced" | null; status: "pending" | "completed" | "failed" | "running"; transaction_amount: string | null; type: string | null; type_label: string | null; types: string[]; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.cases
checks
Section titled “checks”checks: object;create
Section titled “create”create: Client<Record<never, never>, { case_id?: string; client_id: string;}, { client_id: string; completed_at: string | null; created_at: string; id: string; sources: object[]; status: "completed" | "failed" | "running";}, Error>;get: Client<Record<never, never>, { id: string;}, { client_id: string; completed_at: string | null; created_at: string; id: string; sources: object[]; status: "completed" | "failed" | "running";}, Error>;list: Client<Record<never, never>, { client_id?: string; cursor?: string; limit?: number;}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.checks
clients
Section titled “clients”clients: object;create
Section titled “create”create: Client<Record<never, never>, | { address?: { city?: string; country?: string; line?: string; postal_code?: string; }; external_ref?: string; person: { birth_city?: string; birth_country?: string; birth_date?: string; first_name: string; last_name: string; nationalities?: string[]; usage_name?: string; }; type: "person";} | { address?: { city?: string; country?: string; line?: string; postal_code?: string; }; company: { legal_form?: string; name: string; rcs?: string; registration_country?: string; siren?: string; siret?: string; }; external_ref?: string; type: "company";}, { address: { city: string | null; country: string | null; line: string | null; postal_code: string | null; }; cases?: { data: object[]; has_more: boolean; }; classification_state?: "to_complete" | "in_progress" | "validated" | "revalidate"; company: | { legal_form: string | null; name: string | null; rcs: string | null; registration_country: string | null; siren: string | null; siret: string | null; } | null; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; last_check?: | { completed_at: string | null; created_at: string; id: string; status: "completed" | "failed" | "running"; } | null; monitoring_enabled: boolean; name: string; open_alerts_count?: number; person: | { birth_city: string | null; birth_country: string | null; birth_date: string | null; first_name: string | null; last_name: string | null; nationalities: string[]; usage_name: string | null; } | null; preliminary_screening: | { checked_at: string | null; last_error: string | null; match_count: number | null; outcome: "no_match" | "possible_match" | null; pending: boolean; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; } | null; risk_level: "simplified" | "standard" | "enhanced" | null; type: "person" | "company"; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;deleteExternalRef
Section titled “deleteExternalRef”deleteExternalRef: Client<Record<never, never>, { id: string;}, { address: { city: string | null; country: string | null; line: string | null; postal_code: string | null; }; cases?: { data: object[]; has_more: boolean; }; classification_state?: "to_complete" | "in_progress" | "validated" | "revalidate"; company: | { legal_form: string | null; name: string | null; rcs: string | null; registration_country: string | null; siren: string | null; siret: string | null; } | null; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; last_check?: | { completed_at: string | null; created_at: string; id: string; status: "completed" | "failed" | "running"; } | null; monitoring_enabled: boolean; name: string; open_alerts_count?: number; person: | { birth_city: string | null; birth_country: string | null; birth_date: string | null; first_name: string | null; last_name: string | null; nationalities: string[]; usage_name: string | null; } | null; preliminary_screening: | { checked_at: string | null; last_error: string | null; match_count: number | null; outcome: "no_match" | "possible_match" | null; pending: boolean; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; } | null; risk_level: "simplified" | "standard" | "enhanced" | null; type: "person" | "company"; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;get: Client<Record<never, never>, { expand?: ("cases" | "last_check" | "open_alerts_count" | "classification_state")[]; id: string;}, { address: { city: string | null; country: string | null; line: string | null; postal_code: string | null; }; cases?: { data: object[]; has_more: boolean; }; classification_state?: "to_complete" | "in_progress" | "validated" | "revalidate"; company: | { legal_form: string | null; name: string | null; rcs: string | null; registration_country: string | null; siren: string | null; siret: string | null; } | null; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; last_check?: | { completed_at: string | null; created_at: string; id: string; status: "completed" | "failed" | "running"; } | null; monitoring_enabled: boolean; name: string; open_alerts_count?: number; person: | { birth_city: string | null; birth_country: string | null; birth_date: string | null; first_name: string | null; last_name: string | null; nationalities: string[]; usage_name: string | null; } | null; preliminary_screening: | { checked_at: string | null; last_error: string | null; match_count: number | null; outcome: "no_match" | "possible_match" | null; pending: boolean; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; } | null; risk_level: "simplified" | "standard" | "enhanced" | null; type: "person" | "company"; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;getClassification
Section titled “getClassification”getClassification: Client<Record<never, never>, { id: string;}, { answers: object[]; case_id: string | null; client_id: string | null; excluded_axes: "axe5"[]; level: "simplified" | "standard" | "enhanced" | null; missing_answers: { count: number; question_ids: string[]; }; policy: { id: string; version: number; }; score: number | null; state: "to_complete" | "in_progress" | "validated" | "revalidate"; subject: "client" | "case"; validated_at: string | null; validated_by: | { channel: "app" | "embed" | "api" | "mcp" | null; user_id: string | null; } | null;}, Error>;getPreliminaryScreening
Section titled “getPreliminaryScreening”getPreliminaryScreening: Client<Record<never, never>, { id: string;}, { client_id: string; current: | { checked_at: string | null; error_code: string | null; id: string; lists: object[]; matches: object[]; outcome: "no_match" | "possible_match" | null; requested_at: string; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; trigger: "initial" | "identity_change" | "requested" | "list_update"; } | null; latest: { checked_at: string | null; error_code: string | null; id: string; lists: object[]; matches: object[]; outcome: "no_match" | "possible_match" | null; requested_at: string; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; trigger: "initial" | "identity_change" | "requested" | "list_update"; };}, Error>;list: Client<Record<never, never>, { cursor?: string; expand?: ("cases" | "last_check" | "open_alerts_count" | "classification_state")[]; external_ref?: string; ids?: string; limit?: number;}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;requestPreliminaryScreening
Section titled “requestPreliminaryScreening”requestPreliminaryScreening: Client<Record<never, never>, { id: string;}, { client_id: string; current: | { checked_at: string | null; error_code: string | null; id: string; lists: object[]; matches: object[]; outcome: "no_match" | "possible_match" | null; requested_at: string; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; trigger: "initial" | "identity_change" | "requested" | "list_update"; } | null; latest: { checked_at: string | null; error_code: string | null; id: string; lists: object[]; matches: object[]; outcome: "no_match" | "possible_match" | null; requested_at: string; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; trigger: "initial" | "identity_change" | "requested" | "list_update"; };}, Error>;setExternalRef
Section titled “setExternalRef”setExternalRef: Client<Record<never, never>, { external_ref: string; id: string;}, { address: { city: string | null; country: string | null; line: string | null; postal_code: string | null; }; cases?: { data: object[]; has_more: boolean; }; classification_state?: "to_complete" | "in_progress" | "validated" | "revalidate"; company: | { legal_form: string | null; name: string | null; rcs: string | null; registration_country: string | null; siren: string | null; siret: string | null; } | null; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; last_check?: | { completed_at: string | null; created_at: string; id: string; status: "completed" | "failed" | "running"; } | null; monitoring_enabled: boolean; name: string; open_alerts_count?: number; person: | { birth_city: string | null; birth_country: string | null; birth_date: string | null; first_name: string | null; last_name: string | null; nationalities: string[]; usage_name: string | null; } | null; preliminary_screening: | { checked_at: string | null; last_error: string | null; match_count: number | null; outcome: "no_match" | "possible_match" | null; pending: boolean; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; } | null; risk_level: "simplified" | "standard" | "enhanced" | null; type: "person" | "company"; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;update
Section titled “update”update: Client<Record<never, never>, { address?: { city?: string | null; country?: string | null; line?: string | null; postal_code?: string | null; }; company?: { legal_form?: string | null; name?: string; rcs?: string | null; registration_country?: string | null; siren?: string | null; siret?: string | null; }; id: string; person?: { birth_city?: string | null; birth_country?: string | null; birth_date?: string | null; first_name?: string; last_name?: string; nationalities?: string[] | null; usage_name?: string | null; };}, { address: { city: string | null; country: string | null; line: string | null; postal_code: string | null; }; cases?: { data: object[]; has_more: boolean; }; classification_state?: "to_complete" | "in_progress" | "validated" | "revalidate"; company: | { legal_form: string | null; name: string | null; rcs: string | null; registration_country: string | null; siren: string | null; siret: string | null; } | null; created_at: string; external_ref: string | null; has_pending_alert: boolean; id: string; last_check?: | { completed_at: string | null; created_at: string; id: string; status: "completed" | "failed" | "running"; } | null; monitoring_enabled: boolean; name: string; open_alerts_count?: number; person: | { birth_city: string | null; birth_country: string | null; birth_date: string | null; first_name: string | null; last_name: string | null; nationalities: string[]; usage_name: string | null; } | null; preliminary_screening: | { checked_at: string | null; last_error: string | null; match_count: number | null; outcome: "no_match" | "possible_match" | null; pending: boolean; screened_at: string | null; status: "pending" | "completed" | "failed" | "unavailable"; } | null; risk_level: "simplified" | "standard" | "enhanced" | null; type: "person" | "company"; updated_at: string; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.clients
deepLinks
Section titled “deepLinks”deepLinks: object;create
Section titled “create”create: Client<Record<never, never>, { case_id?: string; client_id?: string;}, { expires_at: string; url: string;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.deepLinks
embedSessions
Section titled “embedSessions”embedSessions: object;create
Section titled “create”create: Client<Record<never, never>, { code_challenge: string; code_challenge_method: "S256"; component: | "cases" | "clients" | "client" | "case" | "app" | "new-client" | "new-case" | "classification"; features?: string[]; origin: string;}, { code: string; expires_at: string; integration: string;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.embedSessions
enrolments
Section titled “enrolments”enrolments: object;cancel
Section titled “cancel”cancel: Client<Record<never, never>, { id: string;}, { id: string; status: "cancelled";}, Error>;create
Section titled “create”create: Client<Record<never, never>, { email: string; external_ref?: string; first_name?: string; last_name?: string; locale?: "fr" | "en"; role?: "readonly" | "member";}, { activated_at: string | null; connect_hint: string; created_at: string; email: string; enrolled_by: string | null; expires_at: string; external_ref: string | null; first_name: string | null; id: string; last_name: string | null; member_id: string | null; role: "readonly" | "member"; status: "pending" | "activated" | "expired" | "cancelled";}, Error>;list: Client<Record<never, never>, { cursor?: string; limit?: number; status?: "pending" | "activated" | "expired" | "cancelled";}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.enrolments
events
Section titled “events”events: object;list: Client<Record<never, never>, { after?: string; cursor?: string; limit?: number; type?: | "check.completed" | "check.failed" | "client.created" | "client.updated" | "client.vigilance_level_changed" | "client.risk_level_changed" | "client.preliminary_screening_completed" | "classification.validated" | "case.created" | "case.updated" | "case.risk_level_changed" | "report.generated" | "alert.created" | "alert.resolved" | "decision.pending" | "quota.exhausted" | "subscription.inactive" | "access.revoked" | "member.enrolled" | "member.joined";}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.events
firms: object;create
Section titled “create”create: Client<Record<never, never>, { external_ref?: string; locale?: "fr" | "en"; manager: { email: string; first_name?: string; last_name?: string; }; name: string; profession: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated"; siren: string;}, { activated_at: string | null; claim_url: string | null; claim_url_expires_at: string | null; claimed_at: string | null; created_at: string; expires_at: string; external_ref: string | null; id: string; name: string; organization_id: string | null; profession: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated"; siren: string; status: "pending" | "expired" | "claimed" | "voided";}, Error>;createClaimLink
Section titled “createClaimLink”createClaimLink: Client<Record<never, never>, { id: string;}, { activated_at: string | null; claim_url: string | null; claim_url_expires_at: string | null; claimed_at: string | null; created_at: string; expires_at: string; external_ref: string | null; id: string; name: string; organization_id: string | null; profession: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated"; siren: string; status: "pending" | "expired" | "claimed" | "voided";}, Error>;get: Client<Record<never, never>, { id: string;}, { activated_at: string | null; claim_url: string | null; claim_url_expires_at: string | null; claimed_at: string | null; created_at: string; expires_at: string; external_ref: string | null; id: string; name: string; organization_id: string | null; profession: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated"; siren: string; status: "pending" | "expired" | "claimed" | "voided";}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.firms
members
Section titled “members”members: object;list: Client<Record<never, never>, { cursor?: string; limit?: number;}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.members
organization
Section titled “organization”organization: object;get: Client<Record<never, never>, unknown, { id: string; integration: { client_id: string; delegated_mode: boolean; }; member: { role: string; user_id: string; }; name: string; sandbox: boolean;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.organization
sandboxTriggers
Section titled “sandboxTriggers”sandboxTriggers: object;create
Section titled “create”create: Client<Record<never, never>, { client_id?: string; type: | "vigilance_alert" | "vigilance_level_change" | "quota_exhausted" | "quota_restored" | "access_revoked";}, { client_id: string | null; events: string[]; livemode: false; type: | "vigilance_alert" | "vigilance_level_change" | "quota_exhausted" | "quota_restored" | "access_revoked"; vigilance_level: "simplified" | "standard" | "enhanced" | null;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.sandboxTriggers
usage: object;get: Client<Record<never, never>, unknown, { credits: { balance: number; frozen: number; low_balance_threshold: number; }; dossiers: { active: number; paused: number; renewal_credits: number; renewals_due: number; }; read_only: boolean; subscription_active: boolean; unit: "credit";}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.usage
webhookEndpoints
Section titled “webhookEndpoints”webhookEndpoints: object;create
Section titled “create”create: Client<Record<never, never>, { description?: string; event_types: ( | "check.completed" | "check.failed" | "client.created" | "client.updated" | "client.vigilance_level_changed" | "client.risk_level_changed" | "client.preliminary_screening_completed" | "classification.validated" | "case.created" | "case.updated" | "case.risk_level_changed" | "report.generated" | "alert.created" | "alert.resolved" | "decision.pending" | "quota.exhausted" | "subscription.inactive" | "access.revoked" | "member.enrolled" | "member.joined")[]; url: string;}, { created_at: string; description: string | null; disabled_reason: "member" | "access_revoked" | "failing" | null; event_types: ( | "check.completed" | "check.failed" | "client.created" | "client.updated" | "client.vigilance_level_changed" | "client.risk_level_changed" | "client.preliminary_screening_completed" | "classification.validated" | "case.created" | "case.updated" | "case.risk_level_changed" | "report.generated" | "alert.created" | "alert.resolved" | "decision.pending" | "quota.exhausted" | "subscription.inactive" | "access.revoked" | "member.enrolled" | "member.joined")[]; id: string; secret: string; status: "enabled" | "disabled"; updated_at: string; url: string;}, Error>;delete
Section titled “delete”delete: Client<Record<never, never>, { id: string;}, { deleted: true; id: string;}, Error>;get: Client<Record<never, never>, { id: string;}, { created_at: string; description: string | null; disabled_reason: "member" | "access_revoked" | "failing" | null; event_types: ( | "check.completed" | "check.failed" | "client.created" | "client.updated" | "client.vigilance_level_changed" | "client.risk_level_changed" | "client.preliminary_screening_completed" | "classification.validated" | "case.created" | "case.updated" | "case.risk_level_changed" | "report.generated" | "alert.created" | "alert.resolved" | "decision.pending" | "quota.exhausted" | "subscription.inactive" | "access.revoked" | "member.enrolled" | "member.joined")[]; id: string; status: "enabled" | "disabled"; updated_at: string; url: string;}, Error>;list: Client<Record<never, never>, { cursor?: string; limit?: number;}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;listDeliveries
Section titled “listDeliveries”listDeliveries: Client<Record<never, never>, { cursor?: string; id: string; limit?: number;}, { data: object[]; has_more: boolean; next_cursor: string | null;}, Error>;replayDelivery
Section titled “replayDelivery”replayDelivery: Client<Record<never, never>, { delivery_id: string; id: string;}, { attempts: number; completed_at: string | null; created_at: string; event_id: string | null; id: string; last_attempt_at: string | null; last_error: string | null; last_response_status: number | null; next_attempt_at: string | null; replay_of: string | null; status: "pending" | "failed" | "cancelled" | "succeeded"; type: string;}, Error>;rotateSecret
Section titled “rotateSecret”rotateSecret: Client<Record<never, never>, { id: string;}, { secret: string;}, Error>;test: Client<Record<never, never>, { id: string;}, { attempts: number; completed_at: string | null; created_at: string; event_id: string | null; id: string; last_attempt_at: string | null; last_error: string | null; last_response_status: number | null; next_attempt_at: string | null; replay_of: string | null; status: "pending" | "failed" | "cancelled" | "succeeded"; type: string;}, Error>;update
Section titled “update”update: Client<Record<never, never>, { description?: string | null; enabled?: boolean; event_types?: ( | "check.completed" | "check.failed" | "client.created" | "client.updated" | "client.vigilance_level_changed" | "client.risk_level_changed" | "client.preliminary_screening_completed" | "classification.validated" | "case.created" | "case.updated" | "case.risk_level_changed" | "report.generated" | "alert.created" | "alert.resolved" | "decision.pending" | "quota.exhausted" | "subscription.inactive" | "access.revoked" | "member.enrolled" | "member.joined")[]; id: string; url?: string;}, { created_at: string; description: string | null; disabled_reason: "member" | "access_revoked" | "failing" | null; event_types: ( | "check.completed" | "check.failed" | "client.created" | "client.updated" | "client.vigilance_level_changed" | "client.risk_level_changed" | "client.preliminary_screening_completed" | "classification.validated" | "case.created" | "case.updated" | "case.risk_level_changed" | "report.generated" | "alert.created" | "alert.resolved" | "decision.pending" | "quota.exhausted" | "subscription.inactive" | "access.revoked" | "member.enrolled" | "member.joined")[]; id: string; status: "enabled" | "disabled"; updated_at: string; url: string;}, Error>;Inherited from
Section titled “Inherited from”JsonifiedClient.webhookEndpoints
LexOptiClientOptions
Section titled “LexOptiClientOptions”Properties
Section titled “Properties”accessToken
Section titled “accessToken”accessToken: () => string | Promise<string>;Returns the OAuth access token for each request: refresh it there when it expires (access tokens live 15 minutes).
Returns
Section titled “Returns”string | Promise<string>
baseUrl?
Section titled “baseUrl?”baseUrl?: string;https://app.lexopti.com/v1 unless given (sandbox, tests).
fetch?
Section titled “fetch?”fetch?: (request) => Promise<Response>;Replaces the global fetch (tests, proxies).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request |
Request |
Returns
Section titled “Returns”Promise<Response>
locale?
Section titled “locale?”locale?: "fr" | "en";fr for French service messages; English otherwise.
maxRetries?
Section titled “maxRetries?”maxRetries?: number;Retries of a failed request, 2 by default. Reads, deletions and
idempotent POSTs run again after a network error, a 429 or a 500, 502,
503 or 504; any other operation only after a 429 with Retry-After.
maxRetryWait?
Section titled “maxRetryWait?”maxRetryWait?: number;The longest Retry-After the client waits, in milliseconds (60 000 by
default): an answer asking for longer is handed back to the caller
rather than retried early.
sleep?
Section titled “sleep?”sleep?: (milliseconds) => Promise<void>;Waits between retries; replaceable in tests.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
milliseconds |
number |
Returns
Section titled “Returns”Promise<void>
Type Aliases
Section titled “Type Aliases”PartnerHint
Section titled “PartnerHint”type PartnerHint = z.infer<typeof partnerHintSchema>;PartnerHintInput
Section titled “PartnerHintInput”type PartnerHintInput = z.input<typeof partnerHintSchema>;What the partner writes: the same shape, before normalisation.
ProblemDetails
Section titled “ProblemDetails”type ProblemDetails = z.infer<typeof readProblemSchema>;The problem details of a failed call, as problemOf returns them.
WebhookEvent
Section titled “WebhookEvent”type WebhookEvent = z.infer<typeof deliverySchema> & object;A verified delivery: one of the events, the endpoint’s test
(webhook.test, whose data names the endpoint), or an event type
newer than this SDK (its type as sent). Its id is the webhook-id
header.
Type Declaration
Section titled “Type Declaration”id: string;WebhookEventType
Section titled “WebhookEventType”type WebhookEventType = | IntegrationEventType | typeof WEBHOOK_TEST_EVENT| string & Record<never, never>;A delivery’s type: one this SDK knows (the catalog’s, webhook.test), or
a newer one, kept as its string. LexOpti adds event types without a new
version: a delivery of a type this build does not know still verifies,
for the partner to ignore (or handle once it updates).
Variables
Section titled “Variables”DEFAULT_BASE_URL
Section titled “DEFAULT_BASE_URL”const DEFAULT_BASE_URL: "https://app.lexopti.com/v1" = "https://app.lexopti.com/v1";The production API.
PARTNER_HINT_MAX_BYTES
Section titled “PARTNER_HINT_MAX_BYTES”const PARTNER_HINT_MAX_BYTES: 2048 = 2048;The encoded hint’s size limit, in bytes: far above any real organization.
PARTNER_HINT_PARAM
Section titled “PARTNER_HINT_PARAM”const PARTNER_HINT_PARAM: "lexopti_hint" = "lexopti_hint";The authorization request parameter that carries the hint.
WEBHOOK_TEST_EVENT
Section titled “WEBHOOK_TEST_EVENT”const WEBHOOK_TEST_EVENT: "webhook.test" = "webhook.test";What POST /v1/webhook-endpoints/{id}/test delivers, signed like the others.
webhooks
Section titled “webhooks”const webhooks: object;Type Declaration
Section titled “Type Declaration”verify
Section titled “verify”verify: (payload, headers, secret) => WebhookEvent = verifyWebhook;Verifies a LexOpti webhook (Standard Webhooks) and returns its event:
pass the raw body, the request headers and the endpoint secret
(whsec_…). Throws when the signature or the timestamp is wrong. The
event’s id is the webhook-id header: deduplicate on it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
payload |
string |
headers |
Headers | Record<string, string> |
secret |
string |
Returns
Section titled “Returns”Functions
Section titled “Functions”createLexOptiClient()
Section titled “createLexOptiClient()”function createLexOptiClient(options): LexOptiClient;A typed client of the LexOpti API. Every idempotent POST gets an
Idempotency-Key (kept across its retries); only requests safe to repeat
are retried after a failure, with jittered backoff or Retry-After. Errors are oRPC errors: problemOf(error) reads the
problem details.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
LexOptiClientOptions |
Returns
Section titled “Returns”decodePartnerHint()
Section titled “decodePartnerHint()”function decodePartnerHint(value): | { email?: string; family_name?: string; firm?: { address?: { city?: string; line1?: string; postal_code?: string; }; name?: string; phone?: string; profession?: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated"; siren?: string; }; given_name?: string;} | null;The hint an authorization request carries, or null for anything that is not one (absent, too large, not base64url JSON, a field of the wrong shape): a bad hint never stops a sign-in, the page simply starts empty.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
value |
string | null | undefined |
Returns
Section titled “Returns”| {
email?: string;
family_name?: string;
firm?: {
address?: {
city?: string;
line1?: string;
postal_code?: string;
};
name?: string;
phone?: string;
profession?: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated";
siren?: string;
};
given_name?: string;
}
| null
encodePartnerHint()
Section titled “encodePartnerHint()”function encodePartnerHint(hint): string;The lexopti_hint value for an authorization request: the hint as JSON,
base64url. Throws when the hint is not valid or too large, so a partner
finds out while developing, not the member while signing up.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
hint |
{ email?: string; family_name?: string; firm?: { address?: { city?: string; line1?: string; postal_code?: string; }; name?: string; phone?: string; profession?: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated"; siren?: string; }; given_name?: string; } |
hint.email? |
string |
hint.family_name? |
string |
hint.firm? |
{ address?: { city?: string; line1?: string; postal_code?: string; }; name?: string; phone?: string; profession?: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated"; siren?: string; } |
hint.firm.address? |
{ city?: string; line1?: string; postal_code?: string; } |
hint.firm.address.city? |
string |
hint.firm.address.line1? |
string |
hint.firm.address.postal_code? |
string |
hint.firm.name? |
string |
hint.firm.phone? |
string |
hint.firm.profession? |
"lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated" |
hint.firm.siren? |
string |
hint.given_name? |
string |
Returns
Section titled “Returns”string
isEmptyPartnerHint()
Section titled “isEmptyPartnerHint()”function isEmptyPartnerHint(hint): boolean;Whether a hint says anything at all.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
hint |
| { email?: string; family_name?: string; firm?: { address?: { city?: string; line1?: string; postal_code?: string; }; name?: string; phone?: string; profession?: "lawyer" | "real_estate" | "notary" | "accountant" | "other_regulated"; siren?: string; }; given_name?: string; } | null |
Returns
Section titled “Returns”boolean
paginate()
Section titled “paginate()”function paginate<Input, Item>(list, input): AsyncGenerator<Item, void, undefined>;Every item of a list, page after page:
for await (const client of paginate(lexopti.clients.list, { limit: 100 })).
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Input extends object |
Item |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
list |
ListOperation<Input, Item> |
input |
Input |
Returns
Section titled “Returns”AsyncGenerator<Item, void, undefined>
Yields
Section titled “Yields”Each item of each page, in the list’s order.
problemOf()
Section titled “problemOf()”function problemOf(error): | { cases?: object[]; code: string; detail: string; errors?: object[]; missing?: object[]; request_id?: string; status: number; title: string; type: string;} | null;The problem details (RFC 9457) of a failed call: code is stable,
branch on it; request_id names the request for LexOpti support; null
for an error that did not come from the API.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error |
unknown |
Returns
Section titled “Returns”| {
cases?: object[];
code: string;
detail: string;
errors?: object[];
missing?: object[];
request_id?: string;
status: number;
title: string;
type: string;
}
| null
verifyWebhook()
Section titled “verifyWebhook()”function verifyWebhook( payload, headers, secret): WebhookEvent;Verifies a LexOpti webhook (Standard Webhooks) and returns its event:
pass the raw body, the request headers and the endpoint secret
(whsec_…). Throws when the signature or the timestamp is wrong. The
event’s id is the webhook-id header: deduplicate on it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
payload |
string |
headers |
Headers | Record<string, string> |
secret |
string |