> 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 schema files

GET https://api.postman.com/apis/{apiId}/schemas/{schemaId}/files

Gets the files in an API schema. You can use the `versionId` query parameter to get schema files published in an API version.

**Note:**

The `versionId` query parameter is a required parameter for API viewers.


Reference: https://learning.postman.com/api-docs/api-reference/ap-is/get-api-schema-files

## 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

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

### Query parameters

- `versionId` (string, optional) — The API's version ID. This is a required parameter for API viewers.
- `limit` (integer, optional, default: 10) — The maximum number of rows to return in the response.
- `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.

### Headers

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

## Response

### 200

Successful Response

- `meta` (GetApiSchemaFilesMeta, optional) — The schema's non-standard meta information.
- `files` (list of GetApiSchemaFilesFilesItems, optional) — A list of the schema's files.

## Errors

### 400 Bad Request Error

Bad Request

- `GetApiSchemaFilesRequestBadRequestError`
  - Error (Type, Title, Detail): commonErrorTypeTitleDetail
  - API Error (Name, Message): apiErrorNameMessage
  - Error (Name, Message): commonErrorNameMessage

### 401 Unauthorized Error

Unauthorized

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — An explanation about the problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### 403 Forbidden Error

Forbidden

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

### 404 Not Found Error

Not Found

- `GetApiSchemaFilesRequestNotFoundError`
  - Error (Type, Title, Detail): commonErrorTypeTitleDetail
  - Error (Type, Title, Detail): commonErrorErrorObjTypeTitleDetail

### 422 Unprocessable Entity Error

Unprocessable Entity

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

### 500 Internal Server Error

Internal Server Error

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

## Types

### GetApiSchemaFilesMeta

The schema's non-standard meta information.

- `nextCursor` (string, optional) — The pointer to the next record in the set of paginated results.

### GetApiSchemaFilesFilesItems

Information about the schema file.

- `id` (string, optional) — The schema file's ID.
- `name` (string, optional) — The schema file's name.
- `path` (string, optional) — The file system path to the schema file.
- `createdAt` (datetime, optional) — The date and time at which the file was created.
- `createdBy` (long, optional) — The user ID of the user that created the file.
- `updatedAt` (datetime, optional) — The date and time at which the file was last updated.
- `updatedBy` (integer, optional) — The user ID of the user that last updated the file.

### commonErrorTypeTitleDetail

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

### apiErrorNameMessage

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

### commonErrorNameMessage

- `error` (CommonErrorNameMessageError, 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.

### commonErrorErrorObjTypeTitleDetail

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

### CommonErrorTypeTitleDetailDetail

Information about the error.

- string
- map from string to any

### CommonErrorNameMessageError

Information about the error.

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

### CommonErrorTypeTitleDetailStatusType

The type of error.

- string
- string

### CommonErrorErrorObjTypeTitleDetailError

Information about the error.

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

## Examples

**Response**

```json
{
  "meta": {
    "nextCursor": "eyJzY2hlbWUiOiJwYXRoX2FzYyIsImRpcmVjdGlvblR5cGUiOiJuZXh0IiwicGl2b3QiOiJwYXRoIiwidmFsdWUiOiJOZXdQZXQuanNvbiJ9"
  },
  "files": [
    {
      "id": "e8a015e0-f472-4bb3-a523-57ce7c4583ed",
      "name": "error.yaml",
      "path": "data-model/error.yaml",
      "createdAt": "2022-03-29T11:37:15Z",
      "createdBy": 12345678,
      "updatedAt": "2022-03-29T11:37:15Z",
      "updatedBy": 12345678
    },
    {
      "id": "e8a015e0-f472-4bb3-a523-57ce7c4583ef",
      "name": "error2.yaml",
      "path": "data-model/error2.yaml",
      "createdAt": "2022-03-29T11:37:15Z",
      "createdBy": 12345678,
      "updatedAt": "2022-03-29T11:37:15Z",
      "updatedBy": 12345678
    }
  ]
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files"

querystring = {"cursor":"RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk=","limit":"10","versionId":"12ece9e1-2abf-4edc-8e34-de66e74114d2"}

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

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

print(response.json())
```

```javascript Successful Response
const url = 'https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files?cursor=RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk%3D&limit=10&versionId=12ece9e1-2abf-4edc-8e34-de66e74114d2';
const options = {
  method: 'GET',
  headers: {Accept: 'application/vnd.api.v10+json', '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/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files?cursor=RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk%3D&limit=10&versionId=12ece9e1-2abf-4edc-8e34-de66e74114d2"

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

	req.Header.Add("Accept", "application/vnd.api.v10+json")
	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/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files?cursor=RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk%3D&limit=10&versionId=12ece9e1-2abf-4edc-8e34-de66e74114d2")

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

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/vnd.api.v10+json'
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/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files?cursor=RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk%3D&limit=10&versionId=12ece9e1-2abf-4edc-8e34-de66e74114d2")
  .header("Accept", "application/vnd.api.v10+json")
  .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/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files?cursor=RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk%3D&limit=10&versionId=12ece9e1-2abf-4edc-8e34-de66e74114d2', [
  'headers' => [
    'Accept' => 'application/vnd.api.v10+json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files?cursor=RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk%3D&limit=10&versionId=12ece9e1-2abf-4edc-8e34-de66e74114d2");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/vnd.api.v10+json");
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/apis/90ca9f5a-c4c4-11ed-afa1-0242ac120002/schemas/5381f010-c4c1-11ed-afa1-0242ac120002/files?cursor=RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk%3D&limit=10&versionId=12ece9e1-2abf-4edc-8e34-de66e74114d2")! 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()
```