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

# Update Resource



## OpenAPI

````yaml PUT /v1/resource/{id}
openapi: 3.1.0
info:
  title: re-factor API Reference
  version: 1.0.0
  description: API specification for re-factor system based on schema definitions
servers: []
security:
  - BearerAuth: []
paths:
  /v1/resource/{id}:
    put:
      summary: Update a resource
      parameters:
        - name: id
          in: path
          schema:
            type: string
            format: uuid
          required: true
          description: The ID of the resource to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New name for the resource
                directory_path:
                  type: string
                  description: New directory path for the resource
                metadata:
                  type: object
                  additionalProperties: true
                  description: Updated metadata for the resource
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Resource:
      type: object
      required:
        - id
        - account_id
        - name
        - directory_path
        - mime_type
        - sha256
        - storage_bucket
        - storage_key
        - size_bytes
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the resource
        account_id:
          type: string
          description: ID of the account that owns this resource
        name:
          type: string
          description: Name of the resource
        directory_path:
          type: string
          description: Path to the directory containing the resource
        mime_type:
          type: string
          description: MIME type of the resource
        sha256:
          type: string
          description: SHA256 hash of the resource content
        original_uri:
          type: string
          nullable: true
          description: Original URI of the resource, if applicable
        external_id:
          type: string
          nullable: true
          description: External identifier for the resource, if applicable
        external_storage_type:
          $ref: '#/components/schemas/ExternalStorageType'
          nullable: true
          description: Type of external storage, if applicable
        storage_bucket:
          type: string
          description: Storage bucket where the resource is stored
        storage_key:
          type: string
          description: Key for artifact storage in the storage system
        size_bytes:
          type: integer
          format: int64
          description: Size of the resource in bytes
        tags:
          type: array
          items:
            type: string
          description: >-
            List of tags associated with the resource. While stored in a
            separate table, this field represents the joined data.
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          description: Additional metadata associated with the resource
        created_by:
          type: string
          nullable: true
          description: ID of the user who created the resource
        created_at:
          type: string
          format: date-time
          description: Timestamp when the resource was created
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the resource was last updated
    ExternalStorageType:
      type: string
      enum:
        - s3
        - gcs
        - azure_blob
      description: Type of external storage provider
  responses:
    BadRequestError:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    NotFoundError:
      description: Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````