---
updatedAt: 2026-05-28T13:22:33.000Z
agentTools:
  projectIndex: https://api.help.mabl.com/llms.txt
---

# Query Credentials

Query for credentials. Decrypted credential provided only if `with_secrets` flag set `true` and is not available for cloud-only credentials.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "mabl API",
    "description": "APIs for interacting with mabl services",
    "version": "0.563.3-2026-10-09.1791576280-jbaldassari-1791576682-SNAPSHOT"
  },
  "servers": [
    {
      "url": "https://api.mabl.com/"
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      },
      "bearerAuth": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "CredentialsWithResourceGroupsQueryResult": {
        "type": "object",
        "properties": {
          "cursor": {
            "type": "string",
            "description": "Cursor used for pagination",
            "readOnly": true
          },
          "credentials": {
            "type": "array",
            "description": "All credentials that matched the query",
            "readOnly": true,
            "items": {
              "$ref": "#/components/schemas/Credentials"
            }
          }
        }
      },
      "ErrorResponseGeneric": {
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32",
            "minimum": 100,
            "maximum": 599
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Tag": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "description": "tag name",
            "type": "string"
          }
        }
      },
      "Credentials": {
        "type": "object",
        "properties": {
          "created_time": {
            "type": "integer",
            "format": "int64",
            "description": "Time credentials were created"
          },
          "cloud_only": {
            "type": "boolean",
            "description": "True if the credentials secrets are only accessible to cloud runs. Cannot be changed from true to false."
          },
          "totp_pins": {
            "type": "array",
            "description": "TOTP pins computed for time range (only for MFA type credentials, upon request by authorized caller)",
            "items": {
              "$ref": "#/components/schemas/ComputedTotpPin"
            }
          },
          "description": {
            "type": "string",
            "description": "Description"
          },
          "type": {
            "type": "string",
            "description": "Type of credentials",
            "enum": [
              "basic",
              "basic_with_totp"
            ]
          },
          "tags": {
            "type": "array",
            "description": "Free text tags",
            "items": {
              "$ref": "#/components/schemas/Tag"
            }
          },
          "last_updated_time": {
            "type": "integer",
            "format": "int64",
            "description": "Time credentials entity was last updated"
          },
          "organization_id": {
            "type": "string",
            "description": "Organization ID"
          },
          "name": {
            "type": "string",
            "description": "Display name"
          },
          "last_updated_by_id": {
            "type": "string",
            "description": "User ID who last updated these credentials"
          },
          "id": {
            "type": "string",
            "description": "ID of credentials"
          },
          "created_by_id": {
            "type": "string",
            "description": "User ID who created these credentials"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Properties that are specific to the given credentials type."
          }
        }
      },
      "ComputedTotpPin": {
        "type": "object",
        "properties": {
          "start_time": {
            "type": "integer",
            "format": "int64",
            "description": "Starting Unix epoch millisecond key of validity window - lasts 60s"
          },
          "pin": {
            "type": "string",
            "description": "Computed pin for time frame"
          }
        }
      }
    },
    "responses": {
      "ErrorResponse": {
        "description": "Unknown error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      },
      "ErrorResponse401": {
        "description": "User not authenticated",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      },
      "ErrorResponse403": {
        "description": "User not authorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      },
      "ErrorResponse400": {
        "description": "Invalid or missing parameter",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponseGeneric"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    },
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/credentials": {
      "get": {
        "summary": "Query Credentials",
        "operationId": "queryCredentials",
        "description": "Query for credentials. Decrypted credential provided only if `with_secrets` flag set `true` and is not available for cloud-only credentials.",
        "responses": {
          "200": {
            "description": "Results of the query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsWithResourceGroupsQueryResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse400"
          },
          "401": {
            "$ref": "#/components/responses/ErrorResponse401"
          },
          "403": {
            "$ref": "#/components/responses/ErrorResponse403"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "organization_id",
            "description": "Organization ID to filter on",
            "required": true
          },
          {
            "schema": {
              "format": "int32",
              "type": "integer",
              "minimum": 1
            },
            "in": "query",
            "name": "limit",
            "description": "Limit to use for pagination",
            "required": false
          },
          {
            "schema": {
              "type": "string"
            },
            "in": "query",
            "name": "cursor",
            "description": "Cursor to use for pagination",
            "required": false
          }
        ],
        "tags": [
          "Credentials"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "Credentials"
    }
  ]
}
```