---
title: "Assign temporary attachments to records"
method: POST
path: "/attachments/temporary/assign"
tags: ["Attachments"]
---

# Assign temporary attachments to records

`POST /attachments/temporary/assign`

Step 2 of the two-step upload flow: assigns temporary attachments previously created via `POST /attachments/temporary` to one or more records (candidate, company, or vacancy), making them permanent. The attachment's type is intended to be set here — each attachment specifies a `type`, either a predefined type (`{ name }`) or a custom, tenant-defined type (`{ id }`), and can optionally be renamed. At least one of candidateId, companyId, or vacancyId must be provided. The type must be allowed for all records the attachment is linked to: the predefined `CV` type can only be assigned to attachments linked to a candidate, and custom types define which record types they support.

## Request body

- AssignAttachmentsDto
  - `attachments` AssignAttachmentDto[], required — List of temporary attachments to assign. Each attachment must include the ID returned from the upload endpoint, the desired attachment type, and optionally a new name for the file.
    - `id` string, required — ID of the temporary attachment to assign. This is the ID returned from the upload temporary attachment endpoint.
    - `type` union, required
      - object
        - `id` string, required
      - object
        - `name` 'UNASSIGNED' | 'CV', required
      - 'UNASSIGNED' | 'CV'
    - `name` string — Optional new name for the attachment. If not provided, the original filename from upload is preserved.
  - `candidateIds` string[] — IDs of the candidates to link the attachments to. Fully replaces the existing candidate links. At least one of candidateIds, companyIds, or vacancyIds must be provided.
  - `companyIds` string[] — IDs of the companies to link the attachments to. Fully replaces the existing company links. At least one of candidateIds, companyIds, or vacancyIds must be provided.
  - `vacancyIds` string[] — IDs of the vacancies/jobs to link the attachments to. Fully replaces the existing vacancy links. At least one of candidateIds, companyIds, or vacancyIds must be provided.
  - `candidateId` string — [DEPRECATED] Use candidateIds instead. ID of a single candidate to link the attachments to; merged into candidateIds.
  - `companyId` string — [DEPRECATED] Use companyIds instead. ID of a single company to link the attachments to; merged into companyIds.
  - `vacancyId` string — [DEPRECATED] Use vacancyIds instead. ID of a single vacancy/job to link the attachments to; merged into vacancyIds.

## Response `204`

Attachments assigned successfully

## Other responses

- `400` — Bad request - invalid attachment IDs, missing record link (at least one of candidateId, companyId, or vacancyId required), invalid attachment type, or attachment type not allowed for the linked record
- `401` — Unauthorized - invalid or missing authentication
- `404` — Attachment not found - one or more attachment IDs do not exist
- `500` — Error response

---

[API](https://skmtc.net/spott/apis/spott-webhooks.md) · [All operations](https://skmtc.net/spott/apis/spott-webhooks/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spott/spott-webhooks/versions/ad1f8c51cf0a/schema)
