> 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 a component

GET https://api.getpostman.com/components/{componentId}

Gets information about a component. Use the `include` and `expand` query parameters to return additional information, such as `hasVersions` and the latest published version.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /components/{componentId}:
    get:
      operationId: getComponent
      summary: Get a component
      description: >-
        Gets information about a component. Use the `include` and `expand` query
        parameters to return additional information, such as `hasVersions` and
        the latest published version.
      tags:
        - components
      parameters:
        - name: componentId
          in: path
          description: The component's ID.
          required: true
          schema:
            $ref: '#/components/schemas/componentId'
        - 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/getComponent'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetComponentRequestUnauthorizedError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetComponentRequestForbiddenError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetComponentRequestInternalServerError'
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:
    componentId:
      type: string
      description: The component's ID.
      title: componentId
    componentIncludeFields:
      type: string
      title: componentIncludeFields
    componentExpandLatestVersion:
      type: string
      title: componentExpandLatestVersion
    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
    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
    getComponent:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/componentData'
      title: getComponent
    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
    GetComponentRequestUnauthorizedError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetComponentRequestUnauthorizedError
    GetComponentRequestForbiddenError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetComponentRequestForbiddenError
    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
    GetComponentRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetComponentRequestInternalServerError
  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



**Response**

```json
{
  "createdAt": "2026-01-15T10:30:00.000Z",
  "createdBy": "12345678",
  "id": "01KT964C30J3DPJQKEACZH39N8",
  "name": "example-component",
  "type": "OAS3",
  "updatedAt": "2026-01-15T10:30:00.000Z",
  "updatedBy": "12345678"
}
```

**SDK Code**

```python Successful Response
import requests

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

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

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

print(response.json())
```

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

	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/01KT964C30J3DPJQKEACZH39N8")

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

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

```csharp Successful Response
using RestSharp;

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