> ## Documentation Index
> Fetch the complete documentation index at: https://prismeai-legacy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch v2workspaces files

> Update file



## OpenAPI

````yaml /api-reference/swagger.yml patch /v2/workspaces/{workspaceId}/files/{id}
openapi: 3.0.0
info:
  version: 1.0.0
  title: Prisme.ai APIs
  description: Prisme.ai APIs specifications
  termsOfService: https://www.prisme.ai/mentions-legales
  contact:
    name: Prisme.ai Support Team
    email: support@prisme.ai
    url: https://www.prisme.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.eda.prisme.ai
  - url: http://localhost:3001
security:
  - BearerAuth: []
  - WorkspaceApiKeyAuth: []
  - BearerAuth: []
    WorkspaceApiKeyAuth: []
paths:
  /v2/workspaces/{workspaceId}/files/{id}:
    patch:
      tags:
        - Prisme.ai Workspaces
      description: Update file
      operationId: updateFile
      parameters:
        - name: workspaceId
          in: path
          description: Workspace id
          required: true
          schema:
            type: string
        - name: id
          in: path
          description: File id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                expiresAfter:
                  type: string
                  description: >-
                    File expiration time in seconds. This is currently a best
                    effort expiration as it will be deleted only upon the next
                    restart after expiration
                public:
                  type: string
                  description: Set to true to make uploaded file publicly available
                shareToken:
                  type: string
                  description: >-
                    If enabled, return a share token that will allow anybody
                    access the file
                metadata:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: Success Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/File'
        '400':
          description: Bad parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadParametersError'
        '401':
          description: AuthenticationError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '403':
          description: Bad permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
components:
  schemas:
    File:
      type: object
      required:
        - name
        - url
        - mimetype
        - size
        - workspaceId
        - path
      properties:
        id:
          type: string
        name:
          type: string
        url:
          type: string
        mimetype:
          type: string
        size:
          type: number
        workspaceId:
          type: string
        path:
          type: string
        expiresAt:
          type: string
        expiresAfter:
          type: number
          description: >-
            Number of seconds after which the file will be automatically
            removed. This is currently a best effort expiration as it will be
            deleted only upon the next restart after expiration date.
        metadata:
          type: object
          additionalProperties: true
        public:
          type: boolean
          description: >-
            Reflects whether the file has public-read ACL at storage provider.
            True by default
        shareToken:
          type: string
          description: >-
            A share token to append as a ?token query parameter to grant read
            access with given url
    BadParametersError:
      type: object
      properties:
        error:
          type: string
          example: BadParameters
        message:
          type: string
        details: {}
    AuthenticationError:
      type: object
      properties:
        error:
          type: string
          example: AuthenticationError
        message:
          type: string
          example: Unauthenticated
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: ForbiddenError
        message:
          type: string
          example: Forbidden
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key

````