Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions components/ashby/actions/create-application/create-application.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import app from "../../ashby.app.mjs";

export default {
key: "ashby-create-application",
name: "Create Application",
description: "Considers a candidate for a job (e.g., when sourcing a candidate for a job posting). [See the documentation](https://developers.ashbyhq.com/reference/applicationcreate)",
version: "0.0.1",
type: "action",
annotations: {
readOnlyHint: false,
destructiveHint: false,
openWorldHint: true,
},
props: {
app,
candidateId: {
propDefinition: [
app,
"candidateId",
],
description: "The ID of the candidate to create an application for",
},
jobId: {
propDefinition: [
app,
"jobId",
],
description: "The ID of the job to apply for",
},
interviewPlanId: {
optional: true,
propDefinition: [
app,
"interviewPlanId",
],
},
interviewStageId: {
optional: true,
propDefinition: [
app,
"interviewStageId",
({ interviewPlanId }) => ({
interviewPlanId,
}),
],
},
sourceId: {
optional: true,
propDefinition: [
app,
"sourceId",
],
},
creditedToUserId: {
label: "Credited To User ID",
description: "The ID of the user the application will be credited to",
optional: true,
propDefinition: [
app,
"userId",
],
},
createdAt: {
type: "string",
label: "Created At",
description: "An ISO date string to set the application's createdAt timestamp (e.g., `2024-01-15T10:30:00Z`). Defaults to the current time if not provided.",
optional: true,
},
},
async run({ $ }) {
const {
app,
candidateId,
jobId,
interviewPlanId,
interviewStageId,
sourceId,
creditedToUserId,
createdAt,
} = this;

const response = await app.createApplication({
$,
data: {
candidateId,
jobId,
interviewPlanId,
interviewStageId,
sourceId,
creditedToUserId,
createdAt,
},
});

$.export("$summary", `Successfully created application with ID \`${response.results?.id}\``);

return response;
},
};
141 changes: 141 additions & 0 deletions components/ashby/actions/create-candidate/create-candidate.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import app from "../../ashby.app.mjs";

export default {
key: "ashby-create-candidate",
name: "Create Candidate",
description: "Creates a new candidate in Ashby. [See the documentation](https://developers.ashbyhq.com/reference/candidatecreate)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
name: {
propDefinition: [
app,
"name",
],
},
email: {
propDefinition: [
app,
"email",
],
description: "Primary, personal email of the candidate to be created",
},
phoneNumber: {
type: "string",
label: "Phone Number",
description: "Primary, personal phone number of the candidate to be created",
optional: true,
},
linkedInUrl: {
type: "string",
label: "LinkedIn URL",
description: "URL to the candidate's LinkedIn profile. Must be a valid URL.",
optional: true,
},
githubUrl: {
type: "string",
label: "GitHub URL",
description: "URL to the candidate's GitHub profile. Must be a valid URL.",
optional: true,
},
website: {
type: "string",
label: "Website",
description: "URL of the candidate's website. Must be a valid URL.",
optional: true,
},
alternateEmailAddresses: {
type: "string[]",
label: "Alternate Email Addresses",
description: "Array of alternate email addresses to add to the candidate's profile",
optional: true,
},
sourceId: {
propDefinition: [
app,
"sourceId",
],
description: "The source to set on the candidate being created",
optional: true,
},
creditedToUserId: {
propDefinition: [
app,
"userId",
],
label: "Credited To User ID",
description: "The ID of the user the candidate will be credited to",
optional: true,
},
city: {
type: "string",
label: "City",
description: "The city of the candidate's location",
optional: true,
},
region: {
type: "string",
label: "Region",
description: "The region (state, province, etc.) of the candidate's location",
optional: true,
},
country: {
type: "string",
label: "Country",
description: "The country of the candidate's location",
optional: true,
},
},
async run({ $ }) {
const {
app,
email,
name,
phoneNumber,
linkedInUrl,
githubUrl,
website,
alternateEmailAddresses,
sourceId,
creditedToUserId,
city,
region,
country,
} = this;

const response = await app.createCandidate({
$,
data: {
name,
email,
phoneNumber,
linkedInUrl,
githubUrl,
website,
alternateEmailAddresses,
sourceId,
creditedToUserId,
...(city || region || country
? {
location: {
city,
region,
country,
},
}
: undefined
),
},
});

$.export("$summary", "Successfully created candidate");

return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import app from "../../ashby.app.mjs";
import utils from "../../common/utils.mjs";

export default {
key: "ashby-create-interview-schedule",
name: "Create Interview Schedule",
description: "Creates a scheduled interview. [See the documentation](https://developers.ashbyhq.com/reference/interviewschedulecreate)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
app,
applicationId: {
propDefinition: [
app,
"applicationId",
],
description: "The ID of the application to schedule an interview for",
},
interviewEvents: {
type: "string[]",
label: "Interview Events",
description: `Array of interview events. Each event should contain:
- **startTime** (string, required): Interview start time in ISO 8601 format (e.g., 2023-01-30T15:00:00.000Z)
- **endTime** (string, required): Interview end time in ISO 8601 format (e.g., 2023-01-30T16:00:00.000Z)
- **interviewers** (array, required): Array of interviewer objects with:
- **email** (string, required): Email address of the interviewer
- **feedbackRequired** (boolean, optional): Whether feedback from this interviewer is required

Example:
\`\`\`json
[
{
"startTime": "2023-01-30T15:00:00.000Z",
"endTime": "2023-01-30T16:00:00.000Z",
"interviewers": [
{
"email": "interview@example.com",
"feedbackRequired": true
}
]
}
]
\`\`\`
`,
},
},
async run({ $ }) {
const {
app,
applicationId,
interviewEvents,
} = this;

const response = await app.createInterviewSchedule({
$,
data: {
applicationId,
interviewEvents: utils.parseJson(interviewEvents),
},
});

$.export("$summary", "Successfully created interview schedule");

return response;
},
};
78 changes: 78 additions & 0 deletions components/ashby/actions/create-offer/create-offer.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import app from "../../ashby.app.mjs";
import utils from "../../common/utils.mjs";

