> This page is for Postman API Docs.

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

# Get a collection's forks

GET https://api.postman.com/collections/{collectionId}/forks

Gets a collection's forked collections. The response returns data for each fork, such as the fork's ID, the user who forked it, and the fork's creation date.

Reference: https://learning.postman.com/api-docs/api-reference/collections/get-collection-forks

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

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

## Request

### Path parameters

- `collectionId` (string, required) — The collection's ID.

### Query parameters

- `cursor` (string, optional) — The pointer to the first record of the set of paginated results. To view the next response, use the `nextCursor` value for this parameter.
- `limit` (integer, optional, default: 10) — The maximum number of rows to return in the response.
- `direction` (enum, optional) — Sort the results by creation date in ascending (`asc`) or descending (`desc`) order.
  - Allowed values: `asc`, `desc`

## Response

### 200

Successful Response

- `data` (list of GetCollectionForksDataItems, optional) — A list of the collection's forks.
- `meta` (GetCollectionForksMeta, optional) — The response's meta information for paginated results.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (CommonErrorNameMessageError, optional) — Information about the error.

### 404 Not Found Error

Not Found

- `error` (Fork404ErrorError, optional) — Information about the error.

### 500 Internal Server Error

Internal Server Error

- `GetCollectionForksRequestInternalServerError`
  - Error (Type, Title, Detail): commonErrorTypeTitleDetail
  - Error (Type, Title, Detail, Status): commonErrorTypeTitleDetailStatus
  - Error (Name, Message): commonErrorNameMessage

## Types

### GetCollectionForksDataItems

Information about the forked collection.

- `createdAt` (datetime, optional) — The date and time at which the fork was created.
- `createdBy` (string, optional) — The user who created the collection fork.
- `forkId` (string, optional) — The forked collection's ID.
- `forkName` (string, optional) — The forked collection's label.

### GetCollectionForksMeta

The response's meta information for paginated results.

- `nextCursor` (string, optional, nullable) — The pagination cursor that points to the next record in the results set.
- `total` (double, optional) — The total number of forked collections.

### CommonErrorNameMessageError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.

### Fork404ErrorError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.

### commonErrorTypeTitleDetail

- `type` (string, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (CommonErrorTypeTitleDetailDetail, optional) — Information about the error.

### commonErrorTypeTitleDetailStatus

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### commonErrorNameMessage

- `error` (CommonErrorNameMessageError, optional) — Information about the error.

### CommonErrorTypeTitleDetailDetail

Information about the error.

- string
- map from string to any

### CommonErrorTypeTitleDetailStatusType

The type of error.

- string
- string

## Examples

### Successful Response

**Response**

```json
{
  "data": [
    {
      "createdAt": "2023-11-16T09:18:17.000Z",
      "createdBy": "Taylor Lee",
      "forkId": "12345678-667df1ad-2ee3-7890-b678-7742d82e2e1f",
      "forkName": "Collection Fork"
    },
    {
      "createdAt": "2023-11-16T09:16:15.000Z",
      "createdBy": "Alex Cruz",
      "forkId": "87654321-38j9f1ad-2ee3-7890-dv5h-7742d82e2e1f",
      "forkName": "Test Fork"
    }
  ],
  "meta": {
    "nextCursor": null,
    "total": 2
  }
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks"

headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript Successful Response
const url = 'https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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

```go Successful Response
package main

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

func main() {

	url := "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks"

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Successful Response
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

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

```java Successful Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Successful Response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```

### Response with cursor

**Response**

```json
{
  "data": [
    {
      "createdAt": "2023-11-16T09:16:15.000Z",
      "createdBy": "Alex Cruz",
      "forkId": "87654321-38j9f1ad-2ee3-7890-dv5h-7742d82e2e1f",
      "forkName": "Test Fork"
    },
    {
      "createdAt": "2023-11-15T08:12:27.000Z",
      "createdBy": "12345678",
      "forkId": "12345678-667df1ad-2ee3-7890-b678-7742d82e2e1f",
      "forkName": "Collection Fork"
    }
  ],
  "meta": {
    "nextCursor": null,
    "total": 2
  }
}
```

**SDK Code**

```python Response with cursor
import requests

url = "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks"

querystring = {"cursor":"eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ=="}

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Response with cursor
const url = 'https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?cursor=eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ%3D%3D';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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

```go Response with cursor
package main

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

func main() {

	url := "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?cursor=eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ%3D%3D"

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Response with cursor
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?cursor=eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ%3D%3D")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

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

```java Response with cursor
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?cursor=eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ%3D%3D")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Response with cursor
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?cursor=eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ%3D%3D', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Response with cursor
using RestSharp;

var client = new RestClient("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?cursor=eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ%3D%3D");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Response with cursor
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?cursor=eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ%3D%3D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```

### Response with direction

**Response**

```json
{
  "data": [
    {
      "createdAt": "2023-11-15T08:12:27.000Z",
      "createdBy": "12345678",
      "forkId": "12345678-667df1ad-2ee3-7890-b678-7742d82e2e1f",
      "forkName": "Collection Fork"
    },
    {
      "createdAt": "2023-11-16T09:16:15.000Z",
      "createdBy": "Alex Cruz",
      "forkId": "87654321-38j9f1ad-2ee3-7890-dv5h-7742d82e2e1f",
      "forkName": "Test Fork"
    }
  ],
  "meta": {
    "nextCursor": null,
    "total": 2
  }
}
```

**SDK Code**

```python Response with direction
import requests

url = "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks"

querystring = {"direction":"asc"}

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Response with direction
const url = 'https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?direction=asc';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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

```go Response with direction
package main

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

func main() {

	url := "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?direction=asc"

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Response with direction
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?direction=asc")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

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

```java Response with direction
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?direction=asc")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Response with direction
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?direction=asc', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Response with direction
using RestSharp;

var client = new RestClient("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?direction=asc");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Response with direction
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?direction=asc")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```

### Response with limit

**Response**

```json
{
  "data": [
    {
      "createdAt": "2023-11-15T08:12:27.000Z",
      "createdBy": "12345678",
      "forkId": "12345678-667df1ad-2ee3-7890-b678-7742d82e2e1f",
      "forkName": "Collection Fork"
    },
    {
      "createdAt": "2023-11-16T09:16:15.000Z",
      "createdBy": "Alex Cruz",
      "forkId": "87654321-38j9f1ad-2ee3-7890-dv5h-7742d82e2e1f",
      "forkName": "Test Fork"
    },
    {
      "createdAt": "2023-10-03T10:00:07.000Z",
      "createdBy": "Taylor Lee",
      "forkId": "12345678-667df1ad-2gnm-7890-b678-7742d82e2e1f",
      "forkName": "My Fork"
    },
    {
      "createdAt": "2023-12-18T00:02:25.000Z",
      "createdBy": "Taylor Lee",
      "forkId": "12345678-667df1ad-2ee3-ifb0-b678-7742d82e2e1f",
      "forkName": "Testing"
    },
    {
      "createdAt": "2023-12-29T02:28:11.000Z",
      "createdBy": "Alex Cruz",
      "forkId": "87654321-667df1ad-efbh-7880-b678-7742d82e2e1f",
      "forkName": "Example Fork"
    }
  ],
  "meta": {
    "nextCursor": "eyJpZCI6MzMyNzksImZvcmtzQWZ0ZXIiOjIwfQ==",
    "total": 10
  }
}
```

**SDK Code**

```python Response with limit
import requests

url = "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks"

querystring = {"limit":"5"}

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Response with limit
const url = 'https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?limit=5';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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

```go Response with limit
package main

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

func main() {

	url := "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?limit=5"

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Response with limit
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?limit=5")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

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

```java Response with limit
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?limit=5")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Response with limit
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?limit=5', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Response with limit
using RestSharp;

var client = new RestClient("https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?limit=5");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Response with limit
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/forks?limit=5")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```