Skip to content
Start here

Get repository

client.managedDefense.vulnerabilityDiscovery.repositories.get(stringrepoID, RepositoryGetParams { account_id, scan_cursor, scan_limit } params, RequestOptionsoptions?): RepositoryGetResponse { repository, scans }
GET/accounts/{account_id}/managed-defense/vulnerability-discovery/repos/{repo_id}

Gets repository metadata, source readiness, and customer scan history.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
repoID: string
formatuuid
params: RepositoryGetParams { account_id, scan_cursor, scan_limit }
account_id: string

Path param

scan_cursor?: string

Query param

maxLength1024
minLength1
scan_limit?: number

Query param

maximum100
minimum1
ReturnsExpand Collapse
RepositoryGetResponse { repository, scans }
repository: Repository { id, created_at, name, 3 more }
id: string
formatuuid
created_at: string
formatdate-time
name: string
maxLength255
minLength1
readiness: "awaiting_source" | "processing" | "ready" | "failed"

Source state. awaiting_source: the upload repository’s default branch has no commits yet. processing: an import is in progress. ready: source is available. failed: the Worker import failed or could not be verified.

One of the following:
"awaiting_source"
"processing"
"ready"
"failed"
source: "upload" | "worker"
One of the following:
"upload"
"worker"
import_error?: ImportError { code, message }
code: "worker_import_failed"
message: "Worker import failed."
scans: Array<Scan>
id: string
formatuuid
completed_at: string | null
formatdate-time
message: string | null
maxLength1024
phase: "provisioning" | "indexing" | "analyzing" | 2 more | null
One of the following:
"provisioning"
"indexing"
"analyzing"
"reporting"
"finalizing"
repositories: Array<Repository>
id: string
formatuuid
name: string
phase: "provisioning" | "indexing" | "analyzing" | 2 more | null
One of the following:
"provisioning"
"indexing"
"analyzing"
"reporting"
"finalizing"
report_status: "not_ready" | "pending_review" | "published" | "withdrawn"
One of the following:
"not_ready"
"pending_review"
"published"
"withdrawn"
status: "requested" | "accepted" | "running" | 4 more
One of the following:
"requested"
"accepted"
"running"
"completed"
"failed"
"rejected"
"cancelled"
started_at: string | null
formatdate-time
status: "requested" | "accepted" | "running" | 4 more
One of the following:
"requested"
"accepted"
"running"
"completed"
"failed"
"rejected"
"cancelled"
submitted_at: string
formatdate-time
telemetry_window?: TelemetryWindow { end, start }

UTC ISO-8601 interval. Start is inclusive, end is exclusive, and the interval must be positive and at most seven days.

end: string
formatdate-time
start: string
formatdate-time

Get repository

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const repository = await client.managedDefense.vulnerabilityDiscovery.repositories.get(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
);

console.log(repository.repository);
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "repository": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "name": "x",
      "readiness": "awaiting_source",
      "source": "upload",
      "import_error": {
        "code": "worker_import_failed",
        "message": "Worker import failed."
      }
    },
    "scans": [
      {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "completed_at": "2019-12-27T18:11:19.117Z",
        "message": "message",
        "phase": "provisioning",
        "repositories": [
          {
            "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            "name": "name",
            "phase": "provisioning",
            "report_status": "not_ready",
            "status": "requested"
          }
        ],
        "started_at": "2019-12-27T18:11:19.117Z",
        "status": "requested",
        "submitted_at": "2019-12-27T18:11:19.117Z",
        "telemetry_window": {
          "end": "2019-12-27T18:11:19.117Z",
          "start": "2019-12-27T18:11:19.117Z"
        }
      }
    ]
  },
  "result_info": {
    "count": 0,
    "cursor": "cursor",
    "per_page": 1
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "repository": {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "name": "x",
      "readiness": "awaiting_source",
      "source": "upload",
      "import_error": {
        "code": "worker_import_failed",
        "message": "Worker import failed."
      }
    },
    "scans": [
      {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "completed_at": "2019-12-27T18:11:19.117Z",
        "message": "message",
        "phase": "provisioning",
        "repositories": [
          {
            "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            "name": "name",
            "phase": "provisioning",
            "report_status": "not_ready",
            "status": "requested"
          }
        ],
        "started_at": "2019-12-27T18:11:19.117Z",
        "status": "requested",
        "submitted_at": "2019-12-27T18:11:19.117Z",
        "telemetry_window": {
          "end": "2019-12-27T18:11:19.117Z",
          "start": "2019-12-27T18:11:19.117Z"
        }
      }
    ]
  },
  "result_info": {
    "count": 0,
    "cursor": "cursor",
    "per_page": 1
  },
  "success": true
}