// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as JobRequisitionsAPI from './job-requisitions'; import * as WorkLocationsAPI from './work-locations'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; /** * An application by a candidate to a specific job requisition */ export class CandidateApplications extends APIResource { /** * List applications for at least one candidate, job requisition, or job post. Use * the standard OData filter parameter, for example filter=job_id eq '...'. The * named candidate_id, job_id, and job_post_id parameters remain supported as * aliases. job_post_id requires Internal_Testing access with either syntax. * * - Requires: `API Tier 1` * - Filterable fields: `candidate_id`, `job_id`, `job_post_id` * - Expandable fields: `candidate`, `job_post`, `job` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /candidate-applications/?filter=filter&expand=expand&order_by=order_by&candidate_id=candidate_id&job_id=job_id&job_post_id=job_post_id&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * { * "name": "date_of_birth", * "reason": "Insufficient entitlements" * } * ] * }, * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "status": "ACTIVE", * "stage": "string", * "stage_id": "string", * "applied_at": "string", * "candidate_id": "string", * "candidate": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "first_name": "string", * "last_name": "string", * "email": "string", * "phone_number": "string", * "timezone": "string" * }, * "job_id": "string", * "job_post_id": "string", * "job_post": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "job_requisition_id": "string", * "job_requisition": {}, * "name": "string", * "published": "string", * "locations": [], * "work_location_ids": [], * "work_locations": [], * "public_url": "string", * "language": "string" * }, * "job": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "status": "OPEN", * "requisition_id": "string" * }, * "url": "string" * } * ], * "next_link": "string" * } * ``` */ list( query: CandidateApplicationListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList( '/candidate-applications/', PageCursorURL, { query, ...options }, ); } } export type CandidateApplicationListResponsesPageCursorURL = PageCursorURL; export interface CandidateApplicationListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Application creation date */ applied_at?: string; /** * Candidate; request expand=candidate to include the canonical candidate resource * * Expandable field */ candidate?: CandidateApplicationListResponse.Candidate; /** * Identifier of the candidate resource associated with this application. Populated * regardless of whether candidate is expanded; request expand=candidate to include * the candidate resource. Null when redacted because the caller lacks permission * to access the referenced candidate ID; see \_\_meta.redacted_fields for the * redaction reason. */ candidate_id?: string; /** * Job requisition. This legacy field refers to the same Job Requisition resource * named job_requisition on newer resources such as Job Post. For backwards * compatibility, expand=job does not require job-requisitions.read, unlike Job * Post's expand=job_requisition. The requisition_id field still requires * job-requisitions.read. Null when not expanded. * * Expandable field */ job?: JobRequisitionsAPI.JobRequisition; /** * Job requisition ID. This legacy field refers to the same Job Requisition * resource named job_requisition_id on newer resources such as Job Post. */ job_id?: string; /** * Job post; request expand=job_post to include the canonical job post resource. * Null when not expanded or no specific job post is associated with the * application. * * Expandable field */ job_post?: CandidateApplicationListResponse.JobPost; /** * Identifier of the job post resource; null when no specific job post is * associated with the application * * Requires: Internal_Testing */ job_post_id?: string; /** * Application stage */ stage?: string; /** * Identifier of the application's current pipeline stage. Matches an id returned * by the parent job requisition's pipeline endpoint. Null when the current * application stage has no configured pipeline-stage mapping. * * Requires: Internal_Testing */ stage_id?: string; /** * Application status */ status?: 'ACTIVE' | 'REJECTED' | 'HIRED' | 'ARCHIVED'; /** * Application url */ url?: string; } export namespace CandidateApplicationListResponse { /** * Candidate; request expand=candidate to include the canonical candidate resource * * Expandable field */ export interface Candidate { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Candidate email */ email?: string; /** * Candidate first name */ first_name?: string; /** * Candidate last name */ last_name?: string; /** * Candidate phone number */ phone_number?: string; /** * Candidate timezone */ timezone?: string; } /** * Job post; request expand=job_post to include the canonical job post resource. * Null when not expanded or no specific job post is associated with the * application. * * Expandable field */ export interface JobPost { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Configured and manually entered locations associated with the job post. * Configured entries expose only work_location_id; manual entries expose * manual_location_id and inline location details. */ locations: Array; /** * Job post name */ name: string; /** * Whether the job post is published */ published: boolean; /** * Record update date */ updated_at: string; /** * Parent job requisition; null when not expanded or unavailable. Request * expand=job_requisition to include it * * Expandable field */ job_requisition?: JobRequisitionsAPI.JobRequisition; /** * Identifier of the parent Job Requisition resource. Applications use the legacy * field name job_id for the same resource. Null when the parent Job Requisition * reference is unavailable. */ job_requisition_id?: string; /** * BCP 47 job post language tag; defaults to en-US when not otherwise set */ language?: string; /** * Public job post URL; null when the post is not published */ public_url?: string; /** * Canonical Work Location identifiers for the configured subset of locations[]. * Unlike locations[], this list excludes manually entered locations and supports * expand=work_locations. Returns an empty list when there are no configured * locations. */ work_location_ids?: Array; /** * Configured Work Location resources; request expand=work_locations to include * them * * Expandable field */ work_locations?: Array; } export namespace JobPost { export interface Location { /** * City for a manually entered location; null for a configured Work Location * resource */ city?: string; /** * ISO 3166-1 alpha-2 country code for a manually entered location; null for a * configured Work Location resource */ country_code?: string; /** * Opaque job-post-local identifier for a manually entered location; null for a * configured Work Location. */ manual_location_id?: string; /** * Display name for a manually entered location; null for a configured Work * Location resource */ name?: string; /** * State or region for a manually entered location; null for a configured Work * Location resource */ state?: string; /** * Canonical Work Location resource identifier for a configured location; null for * a manually entered location. Request expand=work_locations on the parent job * post to retrieve the corresponding Work Location resources. */ work_location_id?: string; /** * Workplace type for a manually entered location: ON_SITE, REMOTE, or HYBRID. * Configured Work Location resources return null. */ workplace_type?: 'ON_SITE' | 'REMOTE' | 'HYBRID'; } } } export interface CandidateApplicationListParams { /** * The candidate whose applications to list. May be combined with another resource * filter. */ candidate_id?: string; cursor?: string; expand?: string; filter?: string; /** * The job requisition whose applications to list. May be combined with another * resource filter. */ job_id?: string; /** * The job post whose applications to list. May be combined with another resource * filter. */ job_post_id?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } export declare namespace CandidateApplications { export { type CandidateApplicationListResponse as CandidateApplicationListResponse, type CandidateApplicationListResponsesPageCursorURL as CandidateApplicationListResponsesPageCursorURL, type CandidateApplicationListParams as CandidateApplicationListParams, }; }