export default {
key: "ashby-create-offer",
name: "Create Offer",
description: "Creates a new offer. [See the documentation](https://developers.ashbyhq.com/reference/offercreate)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
app,
offerProcessId: {
propDefinition: [
app,
"offerProcessId",
],
},
offerFormId: {
type: "string",
label: "Offer Form ID",
description: "The ID of the form associated with the offer. The ID is included in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).",
},
fieldSubmissions: {
type: "string[]",
label: "Field Submissions",
description: `Array of field submission objects. Each object should contain:
- **path** (string, required): The form field's "path" value
- **value** (string, required): The field value (can be a primitive or complex type depending on field type)

You can find these referebce values in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo in description.

"referebce" should be "reference".

Apply this diff:

-You can find these referebce values in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).
+You can find these reference values in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
You can find these referebce values in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).
You can find these reference values in the response of the [offer.start API](https://developers.ashbyhq.com/reference/offerstart).
🤖 Prompt for AI Agents
In components/ashby/actions/create-offer/create-offer.mjs around line 35,
there's a typo in the inline description: change "referebce" to "reference" so
the sentence reads "You can find these reference values in the response of the
[offer.start API](https://developers.ashbyhq.com/reference/offerstart)." Make
this single-word correction and keep the rest of the text and link unchanged.


Each item can be a JSON string or object with the structure:
\`\`\`json
[
{
"path": "96377e55-cd34-49e2-aff0-5870ec102360",
"value": "2025-11-07"
},
{
"path": "ded2358d-443f-484f-91fa-ec7a13de842b",
"value": {
"value": 10000,
"currencyCode": "USD"
}
}
]
\`\`\``,
},
},
async run({ $ }) {
const {
app,
offerProcessId,
offerFormId,
fieldSubmissions,
} = this;

const response = await app.createOffer({
$,
data: {
offerProcessId,
offerFormId,
offerForm: {
fieldSubmissions: utils.parseJson(fieldSubmissions),
},
},
});

$.export("$summary", `Successfully created offer for process ${offerProcessId}`);

return response;
},
};
Loading
Loading