# Run a check now

- **OpenAPI Version:** `3.2.0`
- **API Version:** `3.1.0`
- **Contact:** Syndai <https://syndai.ai>

## Contents

**Operations**

- [POST /api/v1/external/coding/repositories/{repository\_id}/scans/{kind}/run](#scalar-operation-post-apiv1externalcodingrepositoriesrepository-idscanskindrun)

**Schemas**

- [ScanRunRequest](#scalar-schema-scanrunrequest)
- [ScanRunResponse](#scalar-schema-scanrunresponse)
- [ScanQueuedResponse](#scalar-schema-scanqueuedresponse)
- [ProblemDetail](#scalar-schema-problemdetail)
- [ExternalErrorCode](#scalar-schema-externalerrorcode)

<a id="scalar-context-global-servers"></a>

## Servers

- **URL:** `https://api.syndai.ai`

<a id="scalar-context-global-authentication"></a>

## Authentication

- **CustomerApiKey**: HTTP bearer (`API Key`)

  Customer API key sent as a bearer token

## Tags

### Findings

Bugs Syndai's scanner found in your repositories. List findings, read or change a repository's weekly scan setting, or start a scan now; each scan is capped by the per-scan limit. List the Sentry projects bound to your repositories.

## Operations

<a id="scalar-operation-post-apiv1externalcodingrepositoriesrepository-idscanskindrun"></a>

### Run a check now

- **Method:** `POST`
- **Path:** `/api/v1/external/coding/repositories/{repository_id}/scans/{kind}/run`
- **Operation ID:** `runScanNow`
- **Tags:** Findings

Scan now for a paid check (`code`, `app`), even when nothing changed and with its routine off: `limit_usd` (5 to 300, default 25) is the most this scan spends from credits (send the limit you showed); returns the new scan's `run_id` (201), and 409 CONFLICT while a scan of that kind is queued or running. Check now for a free check (`dependencies`, `deploy`, `secrets`): queued on Syndai's servers at no cost, answered 202 `{queued: true}`; its findings appear on the Findings page. Owners and admins only for a free check (403 otherwise). 400 for an unknown kind.

**Servers:** [Inherited servers](#scalar-context-global-servers)

**Authentication:** [Global authentication](#scalar-context-global-authentication)

#### Path parameters

- **`repository_id` (required)**: `string`, format: `uuid`
- **`kind` (required)**: `string`

#### Query parameters

- **`customer_id`**: `string | null`, format: `uuid`

#### Request body

**Required:** `false`

**Content type:** `application/json`

[ScanRunRequest](#scalar-schema-scanrunrequest) | `null`

<a id="scalar-example-1"></a>

**Generated example:**

```json
{
  "limit_usd": 25
}
```

#### Responses

##### 201 Document created, URL follows

**Content type:** `application/json`

[ScanRunResponse](#scalar-schema-scanrunresponse) | [ScanQueuedResponse](#scalar-schema-scanqueuedresponse)

<a id="scalar-example-2"></a>

**Generated example:**

```json
{
  "run_id": ""
}
```

##### 202 A free check was queued

**Content type:** `application/json`

[ScanQueuedResponse](#scalar-schema-scanqueuedresponse)

<a id="scalar-example-3"></a>

**Generated example:**

```json
{
  "queued": true
}
```

##### 400, 401, 402, 403, 404, 409

- `400` Bad request syntax or unsupported method; or Not a paid scan kind
- `401` Invalid or missing customer API key
- `402` Budget exhausted
- `403` Insufficient scope or forbidden customer access
- `404` Resource not found
- `409` A scan of this kind is already queued or running

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

RFC 7807 problem detail returned for public CaaS errors.

<a id="scalar-example-4"></a>

**Generated example:**

```json
{
  "code": "BUDGET_EXHAUSTED",
  "detail": null,
  "existing_run_id": null,
  "instance": null,
  "status": 1,
  "title": "",
  "type": "about:blank",
  "additionalProperty": "anything"
}
```

##### 429 Rate limit exceeded

**Headers:**

- **`Retry-After`**

  Seconds to wait before retrying the request

  `integer`

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

RFC 7807 problem detail returned for public CaaS errors.

[Generated example](#scalar-example-4)

##### default Unexpected error

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

<a id="scalar-example-5"></a>

**Generated example:**

```json
null
```

## Schemas

<a id="scalar-schema-scanrunrequest"></a>

### ScanRunRequest

**Type:** `object`

- **`limit_usd`**: `number`, default: `25`, minimum: `5`, maximum: `300`

<a id="scalar-example-6"></a>

**Generated example:**

```json
{
  "limit_usd": 25
}
```

<a id="scalar-schema-scanrunresponse"></a>

### ScanRunResponse

**Type:** `object`

- **`run_id` (required)**: `string`, format: `uuid`

<a id="scalar-example-7"></a>

**Generated example:**

```json
{
  "run_id": ""
}
```

<a id="scalar-schema-scanqueuedresponse"></a>

### ScanQueuedResponse

**Type:** `object`

- **`queued`**: `boolean`, default: `true`

<a id="scalar-example-8"></a>

**Generated example:**

```json
{
  "queued": true
}
```

<a id="scalar-schema-problemdetail"></a>

### ProblemDetail

**Type:** `object`

RFC 7807 problem detail returned for public CaaS errors.

- **`code` (required)**: `string`, possible values: `"BUDGET_EXHAUSTED", "QUOTA_EXCEEDED", "INSUFFICIENT_CREDITS", "RUN_CONCURRENCY_LIMIT", "CUSTOMER_DISABLED", "REPO_NOT_BOUND", "REPO_ARCHIVED", "IDEMPOTENCY_REPLAY", "CONFLICT", "MISSION_BUSY_RETRY", "HITL_REQUEST_CONFLICT", "HITL_REQUEST_SETTLED", "RUN_TERMINATED_BEFORE_RESPONSE", "INVALID_POLICY", "INVALID_SCOPE", "RATE_LIMITED", "INSTALLATION_INCOMPLETE", "SUBSCRIPTION_USAGE_UNAVAILABLE", "INVALID_TOKEN", "ROLE_REQUIRED", "PLAN_UPGRADE_REQUIRED", "EMAIL_MISMATCH", "EXPIRED_TOKEN", "NOT_FOUND", "OVERSCOPE_ACK_REQUIRED", "VERIFY_FAILED", "PUBLISH_IN_FLIGHT", "PUBLISH_UNSUPPORTED_REPO", "PUBLICATION_NOT_LIVE", "NO_APP_DATA", "FEATURE_REQUESTS_NEEDS_MEMBERS", "EMPTY_UPDATE", "BAD_CURSOR", "HUMAN_APPROVAL_REQUIRED", "PROTECTED_PATHS_MANAGED_ONLY", "RUN_IN_FLIGHT", "TEXT_EDIT_REFUSED", "CLI_UPGRADE_REQUIRED", "PRODUCTION_STEP_UP_REQUIRED", "PRICES_UPDATING", "GITHUB_UNAVAILABLE", "PUBLISH_NOT_SET_UP", "PUBLISH_TAG_EXISTS", "PUBLISH_VERSION_EXISTS", "VERSION_NOT_DEPLOYED", "DATA_REFUSED", "HARNESS_MODEL_UNSUPPORTED", "ECONOMY_CONFLICTS_WITH_MODEL", "HARNESS_UNKNOWN", "INTERNAL_ERROR"`

  Stable error codes surfaced to public CaaS clients.
- **`status` (required)**: `integer`
- **`title` (required)**: `string`
- **`detail`**: `string | null`, default: `null`
- **`existing_run_id`**: `string | null`, default: `null`
- **`instance`**: `string | null`, default: `null`
- **`type`**: `string`, default: `"about:blank"`

<a id="scalar-example-9"></a>

**Generated example:**

```json
{
  "code": "BUDGET_EXHAUSTED",
  "detail": null,
  "existing_run_id": null,
  "instance": null,
  "status": 1,
  "title": "",
  "type": "about:blank",
  "additionalProperty": "anything"
}
```

<a id="scalar-schema-externalerrorcode"></a>

### ExternalErrorCode

**Type:** `string`, possible values: `"BUDGET_EXHAUSTED", "QUOTA_EXCEEDED", "INSUFFICIENT_CREDITS", "RUN_CONCURRENCY_LIMIT", "CUSTOMER_DISABLED", "REPO_NOT_BOUND", "REPO_ARCHIVED", "IDEMPOTENCY_REPLAY", "CONFLICT", "MISSION_BUSY_RETRY", "HITL_REQUEST_CONFLICT", "HITL_REQUEST_SETTLED", "RUN_TERMINATED_BEFORE_RESPONSE", "INVALID_POLICY", "INVALID_SCOPE", "RATE_LIMITED", "INSTALLATION_INCOMPLETE", "SUBSCRIPTION_USAGE_UNAVAILABLE", "INVALID_TOKEN", "ROLE_REQUIRED", "PLAN_UPGRADE_REQUIRED", "EMAIL_MISMATCH", "EXPIRED_TOKEN", "NOT_FOUND", "OVERSCOPE_ACK_REQUIRED", "VERIFY_FAILED", "PUBLISH_IN_FLIGHT", "PUBLISH_UNSUPPORTED_REPO", "PUBLICATION_NOT_LIVE", "NO_APP_DATA", "FEATURE_REQUESTS_NEEDS_MEMBERS", "EMPTY_UPDATE", "BAD_CURSOR", "HUMAN_APPROVAL_REQUIRED", "PROTECTED_PATHS_MANAGED_ONLY", "RUN_IN_FLIGHT", "TEXT_EDIT_REFUSED", "CLI_UPGRADE_REQUIRED", "PRODUCTION_STEP_UP_REQUIRED", "PRICES_UPDATING", "GITHUB_UNAVAILABLE", "PUBLISH_NOT_SET_UP", "PUBLISH_TAG_EXISTS", "PUBLISH_VERSION_EXISTS", "VERSION_NOT_DEPLOYED", "DATA_REFUSED", "HARNESS_MODEL_UNSUPPORTED", "ECONOMY_CONFLICTS_WITH_MODEL", "HARNESS_UNKNOWN", "INTERNAL_ERROR"`

Stable error codes surfaced to public CaaS clients.
