Search commands

View as Markdown

This topic covers search commands for the Postman CLI.

You can use the postman search command to search for Postman elements, such as requests, collections, workspaces, flows, mocks, environments, and specifications. You can then reference them in your CI/CD pipelines, automation workflows, and scripts. The command can also be used by AI agents that use the Postman CLI.

To use this command, sign in to Postman with the postman login command.

Usage

$postman search <type> [query] [options]
<type>
'requests' | 'collections' | 'workspaces' | 'flows' | 'mocks' | 'environments' | 'specs'

The type of Postman element to search for.

[query]

An optional search term, such as a name or keyword. For example, "auth".

Options

--ownership <ownership>
'organization' | 'org' | 'external' | 'all'Defaults to organization

Filters results by ownership:

  • organization or org — Search resources owned by your organization.
  • external — Search resources outside your organization.
  • all — Search both organization and external resources.
-n, --limit <limit>
Defaults to 10

Sets the maximum number of results per page. The maximum allowed value is 25.

--cursor <cursor>

Cursor value for paginating through results. Use the cursor returned in the previous response to fetch the next page. See Pagination.

-o, --output <format>
'default' | 'json'Defaults to default

Controls the output format.

  • default — Card list including a basic overview and web link per result.
  • json — Detailed JSON response with search metadata.
--filter <expression>

Filters results using an expression string. See Filter syntax for supported operators and field names.

--filter-json <json>

Filters results using a raw JSON object. Only a top-level $and array of condition objects is supported. $or and nested groups are not supported. Each condition maps one field to one operator object ($eq, $ne, $in, $nin).

For example: {"$and":[{"workspaceId":{"$eq":"ws-abc123"}}]}

If both --filter and --filter-json are provided, --filter-json takes precedence.

Filter syntax

The --filter option accepts an expression string with the following rules:

  • Use = or != for single values: workspaceId=ws-1.
  • Use IN or NIN for comma-separated values: workspaceId IN ws-1,ws-2.
  • Combine multiple conditions with AND. Operators are case-insensitive.
  • Quote values that contain spaces or commas: <field>="value with spaces".

Shared filter fields

The following filter fields are available for all element types.

FieldOperatorsNotes
privateNetwork=, !=Accepts true or false.
publisherIsVerified=, !=Accepts true or false.
visibility=, !=Refers to workspace type. Accepts internal, public, or partner.
workspaceId=, !=, IN, NINWorkspace ID.
createdBy=, !=, IN, NINUser ID.
organizationId=, !=, IN, NINOrganization ID.
teamId=, !=, IN, NINTeam ID.
isGitConnected=, !=Accepts true or false.

ID filters such as createdBy, organizationId, teamId, workspaceId, and collectionId expect IDs, not display names. Use --output json on a broader search to inspect available IDs.

Pagination

The --limit option accepts up to 25 results per page. To fetch the next page, pass the cursor value returned in the previous response to --cursor.

$postman search requests "auth" --limit 25
$postman search requests "auth" --limit 25 --cursor <cursor-from-previous-response>

postman search requests

Search for requests by name, keyword, or URL.

Usage

$postman search requests [query] [options]

Filter fields

In addition to the shared filter fields, the following fields are specific to requests.

FieldOperatorsNotes
collectionId=, !=, IN, NINCollection ID.
method=, !=, IN, NINHTTP method, such as GET, POST, PUT, PATCH, or DELETE.
requestId=, !=, IN, NINRequest ID.
type=, !=, IN, NINProtocol type. Accepted values include http-request, graphql-request, grpc-request, ws-raw-request, ws-socketio-request, mqtt-request, llm-request.

Examples

$postman search requests "login"
$
$postman search requests "auth" --filter "method=POST AND collectionId=collection-uid-1"
$
$postman search requests "upload" --filter "method IN POST,PUT AND workspaceId=ws-abc123"
$
$postman search requests "internal api" --filter "method=POST AND privateNetwork=true"
$
$postman search requests "payment" --ownership external --limit 5 --filter "visibility=public"
$
$postman search requests "auth" --filter "method NIN GET" --ownership org --limit 10 --output json

postman search collections

Search for collections by name or keyword.

Usage

$postman search collections [query] [options]

Filter fields

In addition to the shared filter fields, the following fields are specific to collections.

FieldOperatorsNotes
collectionId=, !=, IN, NINCollection ID.
tags=, !=, IN, NINCollection tags.

Examples

$postman search collections "payments"
$
$postman search collections "postman" --filter "visibility=public"
$
$postman search collections "payments" --ownership external --limit 10 --filter "visibility=public"
$
$postman search collections "internal" --filter "workspaceId IN ws-1,ws-2"
$
$postman search collections "apis" --filter "tags IN public,team-api" --output json

postman search workspaces

Search for workspaces by name or keyword.

Usage

$postman search workspaces [query] [options]

Filter fields

In addition to the shared filter fields, the following fields are specific to workspaces.

FieldOperatorsNotes
tags=, !=, IN, NINWorkspace tags.

Examples

$postman search workspaces "team"
$
$postman search workspaces "platform" --ownership organization
$
$postman search workspaces "public apis" --ownership external --filter "visibility=public"
$
$postman search workspaces "trusted workspace" --filter "privateNetwork=true"

postman search flows

Search for flows by name or keyword.

Usage

$postman search flows [query] [options]

Filter fields

In addition to the shared filter fields, the following field is specific to flows.

FieldOperatorsNotes
flowId=, !=, IN, NINFlow ID.

Examples

$postman search flows "onboarding"
$
$postman search flows "checkout" --ownership organization --limit 20
$
$postman search flows "billing" --filter "workspaceId=ws-abc123"
$
$postman search flows "internal" --filter "flowId IN flow-1,flow-2"

postman search mocks

Search for mocks by name or keyword.

Usage

$postman search mocks [query] [options]

Filter fields

In addition to the shared filter fields, the following field is specific to mocks.

FieldOperatorsNotes
mockId=, !=, IN, NINMock ID.

Examples

$postman search mocks "Auth service mock"
$
$postman search mocks "auth" --filter "workspaceId=ws-abc123"
$
$postman search mocks --filter "mockId=mock-abc123"

postman search environments

Search for environments by name or keyword.

Usage

$postman search environments [query] [options]

Filter fields

In addition to the shared filter fields, the following field is specific to environments.

FieldOperatorsNotes
environmentId=, !=, IN, NINEnvironment ID.

Examples

$postman search environments "Beta Access control service"
$
$postman search environments "Payment service" --filter "workspaceId=ws-abc123"
$
$postman search environments --filter "environmentId=env-abc123"

postman search specs

Search for API specifications by name or keyword.

Usage

$postman search specs [query] [options]

Filter fields

In addition to the shared filter fields, the following field is specific to specs.

FieldOperatorsNotes
specificationId=, !=, IN, NINSpecification ID.

Examples

$postman search specs "openapi"
$
$postman search specs "my api spec" --filter "specificationId=spec-abc123"
$
$postman search specs "billing" --ownership external
$
$postman search specs "payments" --ownership external --filter "publisherIsVerified=true AND visibility=public"