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

# Get all components

GET https://api.getpostman.com/components

Gets a list of all components in the team's component library.

Reference: https://learning.postman.com/api-docs/api-reference/components/get-all-components

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /components:
    get:
      operationId: getAllComponents
      summary: Get all components
      description: Gets a list of all components in the team's component library.
      tags:
        - components
      parameters:
        - name: type
          in: query
          description: Filter results by component type.
          required: false
          schema:
            $ref: '#/components/schemas/componentType'
        - name: status
          in: query
          description: Filter results by the component's status.
          required: false
          schema:
            $ref: '#/components/schemas/componentStatus'
        - name: hasVersions
          in: query
          description: If true, return only components with published versions.
          required: false
          schema:
            $ref: '#/components/schemas/componentHasVersions'
        - name: include
          in: query
          description: >-
            A comma-separated list of additional fields to include. Accepts the
            `hasVersions`, `latestVersion`, `latestVersion.content` values.
          required: false
          schema:
            $ref: '#/components/schemas/componentIncludeFields'
        - name: expand
          in: query
          description: >-
            A comma-separated list of fields to expand. Accepts the
            `latestVersion` value.
          required: false
          schema:
            $ref: '#/components/schemas/componentExpandLatestVersion'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getAllComponents'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllComponentsRequestUnauthorizedError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetAllComponentsRequestInternalServerError
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:
    componentType:
      type: string
      enum:
        - OAS2
        - OAS3
        - OAS3_1
      description: >-
        The component's type. Corresponds to the specification that the
        component's content adheres to.
      title: componentType
    componentStatus:
      type: string
      enum:
        - active
        - archived
      description: >
        The component's lifecycle state:

        - `active` — The component is active and can be edited and published.

        - `archived` — The component is archived and read-only. Archived
        components can't be edited or published, but their existing versions
        remain accessible.
      title: componentStatus
    componentHasVersions:
      type: boolean
      title: componentHasVersions
    componentIncludeFields:
      type: string
      title: componentIncludeFields
    componentExpandLatestVersion:
      type: string
      title: componentExpandLatestVersion
    meta:
      type: object
      properties:
        nextCursor:
          type:
            - string
            - 'null'
          description: >-
            The pagination cursor that points to the next record in the results
            set.
      title: meta
    componentVersionId:
      type: string
      description: The component version's ID.
      title: componentVersionId
    componentVersionData:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/componentVersionId'
        label:
          type: string
          description: The component version's label.
        url:
          type: string
          format: uri
          description: The URL where the component version can be accessed.
        format:
          type: string
          description: The component version's content format.
        publishedAt:
          type: string
          format: date-time
          description: The date and time at which the component version was published.
        content:
          type: string
          description: >-
            The version's content. This returns when you include the `include`
            parameter.
      description: Information about a component's version.
      title: componentVersionData
    ComponentDataLatestVersion:
      oneOf:
        - type: string
        - $ref: '#/components/schemas/componentVersionData'
      description: >
        Information about the component's latest version. This property only
        returns only when you pass the `latestVersion` value for the `include`
        parameter.


        To return detailed information about the component's latest version,
        pass the `latestVersion` value for the `expand` parameter.
      title: ComponentDataLatestVersion
    componentData:
      type: object
      properties:
        id:
          type: string
          description: The component's ID.
        name:
          type: string
          description: The component's name.
        type:
          $ref: '#/components/schemas/componentType'
        status:
          $ref: '#/components/schemas/componentStatus'
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the component was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the component was last updated.
        createdBy:
          type: string
          description: The ID of the user who created the component.
        updatedBy:
          type: string
          description: The ID of the user who last updated the component.
        hasVersions:
          type: boolean
          description: >-
            Whether the component has versions. Returns only when you pass the
            `hasVersions` value for the `include` parameter.
        latestVersion:
          $ref: '#/components/schemas/ComponentDataLatestVersion'
          description: >
            Information about the component's latest version. This property only
            returns only when you pass the `latestVersion` value for the
            `include` parameter.


            To return detailed information about the component's latest version,
            pass the `latestVersion` value for the `expand` parameter.
      description: Information about the component.
      title: componentData
    getAllComponents:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/meta'
        data:
          type: array
          items:
            $ref: '#/components/schemas/componentData'
          description: A list of components.
      title: getAllComponents
    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
    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
    GetAllComponentsRequestUnauthorizedError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetAllComponentsRequestUnauthorizedError
    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
    GetAllComponentsRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetAllComponentsRequestInternalServerError
  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

### Successful Response



**Response**

