APIs

HireLayer Rank

Rank up to 10 candidates against one job description in a single call, with a score and a rationale for each.

Endpoint
POST /api/v1/matching/job-candidates/rank
Input
JSON · job text and 1–10 candidates
Output
Ranks 1…n, scores and French rationales
Billing
1 credit per successful call
POST/api/v1/matching/job-candidates/rank

Order up to 10 candidates for one job description, with a score and a rationale for each.

Authentication
X-API-Key header
Billing
1 credit per successful call, whatever the number of candidates
Client timeout
Client timeout ≥ 65 s

Request body

Content type application/json

  • job_textstringrequired

    Job description. Trimmed before validation.

    1–50,000 characters

  • candidatesRankingCandidate[]required

    Candidates to rank against the same job.

    1–10 items

    ›Show 2 child fields
    • idstringrequired

      Your candidate ID. Unique within the request after trimming.

      non-empty

    • candidate_textstringrequired

      Resume as plain text. Trimmed before validation.

      1–50,000 characters

Response

200Ranked candidates.

  • rankingsRanking[]

    One entry per candidate, sorted by rank.

    ›Show 4 child fields
    • rankinteger

      Position from 1 (best) to the number of candidates.

      ≥ 1

    • candidate_idstring

      The id you sent, trimmed.

    • scorenumber

      Relevance for the job. Use rank for ordering.

      0–1

    • rationalestring

      Why the candidate holds this position, in French.

Errors

  • 400
    Request body must be a JSON object

    The body is missing, is a JSON array, or Content-Type is not application/json.

    Do not retry

  • 400
    The request contains unsupported fields

    The body contains a field that is not documented for this endpoint.

    Do not retry

  • 400
    The 'job_text' field is required

    job_text is missing or not a string.

    Do not retry

  • 400
    job_text cannot be empty

    job_text is empty after trimming.

    Do not retry

  • 400
    job_text must be 50000 characters or less

    job_text is longer than 50,000 characters after trimming.

    Do not retry

  • 400
    The 'candidates' field must be an array

    candidates is missing or not an array.

    Do not retry

  • 400
    candidates cannot be empty

    candidates is [].

    Do not retry

  • 400
    candidates must contain 10 candidates or fewer

    More than 10 candidates.

    Do not retry

  • 400
    candidates contains an invalid candidate

    A candidate has a missing, empty or extra field.

    Do not retry

  • 400
    candidate_text must be 50000 characters or less

    A candidate_text is longer than 50,000 characters after trimming.

    Do not retry

  • 400
    candidates contains duplicate ids

    Two candidates share the same id after trimming.

    Do not retry

  • 401
    Missing API Key

    The X-API-Key header is absent. Authorization: Bearer is not accepted.

    Do not retry

  • 401
    Invalid API Key

    The key is malformed, unknown or revoked. Rotating a key revokes the previous one immediately.

    Do not retry

  • 403
    Insufficient credits available

    The account has no credit left. availableCredits is the current balance.

    Fix, then retry

  • 500
    Internal server error

    Unexpected gateway failure.

    Retry with backoff

  • 500
    Internal server error. Please try again later.

    The body is not valid JSON, is a JSON primitive or exceeds 10 MB, or the service failed unexpectedly. Check the payload: if it is valid, retry.

    Retry with backoff

  • 502
    Upstream API unavailable

    The service did not answer within 60 seconds, or could not be reached.

    Retry with backoff

  • 502
    The AI processing step failed. Please try again later.

    Ranking failed or returned an invalid result after the service's internal retries.

    Retry with backoff

  • 503
    Credit service temporarily unavailable

    Credits could not be checked or deducted. No credit is consumed, including when the operation itself had completed.

    Retry with backoff

Behavior

Latency
Synchronous. The gateway waits up to 60 seconds, then returns 502 Upstream API unavailable. Use a client timeout of at least 65 seconds.
Retries
Transient model errors are retried by the service before it answers. Retry 502 and 503 with exponential backoff; never retry 4xx unchanged. Failed requests are not charged.
Validation
Validation stops at the first error, so one call reports one problem. Text fields are trimmed before their length is checked.
Ordering
Every candidate appears exactly once and ranks are 1…n. rank is authoritative: score is not guaranteed to decrease strictly with rank.
More than 10 candidates
Ranks are relative to one request. To screen a larger pool, pre-filter it, or score each candidate with Match against the same criteria, which gives comparable scores.
curl -X POST https://onlineresumeparser.com/api/v1/matching/job-candidates/rank \
  -H "X-API-Key: $HIRELAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "job_text": "Senior Frontend Engineer, Paris (hybrid). You will build our recruiting platform with React and TypeScript. Requirements: 5+ years of frontend development, strong React and TypeScript skills, fluent English. Nice to have: experience with Next.js.",
    "candidates": [
      {
        "id": "candidate_1",
        "candidate_text": "Alex Morgan, Senior Software Engineer in Paris. 8 years of experience. Since 2022, leads a team building a React and TypeScript SaaS platform at Northstar Labs. Previously built Node.js APIs. Professional English."
      },
      {
        "id": "candidate_2",
        "candidate_text": "Frontend developer in Lyon with 3 years of React experience on e-commerce sites. JavaScript, some TypeScript. Conversational English."
      },
      {
        "id": "candidate_3",
        "candidate_text": "Full-stack JavaScript developer with 6 years of experience, mostly Vue.js and PHP. Fluent English."
      }
    ]
  }'
{
  "rankings": [
    {
      "rank": 1,
      "candidate_id": "candidate_1",
      "score": 0.91,
      "rationale": "React et TypeScript sont démontrés en production, avec l’expérience demandée."
    },
    {
      "rank": 2,
      "candidate_id": "candidate_2",
      "score": 0.64,
      "rationale": "Bonne pratique de React, mais expérience plus courte et anglais seulement conversationnel."
    },
    {
      "rank": 3,
      "candidate_id": "candidate_3",
      "score": 0.38,
      "rationale": "Profil JavaScript solide, mais centré sur Vue.js sans expérience React mentionnée."
    }
  ]
}