Update the file with the specified path

post/workspaces/@currentUser/files

Update the file with the specified path.

Request Samples

Response Samples

1{
2 "version": 1,
3 "workspaceId": "ce211872-f840-4d41-bcb4-4974cb35840e",
4 "name": "sleep.sas",
5 "path": "/Org/project/programs/sleep.sas",
6 "type": "FILE",
7 "modifiedTimeStamp": "2023-12-13T15:39:09.907000Z",
8 "contentType": "application/x-sas",
9 "size": 22
10}

Query Parameters

NameTypeRequiredDescription
comment
string
false

The optional file version comment for the file. This is applicable only when the action is CHECK_IN.

fileVersion
string
false

The optional version specification for checking in a version of the file or copying a version of the file to the workspace. This parameter is not required, so for check in, unless a version parameter value is provided, new files are created un-versioned. For the CHECK_IN action, the valid values for version are MAJOR, MINOR, or a specific version such as 2.3. If the value is MAJOR, new files are created as versioned with initial version 1.0. Similarly, if the value is MINOR, a versioned file is created with version 0.1. If the file exists and is versioned, new versions are MINOR versions by default. To specify a version other than MAJOR or MINOR, you can specify a value between 0.1 and 99999.99999. For COPY_VERSION, the specific file version you want to copy to the workspace can be specified; otherwise, the content of the most recent version is copied. This parameter is applicable only when the action is CHECK_IN and COPY_VERSION.

action
string
true

The update action to perform on the file. Supported actions:

  • CHECK_OUT: Check out a repository file and copy it to the workspace. If the file exists in the workspace its content is overwritten. Any parent contexts and folders that do not currently exist in the workspace are created in the workspace as folders.
  • CHECK_OUT_WITHOUT_COPY: Check out a repository file and do not copy the file or its parent containers to the workspace.
  • UNDO_CHECKOUT: Undo the check-out of a file that is currently checked out. Users can only undo check-out on files they have checked out. The workspace content of the file is not affected by undo check-out.
  • CHECK_IN: Check in a file that currently exists in the repository and is checked out or check in a new file that exists in the workspace but does not yet exist in the repository. Checking in a file results in the file being created or updated in the repository and any missing parent folders are created in the repository. The optional version and file comments are applied if they are specified.
  • COPY_LATEST_VERSION: Copy the content of a file in the repository to the workspace. For versioned files, the content of the most recent version of the file is copied to the workspace. Existing workspace files are overwritten if the content of the file does not already match that of the most recent version of the file in the repository.
  • COPY_VERSION: Copy the content of a file in the repository to the workspace. For versioned files, by default the content of the latest version of the file is copied to the workspace. The optional parameter "fileVersion" can be specified to copy the content of an earlier version of the file. Existing workspace files are overwritten if the content of the file does not already match that of the specified file version in the repository, or the latest version when no version is specified.
Allowed values:
CHECK_OUTCHECK_OUT_WITHOUT_COPYUNDO_CHECKOUTCHECK_INCOPY_LATEST_VERSION
path
string
true

The full path of the workspace file.

Responses

StatusMeaningDescription
200OK

OK - the file was updated successfully.

Schema