> 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 an API

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

Gets information about an API.

**Note:**

- Git-connected APIs will only return the `versions` and `gitInfo` query responses. This is because schema and collection information is stored in the connected Git repository. The `gitInfo` object only lists the repository and folder locations of the files.
- API viewers can only use the `versions` option in the `include` query parameter.


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

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

### Query parameters

- `include` (list of enum, optional) — An array that contains additional resources to include in the response. Use this parameter to query for element links to the API, such as collections and schemas: - `collections` — Query for linked Postman collections. - `versions` — Query for linked versions. - `schemas` — Query for linked schemas. - `gitInfo` — Query for information about the API's git-linked repository. This query only returns the linked repository and folder locations of the files. It does not return `collections` or `schemas` information. **Note:** API viewers can only use the `versions` option.
  - Allowed values: `collections`, `versions`, `schemas`, `gitInfo`

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

- `getApi`
  - API Data: API Data
  - Extended API Data: GetApi1

## Errors

### 400 Bad Request Error

Missing v10 Accept Header

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

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

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

### 404 Not Found Error

Not Found

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

### 422 Unprocessable Entity Error

v9 Unsupported

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

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

## Types

### API Data

- `id` (string, optional) — The API's ID.
- `name` (string, optional) — The API's name.
- `summary` (string, optional) — The API's short summary.
- `createdAt` (datetime, optional) — The date and time at which the API was created.
- `createdBy` (long, optional) — The Postman ID of the user that created the API.
- `updatedAt` (datetime, optional) — The date and time at which the API was updated.
- `updatedBy` (long, optional) — The Postman ID of the user that updated the API.
- `description` (string, optional) — The API's description.

### GetApi1

The API's extended data schema. **Note:** Git-connected APIs will only return the `versions` and `gitInfo` query responses. This is because schema and collection information is stored in the connected Git repository. The `gitInfo` object only lists the repository and folder locations of the files.

- `id` (string, optional) — The API's ID.
- `name` (string, optional) — The API's name.
- `summary` (string, optional) — The API's short summary.
- `createdAt` (datetime, optional) — The date and time at which the API was created.
- `createdBy` (long, optional) — The Postman ID of the user that created the API.
- `updatedAt` (datetime, optional) — The date and time at which the API was updated.
- `updatedBy` (long, optional) — The Postman ID of the user that updated the API.
- `description` (string, optional) — The API's description.
- `gitInfo` (GetApiOneOf1GitInfo, optional) — Information about the API's Git repository integration.
- `schemas` (list of GetApiOneOf1SchemasItems, optional) — The API's schemas.
- `versions` (list of GetApiOneOf1VersionsItems, optional) — The API's versions.
- `collections` (list of GetApiOneOf1CollectionsItems, optional) — The API's collections.

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

### commonErrorTypeTitleDetail

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

### commonErrorErrorObjTypeTitleDetail

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

### CommonErrorTypeTitleDetailDetail

Information about the error.

- string
- map from string to any

### GetApiOneOf1GitInfo

Information about the API's Git repository integration.

- `domain` (string, optional, nullable) — The domain at which the Git repository is hosted.
- `repository` (string, optional) — The repository's name.
- `organization` (string, optional) — The organization that owns the repository.
- `schemaFolder` (string, optional) — The API definition's repository folder location.
- `collectionFolder` (string, optional) — The API definition's collection repository folder location.

### GetApiOneOf1SchemasItems

Information about the schema.

- `id` (string, optional) — The schema's ID.

### GetApiOneOf1VersionsItems

Information about the version.

- `id` (string, optional) — The version's ID.
- `name` (string, optional) — The version's name.

### GetApiOneOf1CollectionsItems

Information about the collection.

- `id` (string, optional) — The collection's ID.

### CommonErrorTypeTitleDetailStatusType

The type of error.

- string
- string

### CommonErrorNameMessageError

Information about the error.

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

### 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
{
  "collections": [
    {
      "id": "16bb367e-fafb-4ef3-933b-ee3d971866fb"
    }
  ],
  "createdAt": "2022-06-09T14:48:45.000Z",
  "createdBy": 12345678,
  "description": "This is a test API.",
  "gitInfo": {},
  "id": "5360b75f-447e-467c-9299-12fd6c92450d",
  "name": "Test API",
  "schemas": [
    {
      "id": "ae2b9ab2-28f2-401d-912f-eca09a78e98b"
    }
  ],
  "summary": "Test API.",
  "updatedAt": "2022-06-09T19:50:49.000Z",
  "updatedBy": 12345678,
  "versions": [
    {
      "id": "18ccb2dc-1746-4945-ba76-8152b37cr123",
      "name": "v1.0.0"
    }
  ]
}
```

**SDK Code**

```python Successful Response
import requests

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

querystring = {"include":"[\"schemas\"]"}

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?include=%5B%22schemas%22%5D';
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?include=%5B%22schemas%22%5D"

	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?include=%5B%22schemas%22%5D")

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?include=%5B%22schemas%22%5D")
  .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?include=%5B%22schemas%22%5D', [
  '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?include=%5B%22schemas%22%5D");
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?include=%5B%22schemas%22%5D")! 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()
```