{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/safetyculture/json-schema/safetyculture-s12-userdocuments-v1-add-document-version-for-user-request-schema.json",
  "title": "s12.userdocuments.v1.AddDocumentVersionForUserRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/safetyculture-credentials-api-openapi.yml#/components/schemas/s12.userdocuments.v1.AddDocumentVersionForUserRequest",
  "type": "object",
  "properties": {
    "user_id": {
      "type": "string",
      "description": "Required. The user ID to add the credential to"
    },
    "document_type_id": {
      "type": "string",
      "description": "Required. The ID of the credential type"
    },
    "document_id": {
      "type": "string",
      "description": "Required. The ID of the credential."
    },
    "new_version_id": {
      "type": "string",
      "description": "Optional. The ID of the new credential version. This is an optional field, but if provided it will link the newly created credential to any recently uploaded media"
    },
    "document_version_attributes": {
      "description": "The attributes of the credential version.",
      "allOf": [
        {
          "$ref": "#/$defs/s12.userdocuments.v1.DocumentVersionAttributes"
        }
      ]
    }
  },
  "$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.Media": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "token": {
          "type": "string"
        },
        "filename": {
          "type": "string",
          "description": "full file name, including file extension"
        },
        "media_type": {
          "$ref": "#/$defs/s12.common.MediaType"
        }
      },
      "title": "Represents an image or video"
    },
    "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.userdocuments.v1.DocumentVersionAttributes": {
      "type": "object",
      "properties": {
        "media": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/$defs/s12.common.Media"
          },
          "description": "Media array to be associated with the document."
        },
        "expiry_period_start_date": {
          "description": "The start date of a credential's expiration period.",
          "allOf": [
            {
              "$ref": "#/$defs/google.type.Date"
            }
          ]
        },
        "expiry_period_end_date": {
          "description": "The end date of a credential's expiration period.",
          "allOf": [
            {
              "$ref": "#/$defs/google.type.Date"
            }
          ]
        }
      },
      "description": "Intrinsic attributes associated with a credential version."
    }
  }
}