/candidates /attachments – insert

Description

Enables attaching files to a candidate’s profile.

Request

POST https://api.smartrecruiters.com/candidates/{candidateId}/attachments

Path Parameters

name type description
candidateId string Identifier of a candidate for which we want to upload an attachment

Request Header Parameters

name type description
attachmentType string

Describes what type of attachment you want to upload. Available values:
GENERIC_FILE
IMAGE
URL
AVATAR
RESUME
COVER_LETTER
LOGO
ASSESSMENT_RESULT

file string The file you want to upload

Request Body

To attach a file to a candidate, please ensure that the POST request body has the following shape:

------WebKitFormBoundaryuPNOUdglC290WJJq
Content-Disposition: form-data; name="attachmentType"

GENERIC_FILE
------WebKitFormBoundaryuPNOUdglC290WJJq
Content-Disposition: form-data; name="file"; filename="cover_letter.txt"
Content-Type: text/plain


------WebKitFormBoundaryuPNOUdglC290WJJq--


------WebKitFormBoundaryuPNOUdglC290WJJq--

Response Body

Instance of the CandidateAttachment object

Example request

POST /candidates/cde81956-321a-4af9-b78d-19632a29d94e/attachments HTTP/1.1
Host: api.smartrecruiters.com
Content-Length: 319
Origin: https://api.smartrecruiters.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryuPNOUdglC290WJJq
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
X-SmartToken: 123abc
Referer: https://api.smartrecruiters.com/docs/
Accept-Encoding: gzip, deflate

Example response

{
  "id": "51c3800a-cece-4bb3-8e17-4ecb24a60613",
  "name": "cover_letter.txt",
  "type": "GENERIC_FILE",
  "contentType": "text/plain",
  "actions": {
    "download": {
      "url": "https://api.smartrecruiters.com/candidates/cde81956-321a-4af9-b78d-19632a29d94e/attachments/51c3800a-cece-4bb3-8e17-4ecb24a60613",
      "method": "GET"
    }
  }
}