---
title: "Attach file to candidate in context of given job."
method: POST
path: "/candidates/{id}/jobs/{jobId}/attachments"
tags: ["candidates"]
---

# Attach file to candidate in context of given job.

`POST /candidates/{id}/jobs/{jobId}/attachments`

## Request

- Base URL: `https://api.smartrecruiters.com`
- URL: `https://api.smartrecruiters.com/candidates/{id}/jobs/{jobId}/attachments`
- Auth: one of:
  - API key in header `x-smarttoken`
  - OAuth 2
    - Authorization code: `https://www.smartrecruiters.com/identity/oauth/allow`
    - Token URL: `https://api.smartrecruiters.com/identity/oauth/token` scopes: `candidates_create`

Attach file to candidate in context of given job.

## Request body `multipart/form-data`

- object
  - `attachmentType` 'GENERIC_FILE' | 'RESUME' | 'COVER_LETTER', required: Type of attachment you want to upload.
  - `file` string, binary: File to upload.

## Response `201`

Candidate's attachment in context of given job.

- CandidateAttachmentForJob
  - `id` string, required
  - `name` string, required
  - `type` string, required
  - `contentType` string, required
  - `actions` object
    - `download` Action, required
      - `url` string, required
      - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'OPTIONS' | 'DELETE' | 'HEAD' | 'CONNECT', required
    - `remove` Action, required
      - `url` string, required
      - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'OPTIONS' | 'DELETE' | 'HEAD' | 'CONNECT', required

## Other responses

- `400`: with codes: * **FILE_ALREADY_EXIST** when file already exists, * **INVALID_FILE** when file extension not allowed, corrupted file or wrong file type, * **FILE_NOT_PROVIDED** when file is not provided.
- `403`: with code **PERMISSION_DENIED** when you are not permitted to add file to candidate in context of given job.
- `404`: with code **JOB_NOT_FOUND** when candidate is not assigned to given job.
- `422`: with code **ATTACHMENT_LIMIT_EXCEEDED** when no more files can be added to candidate in context of given job.

---

[API](https://skmtc.dev/smartrecruiters/apis/candidates-api.md) - [All operations](https://skmtc.dev/smartrecruiters/apis/candidates-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smartrecruiters/apis/candidates-api/revisions/8fde9b33d46d?raw)
