Skip to main content

SecretScannerService

A list of all methods in the SecretScannerService service. Click on the method name to view detailed information about that method.

MethodsDescription
detected_secrets_queriesReturns all secrets detected by Postman's Secret Scanner, grouped by workspace. If you pass an empty request body, this endpoint returns all results.
update_detected_secret_resolutionsUpdates the resolution status of a secret detected in a workspace.
get_detected_secrets_locationsGets the locations of secrets detected by Postman's Secret Scanner.
get_secret_typesGets the metadata of the secret types supported by Postman's Secret Scanner. You can use a secret type's ID in the response to query data with the POST /detected-secrets/{secretId} endpoint.

detected_secrets_queries

Returns all secrets detected by Postman's Secret Scanner, grouped by workspace. If you pass an empty request body, this endpoint returns all results.

  • HTTP Method: POST
  • Endpoint: /detected-secrets-queries

Parameters

NameTypeRequiredDescription
request_bodyDetectedSecretsQueriesRequestThe request body.
limitintThe maximum number of rows to return in the response.
cursorstrThe pointer to the first record of the set of paginated results. To view the next response, use the nextCursor value for this parameter.
includestrThe additional fields to be included as a part of the request.

Return Type

DetectedSecretsQueriesOkResponse

Example Usage Code Snippet

from postman_client import PostmanClient, Environment
from postman_client.models import DetectedSecretsQueriesRequest

sdk = PostmanClient(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value,
timeout=10000
)

request_body = DetectedSecretsQueriesRequest(
resolved=True,
secret_types=[
"1a7ec5d1-dcba-4ec7-8220-3c1ee490416b"
],
statuses=[
"FALSE_POSITIVE"
],
workspace_ids=[
"0fe6c2f2-022d-48f7-8e7e-3244369445b0"
],
workspace_visiblities=[
"team"
]
)

result = sdk.secret_scanner.detected_secrets_queries(
request_body=request_body,
limit=10,
cursor="RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk=",
include="meta.total"
)

print(result)

update_detected_secret_resolutions

Updates the resolution status of a secret detected in a workspace.

  • HTTP Method: PUT
  • Endpoint: /detected-secrets/{secretId}

Parameters

NameTypeRequiredDescription
request_bodyUpdateDetectedSecretResolutionsRequestThe request body.
secret_idstrThe secret's ID.

Return Type

UpdateDetectedSecretResolutionsOkResponse

Example Usage Code Snippet

from postman_client import PostmanClient, Environment
from postman_client.models import UpdateDetectedSecretResolutionsRequest

sdk = PostmanClient(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value,
timeout=10000
)

request_body = UpdateDetectedSecretResolutionsRequest(
resolution="FALSE_POSITIVE",
workspace_id="e361eeb4-00dd-4225-9774-6146a2555999"
)

result = sdk.secret_scanner.update_detected_secret_resolutions(
request_body=request_body,
secret_id="ODk0MTU2"
)

print(result)

get_detected_secrets_locations

Gets the locations of secrets detected by Postman's Secret Scanner.

  • HTTP Method: GET
  • Endpoint: /detected-secrets/{secretId}/locations

Parameters

NameTypeRequiredDescription
secret_idstrThe secret's ID.
workspace_idstrThe workspace's ID.
limitintThe maximum number of rows to return in the response.
cursorstrThe pointer to the first record of the set of paginated results. To view the next response, use the nextCursor value for this parameter.

Return Type

GetSecretsLocations

Example Usage Code Snippet

from postman_client import PostmanClient, Environment

sdk = PostmanClient(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value,
timeout=10000
)

result = sdk.secret_scanner.get_detected_secrets_locations(
secret_id="ODk0MTU2",
workspace_id="1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
limit=10,
cursor="RnJpIEZlYiAyNCAyMDIzIDEzOjI0OjA5IEdNVCswMDAwIChDb29yZGluYXRlZCBVbml2ZXJzYWwgVGltZSk="
)

print(result)

get_secret_types

Gets the metadata of the secret types supported by Postman's Secret Scanner. You can use a secret type's ID in the response to query data with the POST /detected-secrets/{secretId} endpoint.

  • HTTP Method: GET
  • Endpoint: /secret-types

Return Type

GetSecretTypes

Example Usage Code Snippet

from postman_client import PostmanClient, Environment

sdk = PostmanClient(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value,
timeout=10000
)

result = sdk.secret_scanner.get_secret_types()

print(result)

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →