Working with the SourceCraft REST API
To set up SourceCraft automation and integration into your projects, use its public REST API.
The SourceCraft REST API offers the following features:
|
Service |
Resources |
Endpoint |
Guides |
|
Platform |
Organizations, repositories, projects, |
|
|
|
Scans, vulnerabilities, findings, |
|
For API authentication, use your personal access token (PAT), e.g., to get a list of user issues:
export PAT=<personal_access_token>
curl \
--request GET \
--header "Authorization: Bearer $PAT" \
--url "https://api.sourcecraft.tech/me/issues" | jq
Tip
For authenticating with the SourceCraft API from within the CI/CD workflow, use the SOURCECRAFT_TOKEN predefined variable.
Example of .sourcecraft/ci.yaml
on:
push: test-workflow
workflows:
test-workflow:
tasks:
- name: issues-task
cubes:
- name: i-have-got-issues
script:
- |
curl \
--header "Authorization: Bearer $SOURCECRAFT_TOKEN" \
--url "https://api.sourcecraft.tech/me/issues"