---
title: "Create code fix requests"
method: POST
path: "/v1/code-fix-requests"
tags: ["Code Fixing"]
---

# Create code fix requests

`POST /v1/code-fix-requests`

Create code fix requests for multiple secret incidents with their locations.
This will generate pull requests to automatically remediate the detected secrets.

Each request must include:
- One or more issues (by issue_id)
- One or more location IDs for each issue

The system will group locations by source repository and create one pull request per source.

## Request body

- object
  - `locations` object[], required — List of issues with their location IDs to fix
    - `issue_id` integer, required — The ID of the secret incident
    - `location_ids` integer[], required — List of location IDs to fix for this issue

## Response `201`

Code fix request(s) created successfully

- object
  - `message` string — Success message with count of created requests and locations

## Other responses

- `400` — Bad Request - Invalid input or business rule violation
- `401` — Invalid API key
- `403` — Forbidden - Insufficient permissions
- `404` — Not Found - API key not configured (on-prem only)
- `503` — API under maintenance

---

[API](https://skmtc.net/gitguardian/apis/gitguardian-api.md) · [All operations](https://skmtc.net/gitguardian/apis/gitguardian-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitguardian/gitguardian-api/revisions/511b067cdcb1/schema)
