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

# Upload person document

> Upload a document (resume, cover letter, etc.) for a person. Supports two modes:

**1. Direct file upload** (`Content-Type: multipart/form-data`):
Send the file in a `file` field along with metadata fields (`title`, `type`, `visible_in_share_links`).
Allowed file types: PDF, DOC, DOCX, PNG, JPG, JPEG. Max size: 25 MB.

**2. JSON body** (`Content-Type: application/json`):
Provide a `file_url` — a publicly accessible HTTPS URL. The server downloads the file, validates it, and stores it.



## OpenAPI

````yaml /api-reference/openapi-v1.json post /v1/persons/{id}/documents
openapi: 3.1.0
info:
  title: Stardex API (v1)
  version: 1.0.0
  description: >-
    Stardex ATS API — manage candidates, jobs, companies, and recruiting
    workflows.
servers:
  - url: https://api.stardex.ai
    description: Production API server
security:
  - bearerAuth: []
tags:
  - name: Persons
    description: Manage person records — contacts, work history, and custom fields.
  - name: Jobs
    description: Manage job postings — pipeline stages, team members, and custom fields.
  - name: Candidates
    description: Manage candidate records and pipeline stage transitions.
  - name: Companies
    description: Browse and retrieve company records.
  - name: Lists
    description: Create, search, and retrieve saved person and company lists.
  - name: Person Activities
    description: Create and manage activity records (notes, emails, meetings) for persons.
  - name: Team Members
    description: List team members for use in search filters and assignments.
  - name: Custom Fields
    description: Retrieve custom field definitions and tag options for search filters.
paths:
  /v1/persons/{id}/documents:
    post:
      tags:
        - Persons
      summary: Upload person document
      description: >-
        Upload a document (resume, cover letter, etc.) for a person. Supports
        two modes:


        **1. Direct file upload** (`Content-Type: multipart/form-data`):

        Send the file in a `file` field along with metadata fields (`title`,
        `type`, `visible_in_share_links`).

        Allowed file types: PDF, DOC, DOCX, PNG, JPG, JPEG. Max size: 25 MB.


        **2. JSON body** (`Content-Type: application/json`):

        Provide a `file_url` — a publicly accessible HTTPS URL. The server
        downloads the file, validates it, and stores it.
      operationId: uploadPersonDocument
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            description: Person ID
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DocumentUploadMultipart'
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentUploadRequest'
      responses:
        '201':
          description: Document uploaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUploadResponse'
              example:
                success: true
                data:
                  id: eee55555-ffff-0000-1111-222222225555
                  created_at: '2024-02-01T10:00:00Z'
                  updated_at: '2024-02-01T10:00:00Z'
                  type: resume_doc
                  title: John_Doe_Resume.pdf
                  link: https://signed-url.example.com/...
                  visible_in_share_links: false
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
components:
  schemas:
    DocumentUploadMultipart:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: >-
            The file to upload. Allowed types: PDF, DOC, DOCX, PNG, JPG, JPEG.
            Max size: 25 MB.
        title:
          type: string
          description: Document title. Defaults to the original filename if omitted.
        type:
          type: string
          minLength: 1
          maxLength: 100
          description: >-
            Team document type key. Seeded values include resume_doc,
            resume_link, cover_letter, reference, additional_links, transcript,
            work_sample, offer_letter, assessment, and other. Teams may add
            custom values.
        visible_in_share_links:
          type: boolean
          description: >-
            Whether to show this document in candidate share links. Defaults to
            false.
      required:
        - file
        - type
    DocumentUploadRequest:
      type: object
      properties:
        file_url:
          type: string
          format: uri
          description: >-
            Publicly accessible HTTPS URL of a file to download and store. The
            server fetches the file, validates its type and size (max 25 MB),
            and stores it.
        title:
          type: string
          minLength: 1
          maxLength: 255
          description: >-
            Document title or filename (e.g. "John_Doe_Resume.pdf"). Defaults to
            the downloaded filename.
        type:
          type: string
          minLength: 1
          maxLength: 100
          description: >-
            Team document type key. Seeded values include resume_doc,
            resume_link, cover_letter, reference, additional_links, transcript,
            work_sample, offer_letter, assessment, and other. Teams may add
            custom values.
        visible_in_share_links:
          type: boolean
          default: false
          description: Whether to show this document in candidate share links.
      required:
        - file_url
        - type
    DocumentUploadResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            id:
              type: string
              description: Created document UUID.
            created_at:
              type: string
              description: ISO 8601 timestamp.
            updated_at:
              type: string
              description: ISO 8601 timestamp.
            type:
              type: string
              description: Document type.
            title:
              type:
                - string
                - 'null'
              description: Document title.
            link:
              type: string
              description: Signed download URL. Empty if external-only.
            visible_in_share_links:
              type: boolean
              description: Whether visible in share links.
          required:
            - id
            - created_at
            - updated_at
            - type
            - title
            - link
            - visible_in_share_links
      required:
        - success
        - data
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Authenticate with a Bearer token: API key, OAuth token, or session
        token.

````