> ## Documentation Index
> Fetch the complete documentation index at: https://docs.harmonyforstaffing.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload File

> Upload a file

Upload a file attachment associated with a candidate, job, or job submission. Supports both multipart form-data and base64 encoded files.

### Body Parameters

<ParamField body="file" type="file">
  The file to upload (when using multipart/form-data)
</ParamField>

<ParamField body="base64Content" type="string">
  Base64 encoded file content (when not using multipart/form-data)
</ParamField>

<ParamField body="fileName" type="string" required>
  Name of the file including extension
</ParamField>

<ParamField body="contentType" type="string" required>
  MIME type of the file (e.g., "application/pdf", "image/jpeg")
</ParamField>

<ParamField body="candidateId" type="number">
  ID of the associated candidate (if applicable)
</ParamField>

<ParamField body="type" type="string" required>
  Type of file being uploaded (e.g., "resume", "certification", "contract")
</ParamField>

<ParamField body="description" type="string">
  Optional description of the file
</ParamField>

### Response

<ResponseField name="id" type="number">
  The unique identifier for the uploaded file
</ResponseField>

<ResponseField name="url" type="string">
  URL where the file can be accessed
</ResponseField>

<ResponseField name="createdAt" type="string">
  Timestamp of when the file was uploaded
</ResponseField>

<RequestExample>
  ```bash Multipart Form Data theme={null}
  curl --request POST \
    --url https://api.harmonyforstaffing.com/api/file \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: multipart/form-data' \
    --form 'file=@/path/to/resume.pdf' \
    --form 'fileName=resume.pdf' \
    --form 'contentType=application/pdf' \
    --form 'candidateId=456' \
    --form 'type=resume' \
    --form 'description=Updated resume March 2024'
  ```

  ```bash Base64 theme={null}
  curl --request POST \
    --url https://api.harmonyforstaffing.com/api/file \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "base64Content": "JVBERi0xLjcKCjEgMCBvYmogICUgZW50...",
      "fileName": "resume.pdf",
      "contentType": "application/pdf",
      "candidateId": 456,
      "type": "resume",
      "description": "Updated resume March 2024"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": 999,
    "url": "https://storage.harmonyforstaffing.com/files/resume-123.pdf",
    "fileName": "resume-123.pdf",
    "contentType": "application/pdf",
    "size": 1048576,
    "candidateId": 456,
    "type": "resume",
    "description": "Updated resume March 2024",
    "createdAt": "2024-03-19T18:30:00Z"
  }
  ```
</ResponseExample>
