// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as Shared from './shared'; import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; /** * Candidates who have not yet started work at the company */ export class DraftHires extends APIResource { /** * Create bulk draft hire */ create(body: DraftHireCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/draft-hires/', { body, ...options }); } } /** * Response model for bulk draft hire creation. */ export interface DraftHireCreateResponse { /** * List of invalid draft hire requests */ invalid_items?: Array; /** * Detailed results for each draft hire item */ successful_results?: Array; } export namespace DraftHireCreateResponse { /** * Result for an individual draft hire creation. */ export interface InvalidItem { /** * Status of the creation (success, error, warning) */ status: string; /** * Generated draft hire ID if successful */ draft_hire_role_id?: string; /** * List of validation errors if any */ errors?: Array; /** * Success or error message */ message?: string; } /** * Result for an individual draft hire creation. */ export interface SuccessfulResult { /** * Status of the creation (success, error, warning) */ status: string; /** * Generated draft hire ID if successful */ draft_hire_role_id?: string; /** * List of validation errors if any */ errors?: Array; /** * Success or error message */ message?: string; } } export interface DraftHireCreateParams { /** * List of draft hires */ draft_hires: Array; } export namespace DraftHireCreateParams { /** * A draft hire represents a candidate who has been offered a position but hasn't started yet. * * This class provides Platform API access to draft hire data stored as RoleWithCompany instances * in a candidate state, allowing external systems to create and manage draft hires. */ export interface DraftHire { /** * Employment information for the draft hire position */ employment_info: DraftHire.EmploymentInfo; /** * Personal information for the draft hire candidate */ personal_info: DraftHire.PersonalInfo; /** * Work location information */ work_location_info: DraftHire.WorkLocationInfo; /** * Custom fields for the draft hire */ custom_fields?: Array; /** * Documents to attach to this draft hire */ documents?: Array; /** * Headcount planning info for hiring into a position. If provided, the draft hire * will be linked to the specified open headcount allocation. Requires headcount * planning to be enabled for the company. */ headcount_info?: DraftHire.HeadcountInfo; } export namespace DraftHire { /** * Employment information for the draft hire position */ export interface EmploymentInfo { /** * Employment type ID */ employment_type_id: string; /** * Title */ title: string; /** * Contract end date */ contract_end_date?: string; /** * Currency */ currency?: string; /** * Department ID */ department_id?: string; /** * Duties */ duties?: string; /** * EEOC job classification (e.g., EXECUTIVE, MID_LEVEL, PROFESSIONALS, TECHNICIANS, * SALES_WORKERS, SUPPORT_WORKERS, CRAFT_WORKERS, OPERATIVES, HELPERS, * SERVICE_WORKERS) */ eeoc_job_classification?: string; /** * Equity number of shares */ equity_num_shares?: number; /** * Equity value */ equity_value?: number; /** * Equity vesting schedule */ equity_vesting_schedule?: EmploymentInfo.EquityVestingSchedule; /** * Job family ID */ job_family_id?: string; /** * Job title */ job_title?: string; /** * Legal entity ID */ legal_entity_id?: string; /** * Level ID */ level_id?: string; /** * Manager ID */ manager_id?: string; /** * Offer expiration date */ offer_expiration_date?: string; /** * On target commission */ on_target_commission?: number; /** * Overtime exemption */ overtime_exemption?: 'exempt' | 'non-exempt'; /** * Probation end date */ probation_end_date?: string; /** * Relocation reimbursement */ relocation_reimbursement?: number; /** * Salary per unit */ salary_per_unit?: number; /** * Salary unit */ salary_unit?: string; /** * Signing bonus */ signing_bonus?: number; /** * Start date */ start_date?: string; /** * Target annual bonus */ target_annual_bonus?: number; /** * Target annual bonus as a percentage */ target_annual_bonus_percent?: number; /** * Teams IDs */ teams_ids?: Array; /** * Weekly hours */ weekly_hours?: number; /** * Work email */ work_email?: string; } export namespace EmploymentInfo { /** * Equity vesting schedule */ export interface EquityVestingSchedule { /** * Required company ID for the vesting schedule */ company_id: string; /** * Name of the vesting schedule */ _name?: string; /** * Number of cliff months before vesting begins */ cliffMonths?: number; /** * Number of continuous vesting months */ continuousVestingMonths?: number; /** * Percentage of initial vesting as decimal */ percentageInitialVesting?: number; /** * Spoke ID for the vesting schedule */ spokeId?: string; /** * Total number of vesting months */ totalVestingMonths?: number; /** * Total number of vesting years */ totalVestingYears?: number; /** * Type of vesting schedule */ vestingType?: string; } } /** * Personal information for the draft hire candidate */ export interface PersonalInfo { /** * Invite email of the candidate */ invite_email: string; /** * Name of the candidate */ name: PersonalInfo.Name; /** * Citizenship of the candidate */ citizenship?: string; /** * Date of birth */ date_of_birth?: string; /** * Emergency contact name */ emergency_contact_name?: string; /** * Emergency contact phone */ emergency_contact_phone?: PersonalInfo.EmergencyContactPhone; /** * Ethnicity of the candidate */ ethnicity?: string; /** * Gender of the candidate */ gender?: string; /** * Home address of the candidate */ home_address?: Shared.Address; /** * Locale of the candidate */ locale?: PersonalInfo.Locale; /** * Personal phone number */ personal_phone?: PersonalInfo.PersonalPhone; /** * Race of the candidate */ race?: string; /** * Social security number of the candidate */ ssn?: string; } export namespace PersonalInfo { /** * Name of the candidate */ export interface Name { /** * First name or given name */ first?: string; /** * Last name or family name */ last?: string; /** * Middle name(s) */ middle?: string; /** * Preferred nickname or informal name */ nickname?: string; /** * Name suffix (e.g., Jr., Sr., III) */ suffix?: string; /** * Title or honorific (e.g., Mr., Ms., Dr.) */ title?: string; } /** * Emergency contact phone */ export interface EmergencyContactPhone { /** * Country code for the phone number */ country_code?: string; /** * Phone number extension */ extension?: string; /** * National phone number without country code */ national_number?: string; } /** * Locale of the candidate */ export interface Locale { /** * The primary language code */ language_code?: string; /** * Additional language inspection data */ language_inspection?: Array; /** * The locale code for formatting */ locale_code?: string; /** * The region code */ region_code?: string; /** * The user's timezone */ timezone?: string; } /** * Personal phone number */ export interface PersonalPhone { /** * Country code for the phone number */ country_code?: string; /** * Phone number extension */ extension?: string; /** * National phone number without country code */ national_number?: string; } } /** * Work location information */ export interface WorkLocationInfo { /** * Country code of the work location */ country_code?: string; /** * Whether the work location is remote */ is_remote?: boolean; /** * Work location ID */ location_id?: string; /** * State code of the work location */ state_code?: string; } /** * Custom field information for a draft hire. * * Custom fields are associated with RoleWithCompany model. */ export interface CustomField { /** * Name of the custom field */ field_name: string; /** * Value of the custom field */ field_value: unknown; } /** * A document to attach to a draft hire, referencing a pre-uploaded file. */ export interface Document { /** * Id of a FileUploadTracker in ACTIVE status whose file should become a document * on the hire */ file_id: string; /** * Document name. Defaults to the uploaded file name when omitted. */ name?: string; /** * Signature date in YYYY-MM-DD format. */ signature_date?: string; } /** * Headcount planning info for hiring into a position. If provided, the draft hire * will be linked to the specified open headcount allocation. Requires headcount * planning to be enabled for the company. */ export interface HeadcountInfo { /** * The Position ID (PID) of the headcount allocation to fill (e.g., PID100615) */ position_id: string; } } } export declare namespace DraftHires { export { type DraftHireCreateResponse as DraftHireCreateResponse, type DraftHireCreateParams as DraftHireCreateParams, }; }