Outcome
Import sourced or referred candidates from CSV text (header row required; columns email plus first_name and last_name or a single name column; optional phone, location, profile_url/linkedin, tags separated by ";" and source_detail). Up to 2000 rows. Always run mode preview first: it changes nothing and reports each row's outcome (create, add_application, existing, duplicate_in_file) and invalid rows by line. mode commit then applies the same plan. Candidates are deduplicated by email, so re-running a commit is idempotent. With roleId every new or existing candidate is added to that role's pipeline once. 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.import --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
topolo actions get app_topolo_recruit.roles.list --detail --json
Request
POST /api/candidates/import
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 |
|---|---|---|---|
csv | Required | string | {"minLength":1,"maxLength":2000000} |
mode | Required | string | {"enum":["preview","commit"]} |
source | Optional | string | {"enum":["imported","sourced","referral","agency"]} |
sourceDetail | Optional | Union | {} |
roleId | Optional | string | Role id from roles.list. Hiring managers must select a role they manage when creating a candidate. {"minLength":1,"maxLength":64} |
Exact input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"csv": {
"type": "string",
"minLength": 1,
"maxLength": 2000000
},
"mode": {
"type": "string",
"enum": [
"preview",
"commit"
]
},
"source": {
"type": "string",
"enum": [
"imported",
"sourced",
"referral",
"agency"
]
},
"sourceDetail": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"roleId": {
"type": "string",
"minLength": 1,
"maxLength": 64
}
},
"required": [
"csv",
"mode"
],
"additionalProperties": false
}
Effects
- In commit mode creates candidates (source imported unless given) and applications; preview changes nothing.
Interpret the response
Run the same import again in preview mode and confirm counts.create is 0.
This bulk result includes rejected and duplicate rows whose candidateId may be null. Read each row status before using a returned candidate id; there is no guaranteed identifier for every result row.
Exact success schema:
{
"type": "object",
"required": [
"mode",
"counts",
"rows"
],
"properties": {
"mode": {
"type": "string"
},
"counts": {
"type": "object"
},
"rows": {
"type": "array",
"items": {
"type": "object",
"properties": {
"line": {
"type": "integer"
},
"email": {
"type": "string"
},
"outcome": {
"type": "string"
},
"candidateId": {
"type": [
"string",
"null"
]
}
}
}
},
"invalid": {
"type": "array"
}
}
}
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:
{
"csv": "name,email\nAda Lovelace,ada@example.com\nAlan Turing,alan@example.com",
"mode": "commit",
"roleId": "role_85e56ddea54e4faea0f2ec5221cc9a1d"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.import --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.import --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_recruit.candidates.import --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.import",
"input": {
"csv": "name,email\nAda Lovelace,ada@example.com\nAlan Turing,alan@example.com",
"mode": "commit",
"roleId": "role_85e56ddea54e4faea0f2ec5221cc9a1d"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"mode": "commit",
"counts": {
"create": 1,
"add_application": 1,
"existing": 0,
"duplicate_in_file": 0,
"invalid": 0
},
"rows": [
{
"line": 2,
"email": "ada@example.com",
"outcome": "add_application",
"candidateId": "cand_597283f11b2446f28be377c258c8b395"
},
{
"line": 3,
"email": "alan@example.com",
"outcome": "create",
"candidateId": "cand_bbd0920db5a2437197f8bcb761709a43"
}
],
"invalid": []
}
HTTP 200. Run the same import again in preview mode and confirm counts.create is 0.
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:
{
"csv": "First Name,Last Name,Email,Phone,Location,LinkedIn,Tags,Referred by\r\nAda,Lovelace,ada@example.com,+44 1,London,https://example.com/ada,backend;ml,Grace\r\n\"Turing, Alan\",X,ALAN@example.com,,,,,\r\nAda,Again,ada@example.com,,,,,\r\nNo,Email,,,,,,\r\nSingle,,single@example.com,,,not-a-url,,",
"mode": "commit"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.import --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.import --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_recruit.candidates.import --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.import",
"input": {
"csv": "First Name,Last Name,Email,Phone,Location,LinkedIn,Tags,Referred by\r\nAda,Lovelace,ada@example.com,+44 1,London,https://example.com/ada,backend;ml,Grace\r\n\"Turing, Alan\",X,ALAN@example.com,,,,,\r\nAda,Again,ada@example.com,,,,,\r\nNo,Email,,,,,,\r\nSingle,,single@example.com,,,not-a-url,,",
"mode": "commit"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"mode": "commit",
"counts": {
"create": 0,
"add_application": 0,
"existing": 2,
"duplicate_in_file": 1,
"invalid": 2
},
"rows": [
{
"line": 2,
"email": "ada@example.com",
"outcome": "existing",
"candidateId": "cand_3e4c86e58d2240aa8abe7bfc30df4be3"
},
{
"line": 3,
"email": "alan@example.com",
"outcome": "existing",
"candidateId": "cand_420b9b7fe790424689780c390ef5338c"
},
{
"line": 4,
"email": "ada@example.com",
"outcome": "duplicate_in_file",
"candidateId": null
}
],
"invalid": [
{
"line": 5,
"email": null,
"error": "A valid email address is required."
},
{
"line": 6,
"email": "single@example.com",
"error": "A first and last name are required."
}
]
}
HTTP 200. Run the same import again in preview mode and confirm counts.create is 0.
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:
{
"csv": "name,email\nAda Lovelace,ada@example.com\nAlan Turing,alan@example.com",
"mode": "preview",
"roleId": "role_missing"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.import --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.import --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 404:
{
"error": {
"code": "not_found",
"message": "Role 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:
{
"csv": "first_name,last_name,email\nAda,Lovelace,ada@example.com",
"mode": "preview",
"source": "sourced"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.import --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.import --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
- Run the same import again in preview mode and confirm counts.create is 0.
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): Grant the credential the required Recruit workspace permission.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.invalid_csv(HTTP 422): Add a header row with an email column and name columns.import_too_large(HTTP 422): Split the file into imports of at most 2000 rows.not_found(HTTP 404): Use roles.list to find a role you manage.role_closed(HTTP 409): Reopen the role with roles.open first.invalid_json(HTTP 400): Send a valid JSON object. The request is rejected before workspace resolution or record creation.
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
Archive candidates created in error (their ids are in rows[].candidateId).
Related actions
- Archive a candidate: Archive a candidate: they leave active lists but their record, applications and documents are kept until retention or erasure. Adding them to a role again (applications.create, or candidates.import with roleId) reactivates them; a job-board application with their email never does, it becomes a separate record flagged duplicateOf them. Recruiters only.
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.