---
title: "Updates a version of a credential."
method: PUT
path: "/credentials/v1/credential/version"
tags: ["Credentials"]
---

# Updates a version of a credential.

`PUT /credentials/v1/credential/version`

## Request body

- S12UserdocumentsV1UpdateDocumentVersionForUserRequest
  - `user_id` string — Required. The user ID to add the credential to
  - `document_id` string — Required. The ID of the credential.
  - `version_id` string — Required. The ID of the new credential version.
  - `document_version_attributes` S12UserdocumentsV1DocumentVersionAttributes — Intrinsic attributes associated with a credential version.
    - `media` S12CommonMedia[] — Media array to be associated with the document.
      - `id` string
      - `token` string
      - `filename` string — full file name, including file extension
      - `media_type` 'MEDIA_TYPE_IMAGE' | 'MEDIA_TYPE_VIDEO' | 'MEDIA_TYPE_PDF' | 'MEDIA_TYPE_DOCX' | 'MEDIA_TYPE_XLSX' | 'MEDIA_TYPE_PPTX' | 'MEDIA_TYPE_CSV' — - MEDIA_TYPE_IMAGE: An image file (GIF, JPG, PNG, WEBP). - MEDIA_TYPE_VIDEO: A video file (MP4, MOV). - MEDIA_TYPE_PDF: A PDF document. - MEDIA_TYPE_DOCX: A Microsoft Word document (DOCX, DOC). - MEDIA_TYPE_XLSX: A Microsoft Excel spreadsheet (XLSX, XLS). - MEDIA_TYPE_PPTX: A Microsoft PowerPoint presentation (PPTX, PPT). - MEDIA_TYPE_CSV: A CSV file.
    - `expiry_period_start_date` GoogleTypeDate — * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
      - `year` integer — Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
      - `month` integer — Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
      - `day` integer — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
    - `expiry_period_end_date` GoogleTypeDate — * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
      - `year` integer — Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
      - `month` integer — Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
      - `day` integer — Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
  - `update_mask` string — Required. The attributes (such as name etc.) you want to update for the credential version. The contents should reference fields of the DocumentVersionAttributes message. For example, 'update_mask=media,expiry_period_start_date' indicates that only the media and expiry_period_start_date fields of the DocumentVersionAttributes message should be updated. Any other attributes provided in the DocumentVersionAttributes body will be ignored.

## Response `200`

A successful response.

- S12UserdocumentsV1UpdateDocumentVersionForUserResponse

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/safetyculture/apis/safetyculture-api.md) · [All operations](https://skmtc.net/safetyculture/apis/safetyculture-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/safetyculture/safetyculture-api/revisions/5be91df61ded/schema)
