Wikis - Create

Creates the wiki resource.

POST https://dev.azure.com/{organization}/{project}/_apis/wiki/wikis?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
mappedPath

string

Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type.

name

string

Wiki name.

projectId

string

ID of the project in which the wiki is to be created.

repositoryId

string

ID of the git repository that backs up the wiki. Not required for ProjectWiki type.

type

WikiType

Type of the wiki.

version

GitVersionDescriptor

Version of the wiki. Not required for ProjectWiki type.

Responses

Name Type Description
201 Created

WikiV2

Wiki created

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.wiki_write Grants the ability to read, create and updates wikis, wiki pages and wiki attachments.

Examples

Create code wiki
Create project wiki

Create code wiki

Sample Request

POST https://dev.azure.com/fabrikam/_apis/wiki/wikis?api-version=5.0

{
  "version": {
    "version": "master"
  },
  "type": "codeWiki",
  "name": "sampleCodeWiki",
  "projectId": "15cbba90-8ac5-450e-934c-16f43021546b",
  "repositoryId": "cd327f27-561b-45aa-9913-4af25ad85889",
  "mappedPath": "/docs"
}

Sample Response

{
  "id": "9bfc671f-8116-4b3f-9aad-c17a9d677ab6",
  "versions": [
    {
      "version": "master"
    }
  ],
  "url": "https://dev.azure.com/fabrikam/15cbba90-8ac5-450e-934c-16f43021546b/_apis/wiki/wikis/9bfc671f-8116-4b3f-9aad-c17a9d677ab6",
  "remoteUrl": "https://dev.azure.com/fabrikam/15cbba90-8ac5-450e-934c-16f43021546b/_wiki/wikis/9bfc671f-8116-4b3f-9aad-c17a9d677ab6",
  "type": "codeWiki",
  "name": "sampleCodeWiki",
  "projectId": "15cbba90-8ac5-450e-934c-16f43021546b",
  "repositoryId": "cd327f27-561b-45aa-9913-4af25ad85889",
  "mappedPath": "/docs"
}

Create project wiki

Sample Request

POST https://dev.azure.com/fabrikam/_apis/wiki/wikis?api-version=5.0

{
  "type": "projectWiki",
  "name": "sampleProjectWiki",
  "projectId": "f38a86b5-98b0-49ef-ae9f-213c2b531cbe"
}

Sample Response

{
  "id": "a4cfa859-1089-4445-9ef1-837b0fbd44bd",
  "versions": [
    {
      "version": "wikiMaster"
    }
  ],
  "url": "https://dev.azure.com/fabrikam/f38a86b5-98b0-49ef-ae9f-213c2b531cbe/_apis/wiki/wikis/a4cfa859-1089-4445-9ef1-837b0fbd44bd",
  "remoteUrl": "https://dev.azure.com/fabrikam/f38a86b5-98b0-49ef-ae9f-213c2b531cbe/_wiki/wikis/a4cfa859-1089-4445-9ef1-837b0fbd44bd",
  "type": "projectWiki",
  "name": "sampleProjectWiki",
  "projectId": "f38a86b5-98b0-49ef-ae9f-213c2b531cbe",
  "repositoryId": "a4cfa859-1089-4445-9ef1-837b0fbd44bd",
  "mappedPath": "/"
}

Definitions

Name Description
GitVersionDescriptor
GitVersionOptions

Version options - Specify additional modifiers to version (e.g Previous)

GitVersionType

Version type (branch, tag, or commit). Determines how Id is interpreted

WikiCreateParametersV2

Wiki creation parameters.

WikiType

Type of the wiki.

WikiV2

Defines a wiki resource.

GitVersionDescriptor

Name Type Description
version

string

Version string identifier (name of tag/branch, SHA1 of commit)

versionOptions

GitVersionOptions

Version options - Specify additional modifiers to version (e.g Previous)

versionType

GitVersionType

Version type (branch, tag, or commit). Determines how Id is interpreted

GitVersionOptions

Version options - Specify additional modifiers to version (e.g Previous)

Name Type Description
firstParent

string

First parent of commit (HEAD^)

none

string

Not specified

previousChange

string

Commit that changed item prior to the current version

GitVersionType

Version type (branch, tag, or commit). Determines how Id is interpreted

Name Type Description
branch

string

Interpret the version as a branch name

commit

string

Interpret the version as a commit ID (SHA1)

tag

string

Interpret the version as a tag name

WikiCreateParametersV2

Wiki creation parameters.

Name Type Description
mappedPath

string

Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type.

name

string

Wiki name.

projectId

string

ID of the project in which the wiki is to be created.

repositoryId

string

ID of the git repository that backs up the wiki. Not required for ProjectWiki type.

type

WikiType

Type of the wiki.

version

GitVersionDescriptor

Version of the wiki. Not required for ProjectWiki type.

WikiType

Type of the wiki.

Name Type Description
codeWiki

string

Indicates that the wiki is published from a git repository

projectWiki

string

Indicates that the wiki is provisioned for the team project

WikiV2

Defines a wiki resource.

Name Type Description
id

string

ID of the wiki.

mappedPath

string

Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type.

name

string

Wiki name.

projectId

string

ID of the project in which the wiki is to be created.

properties

object

Properties of the wiki.

remoteUrl

string

Remote web url to the wiki.

repositoryId

string

ID of the git repository that backs up the wiki. Not required for ProjectWiki type.

type

WikiType

Type of the wiki.

url

string

REST url for this wiki.

versions

GitVersionDescriptor[]

Versions of the wiki.