v1

latestOpenAPI 3.1.02026-07-24181585937.4 KB
Candidate

candidate.addEmailMessage

Attaches an existing email message (e.g. fetched from a partner provider) to a candidate.

Requires the candidatesWrite permission.

post/candidate.addEmailMessage

Request body

candidateIdstring uuid required

The candidate to attach this email to

emailProviderEmailIdstring required

Unique identifier for this message in the partner system. Must be unique per API key.

subjectstring required

The email subject line

fromstring required

The sender email address

tostring required

The recipient email address

bodystring required

The html body of the email

userIdstring uuid nullable

The Ashby user ID to associate with this email. Defaults to the API key user.

sentAtstring nullable

When the email was sent. Defaults to the current time.

ccstring nullable

CC recipients

messageUrlstring nullable

URL to view the message in the partner application

messageIdHeaderstring nullable

RFC 5322 message identifier

threadIdstring nullable

Thread identifier to group this message with others. Defaults to emailProviderEmailId.

isPrivateboolean nullable

Whether the email should be marked as private. Private emails require "Allow access to non-offer private fields?" API key permission to create and view. Defaults to false.

Example request

{
  "candidateId": "e9ed20fd-d45f-4aad-8a00-a19bfba0083e",
  "userId": "e9ed20fd-d45f-4aad-8a00-a19bfba0083e",
  "sentAt": "2022-07-21T17:32:28Z",
  "messageUrl": "https://example.com/messages/1234567890",
  "messageIdHeader": "<CADkMx=Abc123@examplemail.com>"
}

Response

Responses from the candidate.addEmailMessage endpoint

OR

Example response

{
  "success": true,
  "results": {
    "id": "9d8eb6b1-9b6f-4c9d-9c1e-5a07f9b4f9c0",
    "candidateId": "e9ed20fd-d45f-4aad-8a00-a19bfba0083e",
    "emailProviderEmailId": "msg-12345",
    "subject": "Re: Application",
    "from": "recruiter@example.com",
    "to": "adam.hart@example.com",
    "body": "<p>Thanks for applying!</p>",
    "sentAt": "2024-01-15T10:30:00.000Z",
    "cc": null,
    "messageUrl": null,
    "messageIdHeader": null,
    "threadId": "msg-12345",
    "isPrivate": false,
    "userIsSender": true
  }
}