Skip to content

Create a job todo

Request

Git provider webhook triggers Scout to create a job todo. Similarly, a lint job started or completed triggers jobs todo. Since Scout is stateless and distributed, this is the API for storing things to do. It's also a way to communicate with Scout by making jobs for it to do too (such as communicating status back to Git). Finally, it can be used to trigger Scout to update again in the case of a GitHub webhook outage.

Security
ApiKey
Path
orgIdstringrequired
Organization ID.
Example:acme-inc
projectIdstringrequired
Project ID.
Example:my-project
Headers
x-redocly-scout-versionstring
Scout version.
Example:1.0.0
Bodyapplication/json
typestringrequired
Type of job.
Enum:"PROCESS_GIT_REPO""UPDATE_STATUS"
providerIdstring

Git provider identifier (appId for GitHub).

providerTypestringrequired
Git provider type.
Enum:"GITHUB_CLOUD""GITHUB_SERVER""GITLAB_CLOUD""GITLAB_SELF_MANAGED""BITBUCKET_CLOUD""BITBUCKET_DATACENTER""AZURE"
namespaceIdstringrequired

Git repo namespace id (organization login for GitHub).

repositoryIdstringrequired
Git repo id.
branchstringrequired
Git branch name.
commitShastringrequired
Git commit SHA.
isMainBranchboolean
True if branch is main.
Default:false
prIdstring
Git pull request ID.
parentJobIdstring, (ulid)
ID of the parent job, if any.
Example:"sjob_01h2t9ksv7vmsvbhh5ty40zctw"
checksArray of objects(GitCommitCheck)
Commit status checks.
metadataobject(JobMetadata)
Additional information about job.
curl -i -X POST \
  https://redocly.com/_mock/docs/realm/scout/api/openapi/orgs/acme-inc/projects/my-project/scout/todos \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'x-redocly-scout-version: 1.0.0' \
  -d '{
    "type": "PROCESS_GIT_REPO",
    "providerId": "string",
    "providerType": "GITHUB_CLOUD",
    "namespaceId": "string",
    "repositoryId": "string",
    "branch": "string",
    "commitSha": "string",
    "isMainBranch": false,
    "prId": "string",
    "parentJobId": "sjob_01h2t9ksv7vmsvbhh5ty40zctw",
    "checks": [
      {
        "name": "Scorecard - Compliance API",
        "status": "IN_PROGRESS",
        "description": "string",
        "targetUrl": "string"
      }
    ],
    "metadata": {
      "errorMessage": "string",
      "errorStack": "string"
    }
  }'

Responses

Created.
Bodyapplication/json
idstring, (ulid)read-onlyrequired
ID of the job.
Example:"sjob_01h2t9ksv7vmsvbhh5ty40zctw"
statusstringread-onlyrequired
Job status.
Enum:"PENDING""PROCESSING""COMPLETED""FAILED"
typestringrequired
Type of job.
Enum:"PROCESS_GIT_REPO""UPDATE_STATUS"
organizationIdstringread-only
Organization ID.
projectIdstringread-only
Project ID.
providerIdstring

Git provider identifier (appId for GitHub).

providerTypestringrequired
Git provider type.
Enum:"GITHUB_CLOUD""GITHUB_SERVER""GITLAB_CLOUD""GITLAB_SELF_MANAGED""BITBUCKET_CLOUD""BITBUCKET_DATACENTER""AZURE"
namespaceIdstringrequired

Git repo namespace id (organization login for GitHub).

repositoryIdstringrequired
Git repo id.
branchstringrequired
Git branch name.
commitShastringrequired
Git commit SHA.
isMainBranchboolean
True if branch is main.
Default:false
prIdstring
Git pull request ID.
attemptsintegerread-onlyrequired
Number of attempts to process the job.
parentJobIdstring, (ulid)
ID of the parent job, if any.
Example:"sjob_01h2t9ksv7vmsvbhh5ty40zctw"
checksArray of objects(GitCommitCheck)
Commit status checks.
metadataobject(JobMetadata)
Additional information about job.
startedAtstring, (date-time)read-only
Job start date.
createdAtstring, (date-time)read-onlyrequired
Job creation date.
updatedAtstring, (date-time)read-onlyrequired
Job last update date.
Response
{ "id": "sjob_01h2t9ksv7vmsvbhh5ty40zctw", "status": "PENDING", "type": "PROCESS_GIT_REPO", "organizationId": "string", "projectId": "string", "providerId": "string", "providerType": "GITHUB_CLOUD", "namespaceId": "string", "repositoryId": "string", "branch": "string", "commitSha": "string", "isMainBranch": false, "prId": "string", "attempts": 0, "parentJobId": "sjob_01h2t9ksv7vmsvbhh5ty40zctw", "checks": [ { … } ], "metadata": { "scoutVersion": "1.0.0", "errorMessage": "string", "errorStack": "string" }, "startedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }