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

# Update Contact Document

> Renames a document and/or activates or deactivates it. Deactivating keeps the document but stops it being attached to new calls — it is also the way to keep a contact's CV out of calls. Only completed (`READY`) documents can be toggled, and the `CV` document cannot be renamed. At least one of `title` or `isActive` is required.

Renames a contact document and/or controls whether agents may use it.

## Overview

Send `title`, `isActive`, or both. An empty body is a `400`.

**Deactivating** keeps the document but stops it being attached to new calls. It is also the way to keep a contact's CV out of calls while keeping the CV itself: set `isActive: false` on the document whose `source` is `CV`. Nothing about the contact's processing changes; the agent simply no longer has the document to look up.

The `CV` document cannot be **renamed** — its title is set by the platform and would be reset the next time the CV was synced. Only completed (`READY`) documents can be toggled; a `PENDING` upload is a `409`.

## Example

```bash theme={null}
# Keep this contact's CV out of calls
curl -X PATCH https://api.instaview.sk/contacts/$CONTACT_ID/documents/$CV_DOCUMENT_ID \
  -H "Authorization: Bearer $INSTAVIEW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "isActive": false }'
```

```json theme={null}
{
  "id": "8b2e1f40-3c4d-4e5f-9a6b-7c8d9e0f1a2b",
  "title": "CV",
  "fileName": "jana-novakova-cv.pdf",
  "mimeType": "text/markdown",
  "status": "READY",
  "isActive": false,
  "source": "CV",
  "createdAt": "2026-09-05T08:12:00.000Z"
}
```

## Error Scenarios

* **400 Bad Request**: Neither `title` nor `isActive` was provided
* **404 Not Found**: No such document on that contact
* **409 Conflict**: The upload has not been completed yet, or the request renames the `CV` document

## Related Resources

* [List Contact Documents](/api-reference/contacts/documents/list-documents)
* [Delete Contact Document](/api-reference/contacts/documents/delete-document)


## OpenAPI

````yaml PATCH /contacts/{id}/documents/{documentId}
openapi: 3.0.0
info:
  title: InstaView API
  description: |-
    InstaView API Documentation

    ## Authentication

    All endpoints require API key authentication using Bearer token:
    ```
    Authorization: Bearer sk_your_api_key_here
    ```

    ## API Key Management

    The API Key module provides comprehensive key management for:
    - **Direct Client Keys**: Company-scoped keys for your applications
    - **ATS Partner Keys**: Resource-scoped keys for ATS integrations

    ### Key Features
    - HMAC-SHA256 hashing for API key storage
    - Configurable rate limiting
    - Comprehensive audit logging
    - Company-level isolation
    - Resource scoping for ATS partners
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.instaview.sk
    description: Production API Gateway
security: []
tags: []
paths:
  /contacts/{id}/documents/{documentId}:
    patch:
      tags:
        - Contacts
      summary: Rename or activate/deactivate a contact document
      description: >-
        Renames a document and/or activates or deactivates it. Deactivating
        keeps the document but stops it being attached to new calls — it is also
        the way to keep a contact's CV out of calls. Only completed (`READY`)
        documents can be toggled, and the `CV` document cannot be renamed. At
        least one of `title` or `isActive` is required.
      operationId: PublicContactDocumentsController_updateDocument_v1
      parameters:
        - name: id
          required: true
          in: path
          description: Contact the document belongs to.
          schema:
            type: string
            format: uuid
        - name: documentId
          required: true
          in: path
          description: Document id.
          schema:
            type: string
            format: uuid
        - name: companyId
          required: false
          in: query
          description: >-
            Required for ATS API keys to specify which company to access.
            Ignored for standard company API keys.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicUpdateContactDocumentDto'
      responses:
        '200':
          description: Document updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeDocumentDto'
        '400':
          description: Neither `title` nor `isActive` was provided.
        '404':
          description: No such document on that contact.
        '409':
          description: >-
            The document's upload has not been completed yet, or the request
            renames the `CV` document.
      security:
        - bearer: []
components:
  schemas:
    PublicUpdateContactDocumentDto:
      type: object
      minProperties: 1
      properties:
        title:
          type: string
          maxLength: 255
          example: Cover letter (2026)
          description: >-
            New human-readable label for the document. Not accepted for the `CV`
            document, whose title is set by the platform.
        isActive:
          type: boolean
          example: false
          description: >-
            Whether agents may consult this document during a call. Deactivating
            keeps the document — it simply stops being attached to new calls.
            Only `READY` documents can be toggled.
    PublicKnowledgeDocumentDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Document ID
        title:
          type: string
          example: Benefits and perks
          description: Human-readable label for the document
        fileName:
          type: string
          example: benefits-and-perks.pdf
          description: Original file name as uploaded
        mimeType:
          type: string
          example: application/pdf
          description: MIME type of the stored file
        sizeBytes:
          type: number
          example: 482133
          description: >-
            Size of the stored file in bytes, as verified against storage.
            Absent until the upload is READY.
        status:
          type: string
          enum:
            - PENDING
            - READY
          example: READY
          description: >-
            `PENDING` while waiting for the file to be uploaded to the presigned
            URL and the upload to be completed; `READY` once the file is
            confirmed stored. Only READY documents are attached to calls.
        isActive:
          type: boolean
          example: true
          description: >-
            Whether the agent may consult this document during a call. Always
            false while the upload is PENDING.
        source:
          type: string
          enum:
            - UPLOAD
            - CV
          example: UPLOAD
          description: >-
            `UPLOAD` for a file attached through the API or the dashboard. `CV`
            for the document the platform produces from a contact's processed CV
            (contacts only); a `CV` document can be deactivated but not renamed
            or deleted. Always `UPLOAD` on an agent's knowledge base.
        createdAt:
          format: date-time
          type: string
          example: '2026-08-08T10:15:00.000Z'
          description: When the document was created
      required:
        - id
        - title
        - status
        - isActive
        - source
        - createdAt
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: API key for authentication using Bearer scheme

````