v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
Security Monitoring

Analyze code

Run static analysis rules against a source code file and return violations found.

post/api/v2/static-analysis/static-analysis-server/analyze

Request body

Example request

{
  "data": {
    "attributes": {
      "code": "aW1wb3J0IHN5cw==",
      "file_encoding": "utf-8",
      "filename": "test.py",
      "language": "python",
      "rules": [
        {
          "category": "BEST_PRACTICES",
          "checksum": "abc123def456",
          "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=",
          "id": "python-best-practices/no-exit",
          "language": "python",
          "severity": "WARNING",
          "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==",
          "type": "TREE_SITTER_QUERY"
        }
      ]
    },
    "type": "analysis_request"
  }
}

Response

OK