```json
{
  "data": [
    {
      "id": "01KT964C30J3DPJQKEACZH39N8",
      "name": "example-component",
      "type": "OAS3",
      "status": "active",
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-01-15T10:30:00.000Z",
      "createdBy": "12345678",
      "updatedBy": "12345678"
    },
    {
      "id": "01KT964C30J3DPJQKEACZH39N9",
      "name": "another-component",
      "type": "OAS2",
      "status": "active",
      "createdAt": "2026-01-14T09:20:00.000Z",
      "updatedAt": "2026-01-14T09:20:00.000Z",
      "createdBy": "12345678",
      "updatedBy": "12345678"
    }
  ]
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.getpostman.com/components"

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

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

print(response.json())
```

```javascript Successful Response
const url = 'https://api.getpostman.com/components';
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.getpostman.com/components"

	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.getpostman.com/components")

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.getpostman.com/components")
  .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.getpostman.com/components', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.getpostman.com/components");
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.getpostman.com/components")! 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()
```

### Filter Results by include



**Response**

```json
{
  "data": [
    {
      "id": "01KT964C30J3DPJQKEACZH39N8",
      "name": "example-component",
      "type": "OAS3",
      "status": "active",
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-01-15T10:30:00.000Z",
      "createdBy": "12345678",
      "updatedBy": "12345678",
      "hasVersions": true
    },
    {
      "id": "01KT964C30J3DPJQKEACZH39N9",
      "name": "another-component",
      "type": "OAS2",
      "status": "active",
      "createdAt": "2026-01-14T09:20:00.000Z",
      "updatedAt": "2026-01-14T09:20:00.000Z",
      "createdBy": "12345678",
      "updatedBy": "12345678",
      "hasVersions": false
    }
  ]
}
```

**SDK Code**

```python Filter Results by include
import requests

url = "https://api.getpostman.com/components"

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

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

print(response.json())
```

```javascript Filter Results by include
const url = 'https://api.getpostman.com/components';
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 Filter Results by include
package main

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

func main() {

	url := "https://api.getpostman.com/components"

	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 Filter Results by include
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/components")

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 Filter Results by include
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.getpostman.com/components")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Filter Results by include
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getpostman.com/components', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Filter Results by include
using RestSharp;

var client = new RestClient("https://api.getpostman.com/components");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Filter Results by include
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/components")! 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()
```

### Filter Results by include and expand



**Response**

```json
{
  "data": [
    {
      "id": "01KT964C30J3DPJQKEACZH39N8",
      "name": "example-component",
      "type": "OAS3",
      "status": "active",
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-01-15T10:30:00.000Z",
      "createdBy": "12345678",
      "updatedBy": "12345678",
      "latestVersion": {
        "content": "components:\n  schemas:\n    sampleUser:\n      description: A sample user object\n      type: object\n      properties:\n        id:\n          type: string\n        name:\n          type: string\n        email:\n          type: string\n      required:\n        - id\n        - name\n        - email\n  responses:\n    sampleError:\n      description: A sample error response\n      content:\n        application/json:\n          schema:\n              type: object\n              properties:\n                  code:\n                    type: string\n                  message:\n                    type: string\n              required:\n                 - code\n                 - message\n  parameters:\n    sampleParam:\n      name: limit\n      in: query\n      description: A sample query parameter\n      schema:\n        type: integer\n        minimum: 1\n        maximum: 100\n        default: 10\n",
        "format": "YAML",
        "id": "01KTK2XSBAA9JHA4KZ4AYTM9VS",
        "label": "v1.0.0",
        "publishedAt": "2026-06-08T07:42:31.000Z",
        "url": "https://components.postman.com/example/Test1/1.0.0"
      }
    },
    {
      "id": "01KT964C30J3DPJQKEACZH39N9",
      "name": "another-component",
      "type": "OAS2",
      "status": "active",
      "createdAt": "2026-01-14T09:20:00.000Z",
      "updatedAt": "2026-01-14T09:20:00.000Z",
      "createdBy": "12345678",
      "updatedBy": "12345678"
    }
  ]
}
```

**SDK Code**

```python Filter Results by include and expand
import requests

url = "https://api.getpostman.com/components"

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

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

print(response.json())
```

```javascript Filter Results by include and expand
const url = 'https://api.getpostman.com/components';
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 Filter Results by include and expand
package main

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

func main() {

	url := "https://api.getpostman.com/components"

	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 Filter Results by include and expand
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/components")

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 Filter Results by include and expand
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.getpostman.com/components")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Filter Results by include and expand
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getpostman.com/components', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Filter Results by include and expand
using RestSharp;

var client = new RestClient("https://api.getpostman.com/components");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Filter Results by include and expand
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/components")! 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()
```