{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/safetyculture/json-schema/safetyculture-s12-documents-v1-documents-public-service-update-file-body-schema.json",
  "title": "Request to update the file with the specified ID",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/safetyculture-documents-api-openapi.yml#/components/schemas/s12.documents.v1.DocumentsPublicService.UpdateFileBody",
  "type": "object",
  "properties": {
    "file_type": {
      "description": "The type of the file to be created.\nPlease note that videos are currently not supported.",
      "allOf": [
        {
          "$ref": "#/$defs/s12.common.MediaType"
        }
      ]
    },
    "file_size": {
      "type": "integer",
      "format": "int64",
      "description": "The size of the file in bytes. Must not exceed 50MB. This field is required if `file_type` is provided."
    },
    "name": {
      "type": "string",
      "description": "The new name of the file. Maximum of 255 characters and must exclude invalid characters."
    },
    "description": {
      "$ref": "#/$defs/s12.documents.v1.UpdateFileRequest.Description"
    },
    "owners": {
      "$ref": "#/$defs/s12.documents.v1.UpdateFileRequest.Owners"
    },
    "valid_to": {
      "description": "The expiry date of the file. Set year, month, and day to 0 to clear the file's expiry date.",
      "allOf": [
        {
          "$ref": "#/$defs/google.type.Date"
        }
      ]
    },
    "file_extension": {
      "type": "string",
      "description": "The file extension of the uploaded blob (e.g. \"pdf\", \"jpg\"), without the leading dot.\nUsed to populate the file's extension when the extension cannot be derived from `name`\nor the underlying media metadata is unavailable."
    }
  },
  "$defs": {
    "google.type.Date": {
      "type": "object",
      "properties": {
        "year": {
          "type": "integer",
          "format": "int32",
          "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without\na year."
        },
        "month": {
          "type": "integer",
          "format": "int32",
          "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a\nmonth and day."
        },
        "day": {
          "type": "integer",
          "format": "int32",
          "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0\nto specify a year by itself or a year and month where the day isn't\nsignificant."
        }
      },
      "description": "* A full date, with non-zero year, month, and day values\n* A month and day value, with a zero year, such as an anniversary\n* A year on its own, with zero month and day values\n* A year and month value, with a zero day, such as a credit card expiration\ndate\n\nRelated types are [google.type.TimeOfDay][google.type.TimeOfDay] and\n`google.protobuf.Timestamp`.",
      "title": "Represents a whole or partial calendar date, such as a birthday. The time of\nday and time zone are either specified elsewhere or are insignificant. The\ndate is relative to the Gregorian Calendar. This can represent one of the\nfollowing:"
    },
    "s12.common.MediaType": {
      "type": "string",
      "enum": [
        "MEDIA_TYPE_IMAGE",
        "MEDIA_TYPE_VIDEO",
        "MEDIA_TYPE_PDF",
        "MEDIA_TYPE_DOCX",
        "MEDIA_TYPE_XLSX",
        "MEDIA_TYPE_PPTX",
        "MEDIA_TYPE_CSV"
      ],
      "description": " - MEDIA_TYPE_IMAGE: An image file (GIF, JPG, PNG, WEBP).\n - MEDIA_TYPE_VIDEO: A video file (MP4, MOV).\n - MEDIA_TYPE_PDF: A PDF document.\n - MEDIA_TYPE_DOCX: A Microsoft Word document (DOCX, DOC).\n - MEDIA_TYPE_XLSX: A Microsoft Excel spreadsheet (XLSX, XLS).\n - MEDIA_TYPE_PPTX: A Microsoft PowerPoint presentation (PPTX, PPT).\n - MEDIA_TYPE_CSV: A CSV file."
    },
    "s12.documents.v1.UpdateFileRequest.Description": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        }
      },
      "description": "The new description of the file. Maximum of 1000 characters and must exclude invalid characters."
    },
    "s12.documents.v1.UpdateFileRequest.Owners": {
      "type": "object",
      "properties": {
        "user_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IDs of the users you want to add as owners.\nTo get the `user_id`, open the user in the SafetyCulture web app and copy the last part of the URL before /profile\nFor example, in this link `https://app.safetyculture.com/organisation/role_d7b113c0c6774a59b8cfdea1ab1da89a/users/user_7a7cddac38ac4dd197304ba0d05b981a/profile`,\nthe user ID is `user_7a7cddac38ac4dd197304ba0d05b981a`."
        },
        "group_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IDs of the groups you want to add as owners.\nTo get the `group_id`, open the group in the SafetyCulture web app and copy the last part of the URL before /users.\nFor example, in this link `https://app.safetyculture.com/organisation/role_d7b113c0c6774a59b8cfdea1ab1da89a/groups/role_1ebbbca147644b5aa4ea646429f941e7/users`,\nthe group ID is `role_1ebbbca147644b5aa4ea646429f941e7`."
        }
      },
      "description": "The new owners of the file. Maximum of 5 users and groups."
    }
  }
}