Outcome
Send a transactional email to a candidate through Nexus, from a template (templateId) or with your own subject and body. It is sent from the organization's own sender identity when one is configured, otherwise from Recruit's shared sender on the organization's behalf. Without applicationId the candidate's most recent application gives {{role.title}}. Nothing is sent while any merge field is unresolved. Merge fields: {{candidate.first_name}}, {{candidate.last_name}}, {{candidate.full_name}}, {{role.title}} (the application's role), {{company.name}} (the job board title), {{sender.name}} (the caller's name), and {{interview.title}}, {{interview.when}}, {{interview.location}} (from values).
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.emails.send --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.applications.list --detail --json
topolo actions get app_topolo_recruit.email_templates.list --detail --json
Request
POST /api/candidates/{id}/emails
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} |
applicationId | Optional | string | Application id from applications.list in the same workspace. {"minLength":1,"maxLength":64} |
templateId | Optional | string | Template id from email_templates.list; inspect kind and active status before using it. {"minLength":1,"maxLength":64} |
subject | Optional | string | {"minLength":1,"maxLength":300} |
body | Optional | string | {"minLength":1,"maxLength":20000} |
values | Optional | object | {} |
Exact input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"applicationId": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"templateId": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"subject": {
"type": "string",
"minLength": 1,
"maxLength": 300
},
"body": {
"type": "string",
"minLength": 1,
"maxLength": 20000
},
"values": {
"type": "object",
"properties": {
"interview.title": {
"type": "string",
"maxLength": 200
},
"interview.when": {
"type": "string",
"maxLength": 200
},
"interview.location": {
"type": "string",
"maxLength": 500
}
},
"additionalProperties": false
}
},
"required": [
"id"
],
"additionalProperties": false
}
Effects
- Sends one email and records it on the candidate's timeline and email log (also when it fails).
Interpret the response
Call candidates.emails.list and confirm the email and its status.
The response identifier path is $.email.id for candidate_email. Lists may be empty; an empty list is not a discovered target.
Exact success schema:
{
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"status": {
"type": "string"
},
"error": {
"type": [
"string",
"null"
]
},
"messageId": {
"type": [
"string",
"null"
]
}
}
}
}
}
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_62ee38ce9eb54716bd78a59ab686fb10",
"subject": "Hello",
"body": "Secret body"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.emails.send --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.emails.send --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_recruit.candidates.emails.send --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.emails.send",
"input": {
"id": "cand_62ee38ce9eb54716bd78a59ab686fb10",
"subject": "Hello",
"body": "Secret body"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 201:
{
"email": {
"id": "eml_116f6066116c45b1b3625d208a0100d8",
"status": "sent",
"error": null,
"messageId": "e"
}
}
HTTP 201. Call candidates.emails.list and confirm the email and its status.
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_16181d6f07674ffba717f8aeebdd5a5c",
"subject": "Hi",
"body": "Hello"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.emails.send --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.emails.send --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_recruit.candidates.emails.send --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.emails.send",
"input": {
"id": "cand_16181d6f07674ffba717f8aeebdd5a5c",
"subject": "Hi",
"body": "Hello"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 201:
{
"email": {
"id": "eml_a076c619fa4a4c86a952395b38f1c79a",
"status": "sent",
"error": null,
"messageId": "e"
}
}
HTTP 201. Call candidates.emails.list and confirm the email and its status.
Refused request · unresolved_merge_fields
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_3fe8142b3ce44fffacef423b2762206e",
"subject": "{{role.title}} {{company.name}} {{sender.name}}",
"body": "x"
}
CLI:
topolo actions validate app_topolo_recruit.candidates.emails.send --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.emails.send --resource-type workspace --resource-id "$RECRUIT_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 422:
{
"error": {
"code": "unresolved_merge_fields",
"message": "These merge fields have no value: role.title, company.name, sender.name.",
"details": {
"unresolved": [
"role.title",
"company.name",
"sender.name"
]
}
}
}
HTTP 422. 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_example",
"templateId": "tpl_example",
"values": {
"interview.title": "Technical interview",
"interview.when": "Tue 6 Oct, 10:00 BST",
"interview.location": "Video call"
}
}
CLI:
topolo actions validate app_topolo_recruit.candidates.emails.send --data @payload.json --json
topolo actions plan app_topolo_recruit.candidates.emails.send --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": "interviewer",
"allowedRoles": [
"recruiter",
"hiring_manager"
]
}
}
}
HTTP 403. Preserve the exact response code and details. Do not claim success.
Verify the result
- Call candidates.emails.list and confirm the email and its status.
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.not_found(HTTP 404): List candidates, applications or email templates to find a valid id. Records outside the caller's hiring-team view also answer 404.unknown_merge_fields(HTTP 422): Use only the merge fields listed in the description.unresolved_merge_fields(HTTP 422): error.details.unresolved names the fields with no value: set the job board title (job_board.update), pass values, or choose an application.template_or_content_required(HTTP 422): Send templateId alone, or subject and body together.email_failed(HTTP 502): email.error says why; fix it (for example the recipient outside production must be an approved test inbox) and send again.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
An email cannot be recalled once sent.
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.