Fix Pull Requests

This document uses the REST API. For more details, see the Authentication for API page.

Creates a Snyk Fix PR. This feature is currently in experimental phase and access is restricted behind the "apiFixPrCreation" feature flag. (Early Access)

post

Creates a Snyk Fix pull-request asynchronously and responds with a remediation job ID that can be used to check the status and result.

Required permissions

  • org.org.project.pr.create
Authorizations
AuthorizationstringRequired

API key value must be prefixed with "Token ".

Path parameters
org_idstring · uuidRequired

Org ID

Example: 7626925e-4b0f-11ee-be56-0242ac120002
project_idstring · uuidRequired

Project ID

Example: 7626925e-4b0f-11ee-be56-0242ac120002
Query parameters
versionstringRequired

Requested API version

Example: 2021-06-04Pattern: ^(wip|work-in-progress|experimental|beta|((([0-9]{4})-([0-1][0-9]))-((3[01])|(0[1-9])|([12][0-9]))(~(wip|work-in-progress|experimental|beta))?))$
Body
Responses
202

Fix pull request job accepted for processing

application/vnd.api+json
post
/orgs/{org_id}/projects/{project_id}/fix_pull_requests
POST /rest/orgs/{org_id}/projects/{project_id}/fix_pull_requests?version=text HTTP/1.1
Host: api.snyk.io
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 71

{
  "data": {
    "issue_ids": [
      "SNYK-JS-YARGSPARSER-560381"
    ],
    "type": "resource"
  }
}
{
  "data": {
    "attributes": {
      "created_at": "2024-10-29T12:00:00Z",
      "status": "STARTED"
    },
    "id": "7626925e-4b0f-11ee-be56-0242ac120002",
    "type": "resource"
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "first": "https://example.com/api/resource?ending_before=v1.eyJpZCI6IjExIn0K",
    "last": "https://example.com/api/resource?starting_after=v1.eyJpZCI6IjMwIn0K",
    "next": "https://example.com/api/resource?starting_after=v1.eyJpZCI6IjEwIn0K"
  }
}

Last updated

Was this helpful?