---
title: "Create Fix Job"
method: POST
path: "/api/agent/deployments/{deploymentId}/issues/{issueId}/fix_jobs"
tags: ["AiFixJobsService"]
---

# Create Fix Job

`POST /api/agent/deployments/{deploymentId}/issues/{issueId}/fix_jobs`

This feature is currently in Public Beta.

Create an automated SAST fix job for the given issue. This triggers an AI-powered workflow that analyzes the vulnerability, generates a fix, and opens a pull request in the repository.

## Path parameters

- `deploymentId` integer, required — The unique numerical identifier of the deployment. Can be found via the [Deployments Service](#tag/DeploymentsService) or in your Settings in the web UI.
- `issueId` integer, required — The unique numerical identifier of the issue to generate a fix for.

## Request body

- ProtosAiV1CreateFixJobRequest — Request message for creating a fix job

## Response `200`

OK

- ProtosAiV1CreateFixJobResponse — Response message for creating a fix job
  - `errors` ProtosAiV1FixJobError[] — A list of errors that occurred during fix job creation. Empty when the job was created successfully.
    - `errorType` 'FIX_JOB_ERROR_TYPE_NO_WRITE_ACCESS' | 'FIX_JOB_ERROR_TYPE_INVALID_REPOSITORY' | 'FIX_JOB_ERROR_TYPE_SCM_CONFIG_NOT_FOUND' | 'FIX_JOB_ERROR_TYPE_CREDITS_EXHAUSTED' | 'FIX_JOB_ERROR_TYPE_SCM_TOKEN_FAILED' | 'FIX_JOB_ERROR_TYPE_CODE_ACCESS_NOT_GRANTED', enum — The type of error that occurred during fix job creation. | value | description | |-------|---------------| | FIX_JOB_ERROR_TYPE_NO_WRITE_ACCESS | The Semgrep GitHub App does not have write access to the repository. | | FIX_JOB_ERROR_TYPE_INVALID_REPOSITORY | The repository associated with the issue is invalid or not found. | | FIX_JOB_ERROR_TYPE_SCM_CONFIG_NOT_FOUND | No source code management configuration was found for the repository. | | FIX_JOB_ERROR_TYPE_CREDITS_EXHAUSTED | The organization has exhausted its AI credits. | | FIX_JOB_ERROR_TYPE_SCM_TOKEN_FAILED | Failed to obtain an SCM access token for the repository. | | FIX_JOB_ERROR_TYPE_CODE_ACCESS_NOT_GRANTED | Code access has not been granted for the repository. |
    - `message` string — A human-readable description of the error.
    - `githubAppInfo` ProtosAiV1GitHubAppInfo — GitHub app information for linking to configuration
      - `appId` integer — The numeric identifier of the GitHub App.
      - `appName` string — The display name of the GitHub App.
      - `installationTarget` string — The GitHub organization or user where the app is installed.
      - `configUrl` string — A direct link to the GitHub App configuration page for adjusting permissions.
  - `success` boolean — Indicates whether the fix job was created successfully.

---

[API](https://skmtc.net/semgrep/apis/semgrep-web-app.md) · [All operations](https://skmtc.net/semgrep/apis/semgrep-web-app/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/semgrep/semgrep-web-app/versions/6483eeecd582/schema)
