Outcome
Merge a job-board record flagged as a possible duplicate (candidate.duplicateOf set) into the existing candidate whose email it used. The public job board never changes an existing candidate, because anyone can type any email; this recruiter decision is the only way the two become one. Compare the two first (names, CV, answers) and merge only when they are the same person; otherwise keep the record separate or erase it (candidates.erase). Everything on the flagged record (applications, history, documents, notes, emails, interviews, scorecards, decisions, offers, activity) moves to the existing candidate, whose name and contact details are kept; it takes the later retention date and consent, and becomes active again if the flagged record was active. The flagged record is then deleted. Recruiters only.
Before you start
- Verify identity and the pinned organization context, then discover the exact action and a granted Recruit workspace.
- The required application permission is workspace:write. Hiring-team roles and record visibility are enforced separately; a workspace grant alone does not grant every Recruit action.
- Organization and workspace identity come from verified context. Pass the workspace as resourceType/resourceId, separate from action input; request-body organizationId/workspaceId values cannot select an authorized scope.
- The first authorized action can initialize an identity-only workspace mirror and invoke the configured workspace-created callback. It does not create an Auth workspace or grant new access.
Recruiters can perform the full hiring workflow. Hiring managers see their managed roles and candidates; interviewers see assigned interviews and their candidates. Workspace owners and organization administrators act as recruiters. Use team.me to read the caller's effective role and allowed actions.
Discover the target
topolo whoami --json
topolo actions get app_topolo_recruit.candidates.merge --detail --json
topolo resources topolo-recruit --json
topolo workspaces list topolo-recruit --json
topolo actions get app_topolo_recruit.team.me --detail --json
topolo actions get app_topolo_recruit.candidates.list --detail --json
Request
POST /api/candidates/{id}/merge
Save input as payload.json. CLI and MCP action input includes path identifiers. The reviewed plan separates path/query fields from the HTTP body. Set RECRUIT_WORKSPACE_ID from granted resource discovery.
Inspect and test this action in the signed action console. Use its discovered schema and plan; a test response still requires the verification described below.
Input fields
| Field | Required | Type | Constraints |
|---|---|---|---|
id | Required | string | Candidate id from candidates.list. {"minLength":1,"maxLength":64} |
Exact input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
}
},
"required": [
"id"
],
"additionalProperties": false
}
Effects
- Moves every record of the flagged candidate onto the existing candidate, updates its status, retention and consent, deletes the flagged candidate and notes the merge on the timeline.
Interpret the response
Call candidates.get with the flagged id and expect 404; call candidates.get with $.candidate.id and confirm the moved applications and a candidate_merged activity entry.
The response identifier path is $.candidate.id for candidate. Lists may be empty; an empty list is not a discovered target.
Exact success schema:
{
"type": "object",
"required": [
"candidate",
"mergedCandidateId"
],
"properties": {
"candidate": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"email": {
"type": "string"
},
"phone": {
"type": [
"string",
"null"
]
},
"location": {
"type": [
"string",
"null"
]
},
"profileUrl": {
"type": [
"string",
"null"
]
},
"source": {
"enum": [
"job_board",
"manual",
"sourced",
"referral",
"imported",
"agency"
]
},
"sourceDetail": {
"type": [
"string",
"null"
]
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"status": {
"enum": [
"active",
"archived"
]
},
"consentAt": {
"type": [
"string",
"null"
]
},
"retainUntil": {
"type": [
"string",
"null"
]
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
},
"duplicateOf": {
"type": [
"string",
"null"
],
"description": "Set on a job-board record whose email belongs to this existing candidate id; merge it with candidates.merge once a recruiter has checked it is the same person."
},
"locale": {
"type": [
"string",
"null"
],
"description": "The language the candidate applied in on the job board (en, ar, es, fr, de, pt-BR, ja or hi); Recruit's default emails to them use it. Null when unknown: those emails follow the sender's language."
}
}
},
"mergedCandidateId": {
"type": "string"
}
}
}
Worked examples
Actual dispatcher and migration-created SQLite or Worker handlers; Auth/workspace identity, object storage, mail and Notify dependencies are simulated. These synthetic fixtures establish no live authorization or delivery. A synthetic fixture identifier grants no access. Validate and inspect the planned request before executing. Commands with --confirm or MCP confirm:true assume the intended effect or data export has already been authorized.
Successful request
Actual dispatcher and migration-created SQLite; verified Auth/workspace context, object storage, mail and Notify dependencies are simulated. No live delivery or credential authorization is established. This complete response is a local fixture, not a deployed or delivered result.
Input · payload.json:
{
"id": "cand_c74e16c1f1aa43bcb58046bdc7aa55e3"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.merge --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.merge --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_recruit.candidates.merge --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_recruit.candidates.merge",
"input": {
"id": "cand_c74e16c1f1aa43bcb58046bdc7aa55e3"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"candidate": {
"id": "cand_16ea7c40876345adabf950db6705297b",
"firstName": "Ada",
"lastName": "Lovelace",
"email": "ada@example.com",
"phone": null,
"location": null,
"profileUrl": null,
"source": "manual",
"sourceDetail": null,
"tags": [],
"status": "active",
"consentAt": null,
"consentNotice": null,
"retainUntil": "2027-10-05T09:00:00.000Z",
"createdBy": "u_admin",
"createdAt": "2026-10-05T09:00:00.000Z",
"updatedAt": "2026-10-05T09:00:00.000Z",
"duplicateOf": null
},
"mergedCandidateId": "cand_c74e16c1f1aa43bcb58046bdc7aa55e3"
}
HTTP 200. Call candidates.get with the flagged id and expect 404; call candidates.get with $.candidate.id and confirm the moved applications and a candidate_merged activity entry.
Another supported request
Actual dispatcher and migration-created SQLite; verified Auth/workspace context, object storage, mail and Notify dependencies are simulated. No live delivery or credential authorization is established. This complete response is a local fixture, not a deployed or delivered result.
Input · payload.json:
{
"id": "cand_d3ef9b1f019f4cfe896ff32117662300"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.merge --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.merge --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_recruit.candidates.merge --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_recruit.candidates.merge",
"input": {
"id": "cand_d3ef9b1f019f4cfe896ff32117662300"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"candidate": {
"id": "cand_5cc69876540244c8add646d60073dd09",
"firstName": "Ada",
"lastName": "Lovelace",
"email": "ada@example.com",
"phone": null,
"location": null,
"profileUrl": null,
"source": "manual",
"sourceDetail": null,
"tags": [],
"status": "archived",
"consentAt": "2026-12-01T00:00:00.000Z",
"consentNotice": "Newer",
"retainUntil": null,
"createdBy": "u_admin",
"createdAt": "2026-10-05T09:00:00.000Z",
"updatedAt": "2026-10-05T09:00:00.000Z",
"duplicateOf": null
},
"mergedCandidateId": "cand_d3ef9b1f019f4cfe896ff32117662300"
}
HTTP 200. Call candidates.get with the flagged id and expect 404; call candidates.get with $.candidate.id and confirm the moved applications and a candidate_merged activity entry.
Refused request · not_found
Actual dispatcher and migration-created SQLite; verified Auth/workspace context, object storage, mail and Notify dependencies are simulated. No live delivery or credential authorization is established. This is a refused request; diagnose it before retrying.
Input · payload.json:
{
"id": "cand_flagged_example"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.merge --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.merge --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 404:
{
"error": {
"code": "not_found",
"message": "Candidate was not found in this workspace."
}
}
HTTP 404. Preserve the exact response code and details. Do not claim success.
Refused request · hiring_team_role_required
Actual dispatcher and migration-created SQLite; verified Auth/workspace context, object storage, mail and Notify dependencies are simulated. No live delivery or credential authorization is established. This is a refused request; diagnose it before retrying.
Input · payload.json:
{
"id": "cand_flagged_example"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.merge --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.merge --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 403:
{
"error": {
"code": "hiring_team_role_required",
"message": "Your hiring-team role in this workspace does not allow this action.",
"details": {
"teamRole": "hiring_manager",
"allowedRoles": [
"recruiter"
]
}
}
}
HTTP 403. Preserve the exact response code and details. Do not claim success.
Verify the result
- Call candidates.get with the flagged id and expect 404; call candidates.get with $.candidate.id and confirm the moved applications and a candidate_merged activity entry.
Errors and recovery
organization_context_required(HTTP 403): Select the organization authorized by the credential; do not send an organization id in the action input.permission_denied(HTTP 403): Inspect the required Recruit permission and the credential’s granted workspace access. Use an already authorized credential/scope or request the missing access from its owner. Change credentials or grants only under separate explicit authorization; do not expand permissions automatically to clear this refusal.hiring_team_role_required(HTTP 403): Ask a recruiter to give the caller a hiring-team role that allows this action (team.members.set); error.details lists the allowed roles.workspace_required(HTTP 409): Create a Recruit workspace, or pass the workspace resource context.invalid_input(HTTP 422): Correct the fields named in error.details using inputSchema, then retry.not_found(HTTP 404): List candidates to find a valid id. Records outside the caller's hiring-team view also answer 404.not_a_duplicate(HTTP 409): Only records with candidate.duplicateOf set can be merged; nothing changed.merge_target_missing(HTTP 409): The matched candidate was erased; keep working this record on its own. Nothing changed.merge_conflict(HTTP 409): Both records applied to the roles in error.details.roleIds, so they cannot be merged. Keep them separate, or erase the flagged record with candidates.erase if its application is redundant.invalid_json(HTTP 400): Send a valid JSON object. The request is rejected before workspace resolution or record creation.api_key_workspace_binding_required(HTTP 403): Use a key explicitly bound to the intended granted workspace. Inspect Auth api_keys.options before creating or changing a key, and obtain approval for any credential or access change; do not widen bindings automatically.workspace_required(HTTP 400): Send the workspace the key is bound to with --resource-type workspace --resource-id <workspace id> (or the X-Topolo-Resource-Type and X-Topolo-Resource-Id headers).workspace_forbidden(HTTP 403): Use a workspace the key is bound to; read the key's bindings in API key management.workspace_access_insufficient(HTTP 403): The required workspace permission is workspace:read for reads or workspace:write for changes, including deletion. Inspect the authorized key options and resource access; request any missing access from its owner rather than granting it automatically.api_key_scope_required(HTTP 403): Read requiredScope in the refusal and inspect Auth api_keys.options for the authorized operation. Request any needed access from its owner; create or update a key only with explicit approval. Do not retry an unchanged 403 or widen scopes automatically.
Authentication or gateway failures may occur before the Recruit handler. Preserve the exact discovered service error, request id and credential context. The local fixtures do not establish live credential authorization.
Recovery boundary
A merge cannot be undone: the flagged record is deleted and its data now belongs to the existing candidate.
Related actions
- Get a candidate: Read one candidate's profile: contact details, source, tags, consent and retention date, their applications (with answers and cover letter), documents (metadata; fetch content with candidates.documents.get) and activity timeline, newest first. Only applications on roles the caller may see are included. candidate.duplicateOf is set on a job-board record that used this existing candidate's email; possibleDuplicates lists such records pointing at this candidate (id, name, createdAt) for a recruiter to compare and merge.
Evidence
Actual dispatcher and migration-created SQLite or Worker handlers; Auth/workspace identity, object storage, mail and Notify dependencies are simulated. These synthetic fixtures establish no live authorization or delivery. Test capture provenance is retained with each fixture. API, database and integration outcomes require separate verification in the target environment.
Documentation history
2026-10-18
- Updated the precise merge response and current success/refusal examples.
- Updated this guide from source revision
63171ed7c08aa066adb44cc01e64011e465302e1; retained 4 source-captured request/response examples and their simulated-dependency limitations. - Clarified authorized API-key/resource recovery without automatic permission expansion. This documentation update does not establish deployment, live hiring operations or notification delivery.