> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Create a version

POST https://api.getpostman.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/api/create-api-version

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /apis/{apiId}/versions:
    post:
      operationId: createApiVersion
      summary: Create a version
      description: >
        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.
      tags:
        - api
      parameters:
        - name: apiId
          in: path
          description: The API's ID.
          required: true
          schema:
            $ref: '#/components/schemas/apiId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          description: >-
            The `application/vnd.api.v10+json` request header required to use
            the endpoint.
          required: true
          schema:
            $ref: '#/components/schemas/v10Accept'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createApiVersionResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatusInstance'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiVersionRequestForbiddenError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiVersionRequestNotFoundError'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateApiVersionRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/API_createApiVersion_Request'
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    apiId:
      type: string
      title: apiId
    v10Accept:
      type: string
      enum:
        - application/vnd.api.v10+json
      title: v10Accept
    CreateGitUnlinkedVersionSchemaSchemasItems:
      type: object
      properties:
        id:
          type: string
          description: The schema's ID.
      description: Information about the schema.
      title: CreateGitUnlinkedVersionSchemaSchemasItems
    CreateGitUnlinkedVersionSchemaCollectionsItems:
      type: object
      properties:
        id:
          type: string
          description: The collection's ID.
      description: Information about the collection.
      title: CreateGitUnlinkedVersionSchemaCollectionsItems
    createGitUnlinkedVersionSchema:
      type: object
      properties:
        name:
          type: string
          description: The version's name.
        schemas:
          type: array
          items:
            $ref: '#/components/schemas/CreateGitUnlinkedVersionSchemaSchemasItems'
          description: A list of the version's schemas.
        collections:
          type: array
          items:
            $ref: >-
              #/components/schemas/CreateGitUnlinkedVersionSchemaCollectionsItems
          description: A list of the version's collections.
        releaseNotes:
          type: string
          description: >-
            Information about the API version release. For example, changelog
            notes.
      required:
        - name
        - schemas
        - collections
      description: Information about the API version.
      title: createGitUnlinkedVersionSchema
    CreateGitLinkedVersionSchemasItems:
      type: object
      properties:
        directoryPath:
          type: string
          description: >-
            The path to the root directory where schemas are stored in the Git
            repository.
      description: Information about the schema.
      title: CreateGitLinkedVersionSchemasItems
    CreateGitLinkedVersionCollectionsItems:
      type: object
      properties:
        filePath:
          type: string
          description: The path to the collection in the Git repository.
      description: Information about the collection.
      title: CreateGitLinkedVersionCollectionsItems
    createGitLinkedVersion:
      type: object
      properties:
        name:
          type: string
          description: The version's name.
        branch:
          type: string
          description: The branch ID.
        schemas:
          type: array
          items:
            $ref: '#/components/schemas/CreateGitLinkedVersionSchemasItems'
          description: A list of the version's schemas.
        collections:
          type: array
          items:
            $ref: '#/components/schemas/CreateGitLinkedVersionCollectionsItems'
          description: A list of the version's collections.
        releaseNotes:
          type: string
          description: >-
            Information about the API version release. For example, changelog
            notes.
      required:
        - name
        - branch
        - schemas
        - collections
      description: Information about the API version.
      title: createGitLinkedVersion
    CreateGitLinkedVersionRootFileSchemasItems:
      type: object
      properties:
        filePath:
          type: string
          description: The path to the schema root file in the Git repository.
      description: Information about the schema.
      title: CreateGitLinkedVersionRootFileSchemasItems
    CreateGitLinkedVersionRootFileCollectionsItems:
      type: object
      properties:
        filePath:
          type: string
          description: Path to a collection in the Git repository.
      description: Information about the collection.
      title: CreateGitLinkedVersionRootFileCollectionsItems
    createGitLinkedVersionRootFile:
      type: object
      properties:
        name:
          type: string
          description: The version's name.
        branch:
          type: string
          description: The branch ID.
        schemas:
          type: array
          items:
            $ref: '#/components/schemas/CreateGitLinkedVersionRootFileSchemasItems'
          description: A list of the version's schemas.
        collections:
          type: array
          items:
            $ref: >-
              #/components/schemas/CreateGitLinkedVersionRootFileCollectionsItems
          description: A list of the version's collections.
        releaseNotes:
          type: string
          description: >-
            Information about the API version release. For example, changelog
            notes.
      required:
        - name
        - branch
        - schemas
        - collections
      description: Information about the API version.
      title: createGitLinkedVersionRootFile
    API_createApiVersion_Request:
      oneOf:
        - $ref: '#/components/schemas/createGitUnlinkedVersionSchema'
        - $ref: '#/components/schemas/createGitLinkedVersion'
        - $ref: '#/components/schemas/createGitLinkedVersionRootFile'
      title: API_createApiVersion_Request
    createApiVersionResponse:
      type: object
      properties:
        id:
          type: string
          description: The version's ID.
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the version was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the version was last updated.
        name:
          type: string
          description: The version's name.
        releaseNotes:
          type: string
          description: >-
            Information about the API version release. For example, changelog
            notes.
      title: createApiVersionResponse
    commonErrorTypeTitleDetailStatusInstance:
      type: object
      properties:
        type:
          type: string
          format: uri-reference
          description: >-
            The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that
            identifies the type of problem.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: An explanation about the problem.
        status:
          type: integer
          description: The HTTP status code generated by the origin server.
        instance:
          type: string
          description: >-
            The URI reference that identifies the specific occurrence of the
            problem.
      title: commonErrorTypeTitleDetailStatusInstance
    CommonErrorTypeTitleDetailDetail:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: Information about the error.
      title: CommonErrorTypeTitleDetailDetail
    commonErrorTypeTitleDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailDetail'
          description: Information about the error.
      title: commonErrorTypeTitleDetail
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
    commonErrorTypeTitleMessageDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        message:
          type: string
          description: The error message.
        detail:
          type: object
          additionalProperties:
            description: Any type
          description: Information about the error.
      title: commonErrorTypeTitleMessageDetail
    CreateApiVersionRequestForbiddenError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorTypeTitleMessageDetail'
      title: CreateApiVersionRequestForbiddenError
    CommonErrorErrorObjTypeTitleDetailError:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Details about the error.
      description: Information about the error.
      title: CommonErrorErrorObjTypeTitleDetailError
    commonErrorErrorObjTypeTitleDetail:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorErrorObjTypeTitleDetailError'
          description: Information about the error.
      title: commonErrorErrorObjTypeTitleDetail
    CreateApiVersionRequestNotFoundError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorErrorObjTypeTitleDetail'
      title: CreateApiVersionRequestNotFoundError
    CommonErrorNameMessageError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: CommonErrorNameMessageError
    commonErrorNameMessage:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageError'
          description: Information about the error.
      title: commonErrorNameMessage
    CreateApiVersionRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: CreateApiVersionRequestInternalServerError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## 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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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.getpostman.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()
```