API

ProjectCodeMap

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{organization_id}/verify/projects/{project_id}/code_maps create Existing or newly started scan
POST /api/v1/organizations/{organization_id}/verify/projects/{project_id}/code_maps/session create Signed URL scoped to the authorized project repository and browser origin
GET /api/v1/organizations/{organization_id}/verify/projects/{project_id}/code_maps list Project-linked repository choices and selected commit map

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

project_code_maps, err := client.ProjectCodeMap(nil).List(map[string]any{"organization_id": "example", "project_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(project_code_maps)
created, err := client.ProjectCodeMap(nil).Create(map[string]any{"organization_id": "example", "project_id": "example", "repository_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local project_code_maps, err = client:ProjectCodeMap():list({ organization_id = "example", project_id = "example" })
local created, err = client:ProjectCodeMap():create({ organization_id = "example", project_id = "example", repository_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$project_code_maps = $client->ProjectCodeMap()->list(["organization_id" => "example", "project_id" => "example"]);
$created = $client->ProjectCodeMap()->create(["organization_id" => "example", "project_id" => "example", "repository_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

project_code_maps = client.ProjectCodeMap().list({"organization_id": "example", "project_id": "example"})
created = client.ProjectCodeMap().create({ "organization_id": "example", "project_id": "example", "repository_id": "example" })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

project_code_maps = client.ProjectCodeMap.list({ "organization_id" => "example", "project_id" => "example" })
created = client.ProjectCodeMap.create({ "organization_id" => "example", "project_id" => "example", "repository_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const project_code_maps = await client.ProjectCodeMap().list({ organization_id: "example", project_id: "example" })
const created = await client.ProjectCodeMap().create({ organization_id: "example", project_id: "example", repository_id: "example" })

Fields

Field Type Required Description
can_scan boolean Yes Can Scan
commit_sha string Yes Commit Sha
configured boolean Yes Configured
error_code one,string,null Yes Error Code
id string Yes Id
name string Yes Name
ref string No Ref
repository_id string Yes Repository Id
revision object No Revision
slug string Yes Slug
status string Yes Status

create

POST /api/v1/organizations/{organization_id}/verify/projects/{project_id}/code_maps

Operation ID: post_api_v1_organizations_organization_id_verify_projects_project_id_code_maps.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
project_id path string Yes

Request body

application/json

Property Type Required Description
ref string No
repository_id string Yes

Responses

200: Existing or newly started scan

application/json

Property Type Required Description
can_scan boolean Yes
commit_sha string Yes
configured boolean Yes
error_code string Yes
revision object No
revision.at_branch_head boolean Yes
revision.author_name string Yes
revision.authored_at string Yes
revision.branch_name string Yes
revision.commit_url string Yes
revision.comparison object No
revision.comparison.ahead integer Yes
revision.comparison.behind integer Yes
revision.comparison.status enum: current, behind, ahead, diverged, unrelated, unavailable Yes
revision.summary string Yes
status enum: not_scanned, queued, cloning, parsing, drawing, done, ... Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

POST /api/v1/organizations/{organization_id}/verify/projects/{project_id}/code_maps/session

Operation ID: post_api_v1_organizations_organization_id_verify_projects_project_id_code_maps_session.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
project_id path string Yes

Request body

application/json

Property Type Required Description
ref string No
repository_id string Yes

Responses

200: Signed URL scoped to the authorized project repository and browser origin

application/json

Property Type Required Description
expires_at string Yes
url string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

list

GET /api/v1/organizations/{organization_id}/verify/projects/{project_id}/code_maps

Operation ID: get_api_v1_organizations_organization_id_verify_projects_project_id_code_maps.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
project_id path string Yes
repository_id query string No
ref query string No

Responses

200: Project-linked repository choices and selected commit map

application/json

Property Type Required Description
map object Yes
organization object Yes
organization.name string Yes
organization.slug string Yes
project object Yes
project.id string Yes
project.name string Yes
project.slug string Yes
repositories array of object Yes
repositories[].id string Yes
repositories[].name string Yes
repositories[].slug string Yes
selected_repository_id string Yes
source object Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway