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

# Update analysis item attachments

> Attach or detach one analysis item on multiple agent branches.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/convai/analysis-items/{analysis_item_id}/attachments
openapi: 3.1.0
info:
  title: Threetone API
  description: >-
    APIs for the Threetone Agents Platform and shared workspace resources.
    Authenticate programmatic requests with an API key in the x-api-key header.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/convai/analysis-items/{analysis_item_id}/attachments:
    patch:
      tags:
        - Agents Platform
      summary: Update analysis item attachments
      description: Attach or detach one analysis item on multiple agent branches.
      operationId: update_analysis_item_attachments_route
      parameters:
        - name: analysis_item_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the requested analysis item.
            title: Analysis Item Id
          description: ID of the requested analysis item.
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Your API key for programmatic access. Send it in the x-api-key
              header; you can create and manage keys from the Developers page.
            title: X-Api-Key
          description: >-
            Your API key for programmatic access. Send it in the x-api-key
            header; you can create and manage keys from the Developers page.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAnalysisItemAttachmentsRequestModel'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UpdateAnalysisItemAttachmentsResponseModel
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateAnalysisItemAttachmentsRequestModel:
      properties:
        source:
          $ref: '#/components/schemas/AnalysisItemSource'
        attach:
          items:
            $ref: '#/components/schemas/AnalysisItemAttachmentDestination'
          type: array
          title: Attach
        detach:
          items:
            $ref: '#/components/schemas/AnalysisItemAttachmentDestination'
          type: array
          title: Detach
      type: object
      required:
        - source
      title: UpdateAnalysisItemAttachmentsRequestModel
    UpdateAnalysisItemAttachmentsResponseModel:
      properties:
        results:
          items:
            oneOf:
              - $ref: >-
                  #/components/schemas/BatchSuccessResponseModel_AnalysisItemAttachmentResultData_
              - $ref: '#/components/schemas/BatchFailureResponseModel'
            discriminator:
              propertyName: status
              mapping:
                failure: '#/components/schemas/BatchFailureResponseModel'
                success: >-
                  #/components/schemas/BatchSuccessResponseModel_AnalysisItemAttachmentResultData_
          type: array
          title: Results
      type: object
      required:
        - results
      title: UpdateAnalysisItemAttachmentsResponseModel
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AnalysisItemSource:
      type: string
      enum:
        - user
        - system
      title: AnalysisItemSource
    AnalysisItemAttachmentDestination:
      properties:
        agent_id:
          type: string
          title: Agent Id
        branch_id:
          type: string
          title: Branch Id
      type: object
      required:
        - agent_id
        - branch_id
      title: AnalysisItemAttachmentDestination
    BatchSuccessResponseModel_AnalysisItemAttachmentResultData_:
      properties:
        status:
          type: string
          const: success
          title: Status
          default: success
        data:
          $ref: '#/components/schemas/AnalysisItemAttachmentResultData'
      type: object
      required:
        - status
        - data
      title: BatchSuccessResponseModel[AnalysisItemAttachmentResultData]
    BatchFailureResponseModel:
      properties:
        status:
          type: string
          const: failure
          title: Status
          default: failure
        error_code:
          type: integer
          title: Error Code
        error_status:
          type: string
          title: Error Status
        error_message:
          type: string
          title: Error Message
      type: object
      required:
        - status
        - error_code
        - error_status
        - error_message
      title: BatchFailureResponseModel
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AnalysisItemAttachmentResultData:
      properties:
        agent_id:
          type: string
          title: Agent Id
        branch_id:
          type: string
          title: Branch Id
        action:
          $ref: '#/components/schemas/AnalysisItemAttachmentAction'
        changed:
          type: boolean
          title: Changed
      type: object
      required:
        - agent_id
        - branch_id
        - action
        - changed
      title: AnalysisItemAttachmentResultData
    AnalysisItemAttachmentAction:
      type: string
      enum:
        - attach
        - detach
      title: AnalysisItemAttachmentAction

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.