Changesets - Create
Create a new changeset.
Accepts TfvcChangeset as JSON body
POST https://dev.azure.com/{organization}/{project}/_apis/tfvc/changesets?api-version=5.0
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
project
|
path |
string |
Project ID or project name |
|
api-version
|
query | True |
string |
Version of the API to use. This should be set to '5.0' to use this version of the api. |
Request Body
Name | Type | Description |
---|---|---|
_links |
A collection of REST reference links. |
|
accountId |
string |
Changeset Account Id also known as Organization Id. |
author |
Alias or display name of user. |
|
changes |
List of associated changes. |
|
changesetId |
integer |
Changeset Id. |
checkedInBy |
Alias or display name of user. |
|
checkinNotes |
List of Checkin Notes for the changeset. |
|
collectionId |
string |
Changeset collection Id. |
comment |
string |
Comment for the changeset. |
commentTruncated |
boolean |
Was the Comment result truncated? |
createdDate |
string |
Creation date of the changeset. |
hasMoreChanges |
boolean |
True if more changes are available. |
policyOverride |
Policy Override for the changeset. |
|
teamProjectIds |
string[] |
Team Project Ids for the changeset. |
url |
string |
URL to retrieve the item. |
workItems |
List of work items associated with the changeset. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
Name | Description |
---|---|
vso.code_write | Grants the ability to read, update, and delete source code, access metadata about commits, changesets, branches, and other version control artifacts. Also grants the ability to create and manage pull requests and code reviews and to receive notifications about version control events via service hooks. |
Examples
POST a file edit changeset. |
POST an add binary file changeset. |
POST an add multiple file changeset. |
POST an add text file changeset. |
POST a file edit changeset.
Sample Request
POST https://dev.azure.com/{organization}/_apis/tfvc/changesets?api-version=5.0
{
"changes": [
{
"item": {
"version": 7,
"path": "$/Project01/file-to-edit-2019-04-09-23-21-13-31.txt",
"contentMetadata": {
"encoding": 1200,
"contentType": "text/plain"
}
},
"changeType": "edit",
"newContent": {
"content": "Initial contents as of 4/9/2019 11:21:13 PM\nEdited contents"
}
}
],
"comment": "(sample) Editing the file via API"
}
Sample Response
{
"checkinNotes": [],
"policyOverride": {
"policyFailures": []
},
"changesetId": 8,
"url": "https://codedev.ms/fabrikam/_apis/tfvc/changesets/8",
"author": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"uniqueName": "fabrikamfiber16@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"checkedInBy": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"uniqueName": "fabrikamfiber16@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"createdDate": "2019-04-09T23:21:27.197Z",
"comment": "(sample) Editing the file via API"
}
POST an add binary file changeset.
Sample Request
POST https://dev.azure.com/{organization}/_apis/tfvc/changesets?api-version=5.0
{
"changes": [
{
"item": {
"path": "$/Project01/testzip.zip",
"contentMetadata": {
"encoding": -1
}
},
"changeType": "add",
"newContent": {
"content": "UEsDBAoAAAAAAPxQJk8Mfn/YBAAAAAQAAAAIAAAAdGVzdC50eHR0ZXN0UEsBAj8ACgAAAAAA/FAmTwx+f9gEAAAABAAAAAgAJAAAAAAAAAAgAAAAAAAAAHRlc3QudHh0CgAgAAAAAAABABgAHDH5ebxk1QEcMfl5vGTVAe/BonO8ZNUBUEsFBgAAAAABAAEAWgAAACoAAAAAAA==",
"contentType": "base64Encoded"
}
}
],
"comment": "(sample) Adding a new changeset via API"
}
Sample Response
{
"checkinNotes": [],
"policyOverride": {
"policyFailures": []
},
"changesetId": 5,
"url": "https://codedev.ms/fabrikam/_apis/tfvc/changesets/5",
"author": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"uniqueName": "fabrikamfiber16@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"checkedInBy": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"uniqueName": "fabrikamfiber16@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"createdDate": "2019-04-09T23:20:51.94Z",
"comment": "(sample) Adding a new changeset via API"
}
POST an add multiple file changeset.
Sample Request
POST https://dev.azure.com/{organization}/_apis/tfvc/changesets?api-version=5.0
{
"changes": [
{
"item": {
"path": "$/Project01/example-file-2019-04-09-23-21-00-40.1.txt",
"contentMetadata": {
"encoding": 1200
}
},
"changeType": "add",
"newContent": {
"content": "File 1 contents as of 4/9/2019 11:21:00 PM",
"contentType": "rawText"
}
},
{
"item": {
"path": "$/Project01/example-file-2019-04-09-23-21-00-40.2.txt",
"contentMetadata": {
"encoding": 1200
}
},
"changeType": "add",
"newContent": {
"content": "File 2 contents as of 4/9/2019 11:21:00 PM",
"contentType": "rawText"
}
}
],
"comment": "(sample) Adding multiple files via API"
}
Sample Response
{
"checkinNotes": [],
"policyOverride": {
"policyFailures": []
},
"changesetId": 6,
"url": "https://codedev.ms/fabrikam/_apis/tfvc/changesets/6",
"author": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"uniqueName": "fabrikamfiber16@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"checkedInBy": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"uniqueName": "fabrikamfiber16@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"createdDate": "2019-04-09T23:21:11.55Z",
"comment": "(sample) Adding multiple files via API"
}
POST an add text file changeset.
Sample Request
POST https://dev.azure.com/{organization}/_apis/tfvc/changesets?api-version=5.0
{
"changes": [
{
"item": {
"path": "$/Project01/example-file-2019-04-09-23-20-28-70.txt",
"contentMetadata": {
"encoding": 1200
}
},
"changeType": "add",
"newContent": {
"content": "File contents as of 4/9/2019 11:20:28 PM",
"contentType": "rawText"
}
}
],
"comment": "(sample) Adding a new changeset via API"
}
Sample Response
{
"checkinNotes": [],
"policyOverride": {
"policyFailures": []
},
"changesetId": 5,
"url": "https://codedev.ms/fabrikam/_apis/tfvc/changesets/5",
"author": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"uniqueName": "fabrikamfiber16@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"checkedInBy": {
"displayName": "Normal Paulk",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"uniqueName": "fabrikamfiber16@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"createdDate": "2019-04-09T23:20:51.94Z",
"comment": "(sample) Adding a new changeset via API"
}
Definitions
Name | Description |
---|---|
Associated |
|
Checkin |
|
Identity |
|
Item |
|
Item |
|
Reference |
The class to represent a collection of REST reference links. |
Tfvc |
A change. |
Tfvc |
A collection of changes. |
Tfvc |
Metadata for a changeset. |
Tfvc |
|
Tfvc |
Policy failure information. |
Tfvc |
Information on the policy override. |
Version |
The type of change that was made to the item. |
AssociatedWorkItem
Name | Type | Description |
---|---|---|
assignedTo |
string |
|
id |
integer |
Id of associated the work item. |
state |
string |
|
title |
string |
|
url |
string |
REST Url of the work item. |
webUrl |
string |
|
workItemType |
string |
CheckinNote
Name | Type | Description |
---|---|---|
name |
string |
|
value |
string |
IdentityRef
Name | Type | Description |
---|---|---|
_links |
This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. |
|
descriptor |
string |
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. |
directoryAlias |
string |
|
displayName |
string |
This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. |
id |
string |
|
imageUrl |
string |
|
inactive |
boolean |
|
isAadIdentity |
boolean |
|
isContainer |
boolean |
|
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
|
uniqueName |
string |
|
url |
string |
This url is the full route to the source resource of this graph subject. |
ItemContent
Name | Type | Description |
---|---|---|
content |
string |
|
contentType |
ItemContentType
Name | Type | Description |
---|---|---|
base64Encoded |
string |
|
rawText |
string |
ReferenceLinks
The class to represent a collection of REST reference links.
Name | Type | Description |
---|---|---|
links |
object |
The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. |
TfvcChange
A change.
Name | Type | Description |
---|---|---|
changeType |
The type of change that was made to the item. |
|
item |
string |
Current version. |
mergeSources |
List of merge sources in case of rename or branch creation. |
|
newContent |
Content of the item after the change. |
|
pendingVersion |
integer |
Version at which a (shelved) change was pended against |
sourceServerItem |
string |
Path of the item on the server. |
url |
string |
URL to retrieve the item. |
TfvcChangeset
A collection of changes.
Name | Type | Description |
---|---|---|
_links |
A collection of REST reference links. |
|
accountId |
string |
Changeset Account Id also known as Organization Id. |
author |
Alias or display name of user. |
|
changes |
List of associated changes. |
|
changesetId |
integer |
Changeset Id. |
checkedInBy |
Alias or display name of user. |
|
checkinNotes |
List of Checkin Notes for the changeset. |
|
collectionId |
string |
Changeset collection Id. |
comment |
string |
Comment for the changeset. |
commentTruncated |
boolean |
Was the Comment result truncated? |
createdDate |
string |
Creation date of the changeset. |
hasMoreChanges |
boolean |
True if more changes are available. |
policyOverride |
Policy Override for the changeset. |
|
teamProjectIds |
string[] |
Team Project Ids for the changeset. |
url |
string |
URL to retrieve the item. |
workItems |
List of work items associated with the changeset. |
TfvcChangesetRef
Metadata for a changeset.
Name | Type | Description |
---|---|---|
_links |
A collection of REST reference links. |
|
author |
Alias or display name of user. |
|
changesetId |
integer |
Changeset Id. |
checkedInBy |
Alias or display name of user. |
|
comment |
string |
Comment for the changeset. |
commentTruncated |
boolean |
Was the Comment result truncated? |
createdDate |
string |
Creation date of the changeset. |
url |
string |
URL to retrieve the item. |
TfvcMergeSource
Name | Type | Description |
---|---|---|
isRename |
boolean |
Indicates if this a rename source. If false, it is a merge source. |
serverItem |
string |
The server item of the merge source. |
versionFrom |
integer |
Start of the version range. |
versionTo |
integer |
End of the version range. |
TfvcPolicyFailureInfo
Policy failure information.
Name | Type | Description |
---|---|---|
message |
string |
Policy failure message. |
policyName |
string |
Name of the policy that failed. |
TfvcPolicyOverrideInfo
Information on the policy override.
Name | Type | Description |
---|---|---|
comment |
string |
Overidden policy comment. |
policyFailures |
Information on the failed policy that was overridden. |
VersionControlChangeType
The type of change that was made to the item.
Name | Type | Description |
---|---|---|
add |
string |
|
all |
string |
|
branch |
string |
|
delete |
string |
|
edit |
string |
|
encoding |
string |
|
lock |
string |
|
merge |
string |
|
none |
string |
|
property |
string |
|
rename |
string |
|
rollback |
string |
|
sourceRename |
string |
|
targetRename |
string |
|
undelete |
string |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for