API Reference¶
HackerRank for Work API client.
- class hackerrank.client.InterviewsNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for interview operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, limit: int | None = None, offset: int | None = None, created_at: str | None = None, updated_at: str | None = None, ended_at: str | None = None) Page[Interview]¶
List interviews.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
created_at –
from..tofilter for creation time.updated_at –
from..tofilter for update time.ended_at –
from..tofilter for ending time.
- Returns:
A page of interviews.
- create(*, title: str | None = None, from_: str | None = None, to: str | None = None, notes: str | None = None, resume_url: str | None = None, interviewers: Sequence[str] | None = None, result_url: str | None = None, candidate: Mapping[str, JSONValue] | None = None, send_email: bool | None = None, metadata: Mapping[str, JSONValue] | None = None, interview_template_id: int | None = None) Interview¶
Create an interview.
- Parameters:
title – Title of the interview.
from – Scheduled start time.
to – Scheduled end time.
notes – Private notes.
resume_url – URL to the candidate resume.
interviewers – Emails of interviewers.
result_url – URL invoked when the interview ends.
candidate – Candidate details.
send_email – Whether to send an email invite.
metadata – Arbitrary metadata.
interview_template_id – Template to apply.
- Returns:
The created interview.
- get(*, interview_id: str) Interview¶
Retrieve an interview.
- Parameters:
interview_id – The id of the interview.
- Returns:
The interview.
- update(*, interview_id: str, title: str | None = None, from_: str | None = None, to: str | None = None, notes: str | None = None, resume_url: str | None = None, result_url: str | None = None, candidate: Mapping[str, JSONValue] | None = None, send_email: bool | None = None, metadata: Mapping[str, JSONValue] | None = None, interview_template_id: int | None = None) None¶
Update an interview.
- Parameters:
interview_id – The id of the interview.
title – New title.
from – New start time.
to – New end time.
notes – New private notes.
resume_url – New resume URL.
result_url – New result URL.
candidate – New candidate details.
send_email – Whether to send an email.
metadata – New metadata.
interview_template_id – New template id.
- delete(*, interview_id: str) None¶
Delete an interview.
- Parameters:
interview_id – The id of the interview.
- get_transcript(*, interview_id: str) InterviewTranscript¶
Retrieve the transcript of an interview.
- Parameters:
interview_id – The id of the interview.
- Returns:
The transcript.
- class hackerrank.client.InterviewTemplatesNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for interview-template operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, limit: int | None = None, offset: int | None = None) Page[InterviewTemplate]¶
List interview templates.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of interview templates.
- create(*, name: str, roles: Sequence[str] | None = None, team_share: int | None = None, questions: Sequence[str] | None = None, scorecard: int | None = None) InterviewTemplate¶
Create an interview template.
- Parameters:
name – The template name.
roles – Roles for the template.
team_share – Team-share flag.
questions – Associated question ids.
scorecard – Scorecard id.
- Returns:
The created interview template.
- get(*, template_id: int | str) InterviewTemplate¶
Retrieve an interview template.
- Parameters:
template_id – The id of the template.
- Returns:
The template.
- update(*, template_id: int | str, name: str | None = None, roles: Sequence[str] | None = None, team_share: int | None = None, questions: Sequence[str] | None = None, scorecard: int | None = None) None¶
Update an interview template.
- Parameters:
template_id – The id of the template.
name – New name.
roles – New roles.
team_share – New team-share flag.
questions – New question ids.
scorecard – New scorecard id.
- class hackerrank.client.QuestionsNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for question operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, limit: int | None = None, offset: int | None = None) Page[Question]¶
List questions.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of questions.
- create(*, name: str, type: str, internal_notes: str | None = None, languages: Sequence[str] | None = None, problem_statement: str | None = None, recommended_duration: int | None = None, tags: Sequence[str] | None = None, options: Sequence[str] | None = None, answer: int | Sequence[int] | None = None) Question¶
Create a question.
- Parameters:
name – Question name.
type – Question type (
code,mcq, …).internal_notes – Private notes.
languages – Supported languages.
problem_statement – Problem statement.
recommended_duration – Recommended duration.
tags – Tags.
options – MCQ options.
answer – Correct MCQ answer.
- Returns:
The created question.
- get(*, question_id: str) Question¶
Retrieve a question.
- Parameters:
question_id – The id of the question.
- Returns:
The question.
- update(*, question_id: str, name: str | None = None, type: str | None = None, internal_notes: str | None = None, languages: Sequence[str] | None = None, problem_statement: str | None = None, recommended_duration: int | None = None, tags: Sequence[str] | None = None, options: Sequence[str] | None = None, answer: int | Sequence[int] | None = None) None¶
Update a question.
- Parameters:
question_id – The id of the question.
name – New name.
type – New question type.
internal_notes – New internal notes.
languages – New supported languages.
problem_statement – New problem statement.
recommended_duration – New recommended duration.
tags – New tags.
options – New MCQ options.
answer – New MCQ answer.
- update_codestubs(*, question_id: str, codestubs: Mapping[str, JSONValue]) None¶
Update custom code-stubs for a question.
- Parameters:
question_id – The id of the question.
codestubs – A mapping describing the code-stubs.
- generate_codestubs(*, question_id: str, body: Mapping[str, JSONValue] | None = None) dict[str, JSONValue]¶
Generate code-stubs for a question.
- Parameters:
question_id – The id of the question.
body – An optional request body.
- Returns:
The raw API response.
- add_testcase(*, question_id: str, body: Mapping[str, JSONValue]) dict[str, JSONValue]¶
Add a test case to a question.
- Parameters:
question_id – The id of the question.
body – The test-case payload.
- Returns:
The raw API response.
- update_testcase(*, question_id: str, testcase_id: str, body: Mapping[str, JSONValue]) None¶
Update an existing test case.
- Parameters:
question_id – The id of the question.
testcase_id – The id of the test case.
body – The test-case payload.
- class hackerrank.client.TestCandidatesNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for the candidates of a test.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, test_id: str, limit: int | None = None, offset: int | None = None) Page[TestCandidate]¶
List candidates for a test.
- Parameters:
test_id – The id of the test.
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of candidates.
- search(*, test_id: str, search: str, limit: int | None = None, offset: int | None = None) Page[TestCandidate]¶
Search candidates within a test.
- Parameters:
test_id – The id of the test.
search – Search query.
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of candidates.
- invite(*, test_id: str, email: str, full_name: str | None = None, send_email: bool | None = None, evaluator_email: str | None = None, test_result_url: str | None = None, test_finish_url: str | None = None, tags: Sequence[str] | None = None, invite_valid_from: str | None = None, invite_valid_to: str | None = None, force: bool | None = None, force_reattempt: bool | None = None, accommodations: Mapping[str, JSONValue] | None = None, invite_metadata: Mapping[str, JSONValue] | None = None, webhook_authentication: Mapping[str, JSONValue] | None = None, accept_result_updates: bool | None = None, subject: str | None = None, message: str | None = None, template: str | None = None) TestCandidate¶
Invite a candidate to a test.
- Parameters:
test_id – The id of the test.
email – Candidate email address.
full_name – Candidate full name.
send_email – Whether to send the invitation email.
evaluator_email – Evaluator email.
test_result_url – URL to which results are posted.
test_finish_url – URL the candidate sees on finish.
tags – Tags to set on the candidate.
invite_valid_from – Invitation start time.
invite_valid_to – Invitation end time.
force – Force inviting even if previously invited.
force_reattempt – Allow re-attempt.
accommodations – Accommodation settings.
invite_metadata – Arbitrary metadata.
webhook_authentication – Webhook auth config.
accept_result_updates – Accept result updates flag.
subject – Custom email subject.
message – Custom email message.
template – Email template id.
- Returns:
The created candidate.
- get(*, test_id: str, candidate_id: str, additional_fields: str | None = None) TestCandidate¶
Retrieve a single candidate.
- Parameters:
test_id – The id of the test.
candidate_id – The id of the candidate.
additional_fields – Comma-separated extra fields.
- Returns:
The candidate.
- update(*, test_id: str, candidate_id: str, full_name: str | None = None, ats_state: int | None = None, invite_valid_from: str | None = None, invite_valid_to: str | None = None, invite_metadata: Mapping[str, JSONValue] | None = None, evaluator_email: str | None = None, test_finish_url: str | None = None, test_result_url: str | None = None, webhook_authentication: Mapping[str, JSONValue] | None = None, accept_result_updates: bool | None = None, tags: Sequence[str] | None = None, accommodations: Mapping[str, JSONValue] | None = None) None¶
Update a candidate.
- Parameters:
test_id – The id of the test.
candidate_id – The id of the candidate.
full_name – New full name.
ats_state – New ATS state.
invite_valid_from – New invitation start time.
invite_valid_to – New invitation end time.
invite_metadata – New invite metadata.
evaluator_email – New evaluator email.
test_finish_url – New finish URL.
test_result_url – New result URL.
webhook_authentication – New webhook auth.
accept_result_updates – New flag value.
tags – New tags.
accommodations – New accommodations.
- cancel_invite(*, test_id: str, candidate_id: str) None¶
Cancel a candidate’s invitation.
- Parameters:
test_id – The id of the test.
candidate_id – The id of the candidate.
- delete_report(*, test_id: str, candidate_id: str) None¶
Delete the report for a candidate.
- Parameters:
test_id – The id of the test.
candidate_id – The id of the candidate.
- get_report_pdf(*, test_id: str, candidate_id: str, format_: str = 'url') dict[str, JSONValue]¶
Retrieve the PDF report for a candidate.
- Parameters:
test_id – The id of the test.
candidate_id – The id of the candidate.
format – Format of the PDF (e.g.
"url").
- Returns:
The raw API response. When
format_is"url"the response typically contains a URL for downloading the PDF.
- class hackerrank.client.TestsNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for test operations.
Create the namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, limit: int | None = None, offset: int | None = None) Page[Test]¶
List tests.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of tests.
- create(*, name: str, starttime: str | None = None, endtime: str | None = None, duration: int | None = None, instructions: str | None = None, locked: bool | None = None, draft: bool | None = None, languages: Sequence[str] | None = None, candidate_details: Sequence[str] | None = None, custom_acknowledge_text: str | None = None, cutoff_score: int | None = None, master_password: str | None = None, hide_compile_test: bool | None = None, tags: Sequence[str] | None = None, role_ids: Sequence[str] | None = None, experience: Sequence[str] | None = None, questions: Sequence[str] | None = None, mcq_incorrect_score: int | None = None, mcq_correct_score: int | None = None, shuffle_questions: bool | None = None, test_admins: Sequence[str] | None = None, hide_template: bool | None = None, enable_acknowledgement: bool | None = None, enable_proctoring: bool | None = None, enable_advanced_proctoring: bool | None = None, enable_secure_assessment_mode: bool | None = None, enable_ml_plagiarism_analysis: bool | None = None, enable_photo_identification: bool | None = None, ide_config: str | None = None) Test¶
Create a test.
- Parameters:
name – The name of the test.
starttime – Test start time.
endtime – Test end time.
duration – Test duration in minutes.
instructions – Test instructions.
locked – Whether the test is locked.
draft – Whether the test is a draft.
languages – Allowed programming languages.
candidate_details – Candidate detail fields.
custom_acknowledge_text – Custom acknowledge text.
cutoff_score – The cut-off score.
master_password – Master password for the test.
hide_compile_test – Hide compile-test option.
tags – Tags applied to the test.
role_ids – Role ids associated with the test.
experience – Experience-level metadata.
questions – Question ids to include.
mcq_incorrect_score – Score for incorrect MCQ.
mcq_correct_score – Score for correct MCQ.
shuffle_questions – Whether to shuffle.
test_admins – Test admin user ids.
hide_template – Hide the template flag.
enable_acknowledgement – Enable acknowledgement.
enable_proctoring – Enable proctoring.
enable_advanced_proctoring – Advanced proctoring.
enable_secure_assessment_mode – Secure mode flag.
enable_ml_plagiarism_analysis – ML plagiarism.
enable_photo_identification – Photo ID flag.
ide_config – IDE configuration.
- Returns:
The created test.
- get(*, test_id: str, additional_fields: str | None = None) Test¶
Retrieve a test.
- Parameters:
test_id – The id of the test.
additional_fields – Comma-separated extra fields.
- Returns:
The test.
- class hackerrank.client.TemplatesNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for invite-email templates.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.client.UsersNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for user operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, limit: int | None = None, offset: int | None = None) Page[User]¶
List users.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of users.
- search(*, search: str, limit: int | None = None, offset: int | None = None) Page[User]¶
Search users.
- Parameters:
search – Search query.
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of users.
- create(*, email: str, firstname: str | None = None, lastname: str | None = None, country: str | None = None, role: str | None = None, send_email: bool | None = None, phone: str | None = None, questions_permission: int | None = None, tests_permission: int | None = None, interviews_permission: int | None = None, candidates_permission: int | None = None, shared_questions_permission: int | None = None, shared_tests_permission: int | None = None, shared_interviews_permission: int | None = None, shared_candidates_permission: int | None = None, company_admin: bool | None = None, team_admin: bool | None = None, teams: Sequence[str] | None = None) User¶
Create a user.
- Parameters:
email – Email address.
firstname – First name.
lastname – Last name.
country – Country.
role – Role.
send_email – Send invite email flag.
phone – Phone number.
questions_permission – Permission level.
tests_permission – Permission level.
interviews_permission – Permission level.
candidates_permission – Permission level.
shared_questions_permission – Permission level.
shared_tests_permission – Permission level.
shared_interviews_permission – Permission level.
shared_candidates_permission – Permission level.
company_admin – Company admin flag.
team_admin – Team admin flag.
teams – Team ids the user belongs to.
- Returns:
The created user.
- get(*, user_id: str) User¶
Retrieve a user.
- Parameters:
user_id – The id of the user.
- Returns:
The user.
- class hackerrank.client.TeamMembershipsNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for user-team membership operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, team_id: str, limit: int | None = None, offset: int | None = None) Page[UserTeamMembership]¶
List memberships for a team.
- Parameters:
team_id – The id of the team.
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of memberships.
- get(*, team_id: str, user_id: str) UserTeamMembership¶
Retrieve a single membership.
- Parameters:
team_id – The id of the team.
user_id – The id of the user.
- Returns:
The membership.
- class hackerrank.client.TeamsNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for team operations.
Create the namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, limit: int | None = None, offset: int | None = None) Page[Team]¶
List teams.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of teams.
- create(*, name: str, recruiter_cap: int | None = None, developer_cap: int | None = None, invite_as: str | None = None, locations: Sequence[str] | None = None, departments: Sequence[str] | None = None) Team¶
Create a team.
- Parameters:
name – Team name.
recruiter_cap – Recruiter seat cap.
developer_cap – Developer seat cap.
invite_as – Default role for invites.
locations – Allowed locations.
departments – Allowed departments.
- Returns:
The created team.
- get(*, team_id: str) Team¶
Retrieve a team.
- Parameters:
team_id – The id of the team.
- Returns:
The team.
- update(*, team_id: str, name: str | None = None, recruiter_cap: int | None = None, developer_cap: int | None = None, invite_as: str | None = None, locations: Sequence[str] | None = None, departments: Sequence[str] | None = None) None¶
Update a team.
- Parameters:
team_id – The id of the team.
name – New team name.
recruiter_cap – New recruiter seat cap.
developer_cap – New developer seat cap.
invite_as – New default invite role.
locations – New allowed locations.
departments – New allowed departments.
- class hackerrank.client.AuditLogsNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for audit-log operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.client.ATSCodePairNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for ATS Codepair operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- invite(*, title: str | None = None, requisition_id: str | None = None, candidate_id: str | None = None, candidate: Mapping[str, JSONValue] | None = None, send_email: bool | None = None, interview_metadata: Mapping[str, JSONValue] | None = None) ATSCodePair¶
Invite a candidate to an ATS Codepair interview.
- Parameters:
title – The interview title.
requisition_id – The ATS requisition id.
candidate_id – The ATS candidate id.
candidate – Candidate information.
send_email – Whether to send an email.
interview_metadata – Arbitrary metadata.
- Returns:
The ATS Codepair result.
- class hackerrank.client.ATSCodeScreenNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for ATS CodeScreen operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- invite(*, test_id: str, email: str, requisition_id: str | None = None, candidate_id: str | None = None, send_email: bool | None = None, test_result_url: str | None = None, webhook_authentication: Mapping[str, JSONValue] | None = None, accept_result_updates: bool | None = None, force: bool | None = None, force_reattempt_after: int | None = None, accommodations: Mapping[str, JSONValue] | None = None) ATSCodeScreen¶
Invite a candidate to a CodeScreen test.
- Parameters:
test_id – The test id.
email – Candidate email.
requisition_id – ATS requisition id.
candidate_id – ATS candidate id.
send_email – Whether to send an email.
test_result_url – URL for posting results.
webhook_authentication – Webhook auth config.
accept_result_updates – Accept-updates flag.
force – Force inviting flag.
force_reattempt_after – Seconds before re-attempt.
accommodations – Accommodation settings.
- Returns:
The ATS CodeScreen result.
- class hackerrank.client.ATSNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for ATS operations.
Create the ATS namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.client.SCIMUsersNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for SCIM v2 user operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, limit: int | None = None, offset: int | None = None) SCIMPage[SCIMUser]¶
List SCIM users.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of SCIM users.
- create(*, body: Mapping[str, JSONValue]) SCIMUser¶
Create a SCIM user.
- Parameters:
body – The SCIM user payload.
- Returns:
The created SCIM user.
- get(*, scim_user_id: str) SCIMUser¶
Retrieve a SCIM user.
- Parameters:
scim_user_id – The id of the SCIM user.
- Returns:
The SCIM user.
- replace(*, scim_user_id: str, body: Mapping[str, JSONValue]) SCIMUser¶
Replace a SCIM user (PUT).
- Parameters:
scim_user_id – The id of the SCIM user.
body – The full SCIM user payload.
- Returns:
The updated SCIM user.
- class hackerrank.client.SCIMGroupsNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for SCIM v2 group (team) operations.
Create a new namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- list(*, limit: int | None = None, offset: int | None = None) SCIMPage[SCIMTeam]¶
List SCIM groups.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of SCIM teams.
- create(*, body: Mapping[str, JSONValue]) SCIMTeam¶
Create a SCIM group.
- Parameters:
body – The SCIM group payload.
- Returns:
The created SCIM team.
- get(*, scim_group_id: str) SCIMTeam¶
Retrieve a SCIM group.
- Parameters:
scim_group_id – The id of the SCIM group.
- Returns:
The SCIM team.
- class hackerrank.client.SCIMNamespace(*, transport: Transport, base_url: str, headers: dict[str, str])¶
Namespace for SCIM v2 operations.
Create the SCIM namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.client.HackerRank(*, api_key: str, base_url: str = 'https://www.hackerrank.com', transport: Transport | None = None)¶
A client for the HackerRank for Work API.
Create a new HackerRank client.
- Parameters:
api_key – The API key for authentication.
base_url – The base URL for the API.
transport – The HTTP transport. Defaults to
HTTPXTransport().
Async HackerRank for Work API client.
- class hackerrank.async_client.AsyncInterviewsNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for interview operations.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- async list(*, limit: int | None = None, offset: int | None = None) Page[Interview]¶
List interviews.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of interviews.
- async create(*, title: str | None = None, from_: str | None = None, to: str | None = None, interview_template_id: int | None = None, candidate: Mapping[str, JSONValue] | None = None, send_email: bool | None = None, metadata: Mapping[str, JSONValue] | None = None, interviewers: Sequence[str] | None = None) Interview¶
Create an interview.
- Parameters:
title – Title of the interview.
from – Scheduled start time.
to – Scheduled end time.
interview_template_id – Template to apply.
candidate – Candidate details.
send_email – Whether to send an email invite.
metadata – Arbitrary metadata.
interviewers – Emails of interviewers.
- Returns:
The created interview.
- async get(*, interview_id: str) Interview¶
Retrieve an interview.
- Parameters:
interview_id – The id of the interview.
- Returns:
The interview.
- async delete(*, interview_id: str) None¶
Delete an interview.
- Parameters:
interview_id – The id of the interview.
- async get_transcript(*, interview_id: str) InterviewTranscript¶
Retrieve the transcript of an interview.
- Parameters:
interview_id – The id of the interview.
- Returns:
The transcript.
- class hackerrank.async_client.AsyncInterviewTemplatesNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for interview-template operations.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- async list(*, limit: int | None = None, offset: int | None = None) Page[InterviewTemplate]¶
List interview templates.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of interview templates.
- async get(*, template_id: int | str) InterviewTemplate¶
Retrieve an interview template.
- Parameters:
template_id – The id of the template.
- Returns:
The template.
- class hackerrank.async_client.AsyncQuestionsNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for question operations.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.async_client.AsyncTestCandidatesNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for candidates of a test.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- async list(*, test_id: str, limit: int | None = None, offset: int | None = None) Page[TestCandidate]¶
List candidates for a test.
- Parameters:
test_id – The id of the test.
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of candidates.
- async invite(*, test_id: str, email: str, full_name: str | None = None, send_email: bool | None = None) TestCandidate¶
Invite a candidate to a test.
- Parameters:
test_id – The id of the test.
email – Candidate email address.
full_name – Candidate full name.
send_email – Whether to send the invitation email.
- Returns:
The created candidate.
- async get(*, test_id: str, candidate_id: str) TestCandidate¶
Retrieve a single candidate.
- Parameters:
test_id – The id of the test.
candidate_id – The id of the candidate.
- Returns:
The candidate.
- class hackerrank.async_client.AsyncTestsNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for test operations.
Create the namespace.
- Parameters:
transport – The HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- async list(*, limit: int | None = None, offset: int | None = None) Page[Test]¶
List tests.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of tests.
- class hackerrank.async_client.AsyncTemplatesNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for invite-email templates.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.async_client.AsyncUsersNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for user operations.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.async_client.AsyncTeamsNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for team operations.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- async list(*, limit: int | None = None, offset: int | None = None) Page[Team]¶
List teams.
- Parameters:
limit – Number of records to fetch.
offset – Offset of records.
- Returns:
A page of teams.
- class hackerrank.async_client.AsyncAuditLogsNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for audit-log operations.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.async_client.AsyncATSNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for ATS operations.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- async codepair_invite(*, body: Mapping[str, JSONValue]) ATSCodePair¶
Invite a candidate to an ATS Codepair interview.
- Parameters:
body – The Codepair invite payload.
- Returns:
The ATS Codepair result.
- async codescreen_invite(*, body: Mapping[str, JSONValue]) ATSCodeScreen¶
Invite a candidate to a CodeScreen test.
- Parameters:
body – The CodeScreen invite payload.
- Returns:
The ATS CodeScreen result.
- class hackerrank.async_client.AsyncSCIMNamespace(*, transport: AsyncTransport, base_url: str, headers: dict[str, str])¶
Async namespace for SCIM v2 operations.
Create a new async namespace.
- Parameters:
transport – The async HTTP transport.
base_url – The base URL for the API.
headers – Headers to send with every request.
- class hackerrank.async_client.AsyncHackerRank(*, api_key: str, base_url: str = 'https://www.hackerrank.com', transport: AsyncTransport | None = None)¶
An async client for the HackerRank for Work API.
Create a new async HackerRank client.
- Parameters:
api_key – The API key for authentication.
base_url – The base URL for the API.
transport – The HTTP transport. Defaults to
AsyncHTTPXTransport().
Transport abstractions for the HackerRank for Work API.
- exception hackerrank.transports.HTTPStatusError(*, status_code: int, content: bytes)¶
Raised when an HTTP response has an error status code.
Create a new HTTP status error.
- Parameters:
status_code – The HTTP status code.
content – The response body.
- class hackerrank.transports.TransportResponse(*, status_code: int, headers: dict[str, str], content: bytes)¶
A response from a transport.
- raise_for_status() None¶
Raise an error if the response has an error status.
- Raises:
HTTPStatusError – If the status code is 400 or above.
- class hackerrank.transports.Transport(*args, **kwargs)¶
Protocol for HTTP transports.
A transport is a callable that makes an HTTP request and returns a
TransportResponse.
- class hackerrank.transports.HTTPXTransport¶
HTTP transport using the
httpxlibrary.This is the default transport. It uses a shared
httpx.Clientfor connection pooling.Create a new HTTPX transport.
- class hackerrank.transports.AsyncTransport(*args, **kwargs)¶
Protocol for async HTTP transports.
- class hackerrank.transports.AsyncHTTPXTransport¶
Async HTTP transport using the
httpxlibrary.Create a new async HTTPX transport.
Types for the HackerRank for Work API.
- type hackerrank.types.JSONValue = str | int | float | bool | None | Sequence[Any] | Mapping[str, Any]¶
A JSON-compatible value.
Used for free-form fields such as
metadata,candidate,accommodationsandwebhook_authentication— anything where the HackerRank API accepts or returns an opaque blob constrained only to be JSON-serialisable.Sequence/Mapping(rather thanlist/dict) make the alias accept narrower concrete types such asdict[str, str]without invariance issues. The innerAnykeeps the alias non-recursive so@beartypecan resolve it at runtime.
- class hackerrank.types.Page(iterable: Iterable = (), /, *, page_total: int, offset: int, previous: str, next_: str, first: str, last: str, total: int)¶
A page of results with HackerRank’s pagination metadata.
Create a new page.
- Parameters:
iterable – The items for the list.
page_total – Count of items in the current page.
offset – The offset of the current page.
previous – URL of the previous page.
next – URL of the next page.
first – URL of the first page.
last – URL of the last page.
total – Total number of items across all pages.
- class hackerrank.types.SCIMPage(iterable: Iterable = (), /, *, schemas: list[str], start_index: int, items_per_page: int, total_results: int)¶
A SCIM v2 paginated response.
SCIM uses a different envelope from the v3 API.
Create a new SCIM page.
- Parameters:
iterable – The items for the list.
schemas – The SCIM schemas for the response.
start_index – 1-based index of the first item.
items_per_page – Number of items per page.
total_results – Total number of items.
- class hackerrank.types.CandidateDetail(*, field_name: str, title: str, value: str)¶
A custom candidate detail field.
- class hackerrank.types.Interview(*, id: str, status: str, url: str, title: str | None = None, feedback: str | None = None, thumbs_up: int | None = None, notes: str | None = None, resume_url: str | None = None, interviewers: list[str] | None = None, result_url: str | None = None, candidate: dict[str, JSONValue] | None = None, metadata: dict[str, JSONValue] | None = None, report_url: str | None = None, ended_at: str | None = None, interview_template_id: int | None = None, created_at: str | None = None, updated_at: str | None = None, user: int | None = None, send_email: bool | None = None)¶
A HackerRank interview.
- class hackerrank.types.InterviewTranscriptMessage(*, author: str, timestamp: int, text: str, candidate: bool, message_id: str, email: str | None = None)¶
A single message in an interview transcript.
- class hackerrank.types.InterviewTranscript(*, messages: list[InterviewTranscriptMessage])¶
The transcript for an interview.
- messages: list[InterviewTranscriptMessage]¶
- class hackerrank.types.InterviewTemplate(*, id: int, name: str, created_at: str | None = None, status: int | None = None, user: int | None = None, roles: list[str] | None = None, team_share: int | None = None, questions: list[str] | None = None, scorecard: int | None = None, import_template: bool | None = None, editor_access: bool | None = None)¶
A HackerRank interview template.
- class hackerrank.types.Question(*, id: str, type: str, name: str, unique_id: str | None = None, owner: str | None = None, created_at: str | None = None, status: str | None = None, internal_notes: str | None = None, languages: list[str] | None = None, problem_statement: str | None = None, recommended_duration: int | None = None, tags: list[str] | None = None, max_score: float | None = None, options: list[str] | None = None, answer: int | list[int] | None = None)¶
A HackerRank question.
- class hackerrank.types.Test(*, id: str, name: str, unique_id: str | None = None, starttime: str | None = None, endtime: str | None = None, duration: int | None = None, owner: str | None = None, instructions: str | None = None, starred: bool | None = None, created_at: str | None = None, state: str | None = None, locked: bool | None = None, draft: bool | None = None, languages: list[str] | None = None, candidate_details: list[str] | None = None, custom_acknowledge_text: str | None = None, cutoff_score: int | None = None, master_password: str | None = None, hide_compile_test: bool | None = None, tags: list[str] | None = None, role_ids: list[str] | None = None, experience: list[str] | None = None, questions: list[str] | None = None, sections: list[dict[str, JSONValue]] | None = None, mcq_incorrect_score: int | None = None, mcq_correct_score: int | None = None, locked_by: str | None = None, short_login_url: str | None = None, public_login_url: str | None = None, shuffle_questions: bool | None = None, test_admins: list[str] | None = None, hide_template: bool | None = None, enable_acknowledgement: bool | None = None, enable_proctoring: bool | None = None, enable_advanced_proctoring: bool | None = None, enable_secure_assessment_mode: bool | None = None, enable_ml_plagiarism_analysis: bool | None = None, enable_photo_identification: bool | None = None, ide_config: str | None = None)¶
A HackerRank test.
- class hackerrank.types.TestCandidate(*, id: str, email: str, full_name: str | None = None, score: float | None = None, test: str | None = None, user: str | None = None, attempt_starttime: str | None = None, attempt_endtime: str | None = None, attempt_events: list[str] | None = None, status: int | None = None, ats_state: int | None = None, integrity_status: str | None = None, integrity_summary: str | None = None, invite_email_done: bool | None = None, invite_valid: bool | None = None, invited_on: str | None = None, invite_valid_from: str | None = None, invite_valid_to: str | None = None, invite_link: str | None = None, invite_metadata: dict[str, JSONValue] | None = None, evaluator_email: str | None = None, test_finish_url: str | None = None, test_result_url: str | None = None, accept_result_updates: bool | None = None, tags: list[str] | None = None, report_url: str | None = None, authenticated_report_url: str | None = None, pdf_url: str | None = None, scores_tags_split: dict[str, JSONValue] | None = None, scores_skills_split: dict[str, JSONValue] | None = None, added_time: int | None = None, unclaimed_added_time: int | None = None, comments: dict[str, JSONValue] | None = None, performance_summary: str | None = None, ip_address: str | None = None, questions: dict[str, JSONValue] | None = None, plagiarism: dict[str, JSONValue] | None = None, plagiarism_status: bool | None = None, max_code_similarity: dict[str, JSONValue] | None = None, feedback: str | None = None, percentage_score: float | None = None, candidate_details: list[CandidateDetail] | None = None, out_of_window_events: int | None = None, out_of_window_duration: float | None = None, editor_paste_count: int | None = None, proctor_images: list[str] | None = None)¶
A candidate associated with a test.
- candidate_details: list[CandidateDetail] | None = None¶
- class hackerrank.types.Inviter(*, id: str, email: str, firstname: str | None = None, lastname: str | None = None, role: str | None = None, status: str | None = None, phone: str | None = None, timezone: str | None = None, questions_permission: int | None = None, tests_permission: int | None = None, interviews_permission: int | None = None, candidates_permission: int | None = None, teams: list[str] | None = None, candidates_invited: int | None = None, activated: bool | None = None)¶
A user permitted to invite candidates to a test.
- class hackerrank.types.User(*, id: str, email: str, firstname: str | None = None, lastname: str | None = None, country: str | None = None, role: str | None = None, status: str | None = None, phone: str | None = None, timezone: str | None = None, questions_permission: int | None = None, tests_permission: int | None = None, interviews_permission: int | None = None, candidates_permission: int | None = None, shared_questions_permission: int | None = None, shared_tests_permission: int | None = None, shared_interviews_permission: int | None = None, shared_candidates_permission: int | None = None, company_admin: bool | None = None, team_admin: bool | None = None, teams: list[str] | None = None, activated: bool | None = None, last_activity_time: str | None = None)¶
A HackerRank user.
- class hackerrank.types.Team(*, id: str, name: str, owner: str | None = None, created_at: str | None = None, recruiter_count: int | None = None, developer_count: int | None = None, recruiter_cap: int | None = None, developer_cap: int | None = None, invite_as: str | None = None, locations: list[str] | None = None, departments: list[str] | None = None)¶
A HackerRank team.
- class hackerrank.types.UserTeamMembership(*, team: str, user: str)¶
A membership of a user in a team.
- class hackerrank.types.Template(*, id: str, name: str, subject: str | None = None, content: str | None = None, default: bool | None = None, created_at: str | None = None, updated_at: str | None = None, user: str | None = None)¶
An invite-email template.
- class hackerrank.types.AuditLog(*, source_id: int, source_type: str, action: str, user: str | None = None, modified_fields: list[str] | None = None, modified_values: dict[str, JSONValue] | None = None, ip_address: str | None = None, created_at: str | None = None)¶
An audit log entry.
- class hackerrank.types.ATSCodePair(*, title: str | None = None, requisition_id: str | None = None, candidate_id: str | None = None, candidate: dict[str, JSONValue] | None = None, send_email: bool | None = None, interview_metadata: dict[str, JSONValue] | None = None)¶
Result of an ATS Codepair invite.
- class hackerrank.types.ATSCodeScreen(*, test_id: str | None = None, requisition_id: str | None = None, candidate_id: str | None = None, email: str | None = None, test_result_url: str | None = None, accept_result_updates: bool | None = None)¶
Result of an ATS CodeScreen invite.
- class hackerrank.types.SCIMUser(*, id: str, user_name: str, name: dict[str, JSONValue] | None = None, active: bool | None = None, role: str | None = None, team_admin: bool | None = None, company_admin: bool | None = None, emails: list[dict[str, JSONValue]] | None = None, schemas: list[str] | None = None)¶
A SCIM v2 user.
- class hackerrank.types.SCIMTeam(*, id: str, display_name: str | None = None, schemas: list[str] | None = None)¶
A SCIM v2 team.
Custom exception hierarchy for the HackerRank API.
- exception hackerrank.exceptions.HackerRankError(*, response: TransportResponse)¶
Base exception for all HackerRank API errors.
- response¶
The full transport response for debugging.
- status_code¶
The HTTP status code.
- content¶
The response body.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.
- classmethod from_response(*, response: TransportResponse) HackerRankError¶
Create the appropriate exception for a response.
Uses the registry to find a specific exception class for the response’s status code, falling back to
HackerRankError.- Parameters:
response – The transport response.
- Returns:
The appropriate exception instance.
- exception hackerrank.exceptions.BadRequestError(*, response: TransportResponse)¶
Raised for 400 Bad Request responses.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.
- exception hackerrank.exceptions.AuthenticationError(*, response: TransportResponse)¶
Raised for 401 Unauthorized responses.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.
- exception hackerrank.exceptions.ForbiddenError(*, response: TransportResponse)¶
Raised for 403 Forbidden responses.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.
- exception hackerrank.exceptions.NotFoundError(*, response: TransportResponse)¶
Raised for 404 Not Found responses.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.
- exception hackerrank.exceptions.ConflictError(*, response: TransportResponse)¶
Raised for 409 Conflict responses.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.
- exception hackerrank.exceptions.UnprocessableEntityError(*, response: TransportResponse)¶
Raised for 422 Unprocessable Entity responses.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.
- exception hackerrank.exceptions.RateLimitError(*, response: TransportResponse)¶
Raised for 429 Too Many Requests responses.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.
- exception hackerrank.exceptions.ServerError(*, response: TransportResponse)¶
Raised for 500 Internal Server Error responses.
Create a new HackerRank error.
- Parameters:
response – The transport response that caused the error.