> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Create a version

POST https://api.postman.com/apis/{apiId}/versions
Content-Type: application/json

Creates a new API version asynchronously and immediately returns an HTTP `202 Accepted` response. The response contains a polling link to the task status API in the `Location` header.

This endpoint is equivalent to publishing a version in Postman app, which is the snapshot of API collections and schema at a given point in time.


Reference: https://learning.postman.com/api-docs/api-reference/ap-is/create-api-version

## Authentication

- `x-api-key` header (required)

## Servers

- `https://api.postman.com` (https://api.postman.com, default)
- `https://api.eu.postman.com` (https://api.eu.postman.com)

## Request

### Path parameters

- `apiId` (string, required) — The API's ID.

### Headers

- `Accept` (enum, required) — The `application/vnd.api.v10+json` request header required to use the endpoint.
  - Allowed values: `application/vnd.api.v10+json`

### Body (application/json)

- `object or object or object`
  - Create Version Schema (Not Git-Linked)
    - `name` (string, required) — The version's name.
    - `schemas` (list of object, required) — A list of the version's schemas.
      - `id` (string, optional) — The schema's ID.
    - `collections` (list of object, required) — A list of the version's collections.
      - `id` (string, optional) — The collection's ID.
    - `releaseNotes` (string, optional) — Information about the API version release. For example, changelog notes.
  - Create Version Schema (Git-Linked)
    - `name` (string, required) — The version's name.
    - `branch` (string, required) — The branch ID.
    - `schemas` (list of object, required) — A list of the version's schemas.
      - `directoryPath` (string, optional) — The path to the root directory where schemas are stored in the Git repository.
    - `collections` (list of object, required) — A list of the version's collections.
      - `filePath` (string, optional) — The path to the collection in the Git repository.
    - `releaseNotes` (string, optional) — Information about the API version release. For example, changelog notes.
  - Create Version Schema (Git-Linked with root File)
    - `name` (string, required) — The version's name.
    - `branch` (string, required) — The branch ID.
    - `schemas` (list of object, required) — A list of the version's schemas.
      - `filePath` (string, optional) — The path to the schema root file in the Git repository.
    - `collections` (list of object, required) — A list of the version's collections.
      - `filePath` (string, optional) — Path to a collection in the Git repository.
    - `releaseNotes` (string, optional) — Information about the API version release. For example, changelog notes.

## Response

### 202

Accepted

- `id` (string, optional) — The version's ID.
- `createdAt` (datetime, optional) — The date and time at which the version was created.
- `updatedAt` (datetime, optional) — The date and time at which the version was last updated.
- `name` (string, optional) — The version's name.
- `releaseNotes` (string, optional) — Information about the API version release. For example, changelog notes.

## Examples

### API Version Created

**Request**

```json
undefined
```

**Response**

```json
{
  "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
  "createdAt": "2023-06-09T14:48:45.000Z",
  "updatedAt": "2023-06-09T19:50:49.000Z",
  "name": "v1",
  "releaseNotes": "This is the first release."
}
```

**SDK Code**

```python API Version Created
import requests

url = "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions"

headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript API Version Created
const url = 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go API Version Created
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby API Version Created
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java API Version Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php API Version Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions', [
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp API Version Created
using RestSharp;

var client = new RestClient("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift API Version Created
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create Version

**Request**

```json
{
  "collections": [
    {
      "id": "e8a015e0-f472-4bb3-a523-57ce7c4583ed"
    }
  ],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [
    {
      "id": "18a015e0-f472-4bb3-a523-57ce7c458387"
    }
  ]
}
```

**Response**

```json
{
  "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
  "createdAt": "2023-06-09T14:48:45.000Z",
  "updatedAt": "2023-06-09T19:50:49.000Z",
  "name": "v1",
  "releaseNotes": "This is the first release."
}
```

**SDK Code**

```python Create Version
import requests

url = "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions"

payload = {
    "collections": [{ "id": "e8a015e0-f472-4bb3-a523-57ce7c4583ed" }],
    "name": "v1",
    "releaseNotes": "This is the first release.",
    "schemas": [{ "id": "18a015e0-f472-4bb3-a523-57ce7c458387" }]
}
headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create Version
const url = 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"collections":[{"id":"e8a015e0-f472-4bb3-a523-57ce7c4583ed"}],"name":"v1","releaseNotes":"This is the first release.","schemas":[{"id":"18a015e0-f472-4bb3-a523-57ce7c458387"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create Version
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions"

	payload := strings.NewReader("{\n  \"collections\": [\n    {\n      \"id\": \"e8a015e0-f472-4bb3-a523-57ce7c4583ed\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"id\": \"18a015e0-f472-4bb3-a523-57ce7c458387\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create Version
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"collections\": [\n    {\n      \"id\": \"e8a015e0-f472-4bb3-a523-57ce7c4583ed\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"id\": \"18a015e0-f472-4bb3-a523-57ce7c458387\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Create Version
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"collections\": [\n    {\n      \"id\": \"e8a015e0-f472-4bb3-a523-57ce7c4583ed\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"id\": \"18a015e0-f472-4bb3-a523-57ce7c458387\"\n    }\n  ]\n}")
  .asString();
```

```php Create Version
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions', [
  'body' => '{
  "collections": [
    {
      "id": "e8a015e0-f472-4bb3-a523-57ce7c4583ed"
    }
  ],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [
    {
      "id": "18a015e0-f472-4bb3-a523-57ce7c458387"
    }
  ]
}',
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Create Version
using RestSharp;

var client = new RestClient("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"collections\": [\n    {\n      \"id\": \"e8a015e0-f472-4bb3-a523-57ce7c4583ed\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"id\": \"18a015e0-f472-4bb3-a523-57ce7c458387\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create Version
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "collections": [["id": "e8a015e0-f472-4bb3-a523-57ce7c4583ed"]],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [["id": "18a015e0-f472-4bb3-a523-57ce7c458387"]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Git-Linked Version with Schema Directory Path

**Request**

```json
{
  "branch": "develop",
  "collections": [
    {
      "filePath": "postman/collections/c1.json"
    }
  ],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [
    {
      "directoryPath": "postman/schema"
    }
  ]
}
```

**Response**

```json
{
  "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
  "createdAt": "2023-06-09T14:48:45.000Z",
  "updatedAt": "2023-06-09T19:50:49.000Z",
  "name": "v1",
  "releaseNotes": "This is the first release."
}
```

**SDK Code**

```python Git-Linked Version with Schema Directory Path
import requests

url = "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions"

payload = {
    "branch": "develop",
    "collections": [{ "filePath": "postman/collections/c1.json" }],
    "name": "v1",
    "releaseNotes": "This is the first release.",
    "schemas": [{ "directoryPath": "postman/schema" }]
}
headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Git-Linked Version with Schema Directory Path
const url = 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"branch":"develop","collections":[{"filePath":"postman/collections/c1.json"}],"name":"v1","releaseNotes":"This is the first release.","schemas":[{"directoryPath":"postman/schema"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Git-Linked Version with Schema Directory Path
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions"

	payload := strings.NewReader("{\n  \"branch\": \"develop\",\n  \"collections\": [\n    {\n      \"filePath\": \"postman/collections/c1.json\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"directoryPath\": \"postman/schema\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Git-Linked Version with Schema Directory Path
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branch\": \"develop\",\n  \"collections\": [\n    {\n      \"filePath\": \"postman/collections/c1.json\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"directoryPath\": \"postman/schema\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Git-Linked Version with Schema Directory Path
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branch\": \"develop\",\n  \"collections\": [\n    {\n      \"filePath\": \"postman/collections/c1.json\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"directoryPath\": \"postman/schema\"\n    }\n  ]\n}")
  .asString();
```

```php Git-Linked Version with Schema Directory Path
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions', [
  'body' => '{
  "branch": "develop",
  "collections": [
    {
      "filePath": "postman/collections/c1.json"
    }
  ],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [
    {
      "directoryPath": "postman/schema"
    }
  ]
}',
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Git-Linked Version with Schema Directory Path
using RestSharp;

var client = new RestClient("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branch\": \"develop\",\n  \"collections\": [\n    {\n      \"filePath\": \"postman/collections/c1.json\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"directoryPath\": \"postman/schema\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Git-Linked Version with Schema Directory Path
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "branch": "develop",
  "collections": [["filePath": "postman/collections/c1.json"]],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [["directoryPath": "postman/schema"]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Git-Linked Version with root File Integration

**Request**

```json
{
  "branch": "develop",
  "collections": [
    {
      "filePath": "postman/collections/c1.json"
    }
  ],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [
    {
      "directoryPath": "/dir/index.yml"
    }
  ]
}
```

**Response**

```json
{
  "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
  "createdAt": "2023-06-09T14:48:45.000Z",
  "updatedAt": "2023-06-09T19:50:49.000Z",
  "name": "v1",
  "releaseNotes": "This is the first release."
}
```

**SDK Code**

```python Git-Linked Version with root File Integration
import requests

url = "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions"

payload = {
    "branch": "develop",
    "collections": [{ "filePath": "postman/collections/c1.json" }],
    "name": "v1",
    "releaseNotes": "This is the first release.",
    "schemas": [{ "directoryPath": "/dir/index.yml" }]
}
headers = {
    "Accept": "application/vnd.api.v10+json",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Git-Linked Version with root File Integration
const url = 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/vnd.api.v10+json',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"branch":"develop","collections":[{"filePath":"postman/collections/c1.json"}],"name":"v1","releaseNotes":"This is the first release.","schemas":[{"directoryPath":"/dir/index.yml"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Git-Linked Version with root File Integration
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions"

	payload := strings.NewReader("{\n  \"branch\": \"develop\",\n  \"collections\": [\n    {\n      \"filePath\": \"postman/collections/c1.json\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"directoryPath\": \"/dir/index.yml\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Git-Linked Version with root File Integration
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branch\": \"develop\",\n  \"collections\": [\n    {\n      \"filePath\": \"postman/collections/c1.json\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"directoryPath\": \"/dir/index.yml\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Git-Linked Version with root File Integration
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")
  .header("Accept", "application/vnd.api.v10+json")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branch\": \"develop\",\n  \"collections\": [\n    {\n      \"filePath\": \"postman/collections/c1.json\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"directoryPath\": \"/dir/index.yml\"\n    }\n  ]\n}")
  .asString();
```

```php Git-Linked Version with root File Integration
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions', [
  'body' => '{
  "branch": "develop",
  "collections": [
    {
      "filePath": "postman/collections/c1.json"
    }
  ],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [
    {
      "directoryPath": "/dir/index.yml"
    }
  ]
}',
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Git-Linked Version with root File Integration
using RestSharp;

var client = new RestClient("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branch\": \"develop\",\n  \"collections\": [\n    {\n      \"filePath\": \"postman/collections/c1.json\"\n    }\n  ],\n  \"name\": \"v1\",\n  \"releaseNotes\": \"This is the first release.\",\n  \"schemas\": [\n    {\n      \"directoryPath\": \"/dir/index.yml\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Git-Linked Version with root File Integration
import Foundation

let headers = [
  "Accept": "application/vnd.api.v10+json",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "branch": "develop",
  "collections": [["filePath": "postman/collections/c1.json"]],
  "name": "v1",
  "releaseNotes": "This is the first release.",
  "schemas": [["directoryPath": "/dir/index.yml"]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/versions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```