Docs
Sign in
Code Audit

Get scan request

Last updated September 8, 2026

get/v1/code-audit/scan-requests/{preparationId}

Authentication

  • bearerAuth
  • bearerAuth: http / bearer — Use an Inth API key or OAuth access token in the Authorization header. Every operation needs a capability. An OAuth access token carries the capabilities it was granted as scopes; an organization API key carries a fixed set (`organizations.read`, `projects.read`, `projects.write`, `api-keys.read`, `inbox.read`, `billing.read`). A credential without the capability an operation needs is answered with `403 INSUFFICIENT_SCOPE`. `GET /v1/me` reports the capabilities of the calling credential. OAuth scopes: - `organizations.read`: List the organizations you belong to. - `organizations.write`: Create organizations you will own. - `projects.read`: Read projects and their consent configuration. - `projects.write`: Create, update, and delete projects and their consent configuration. - `members.read`: Read member names, email addresses, profile images, roles, and pending invitation email addresses. - `members.write`: Invite members, change member roles, remove members, and cancel invitations. - `api-keys.read`: List organization API keys. - `api-keys.write`: Create, roll, and delete organization API keys. - `code-audit.read`: Read Code Audit scans, their findings, and connected repositories. - `code-audit.write`: Start Code Audit scans and unlock their reports. - `inbox.read`: Read Inbox findings. - `inbox.write`: Change the status of Inbox findings and open GitHub issues for them. - `billing.read`: Read the plan and credit balance of an organization.

Request

Path Parameters

NameTypeRequiredDescription
preparationIdstringRequiredScan request ID from the start response.

Query Parameters

NameTypeRequiredDescription
repositoryIdstringRequiredRepository the scan was requested for.

Responses

200

The scan request state.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
dataobject | object | objectRequired
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "data": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "status",
            "scan"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "started"
            },
            "scan": {
              "type": "object",
              "required": [
                "id",
                "organizationId",
                "repositoryId",
                "repositoryName",
                "branch",
                "headCommitSha",
                "pullRequestNumber",
                "scope",
                "trigger",
                "status",
                "access",
                "unlockCredits",
                "findingCount",
                "issueCount",
                "progress",
                "createdAt",
                "startedAt",
                "completedAt"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "organizationId": {
                  "type": "string"
                },
                "repositoryId": {
                  "type": "string"
                },
                "repositoryName": {
                  "type": "string"
                },
                "branch": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "headCommitSha": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pullRequestNumber": {
                  "oneOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "scope": {
                  "type": "string",
                  "description": "What was scanned: repository, pull_request, and so on."
                },
                "trigger": {
                  "type": "string",
                  "description": "What started the scan: manual, pull_request, scheduled."
                },
                "status": {
                  "type": "string"
                },
                "access": {
                  "type": "string",
                  "enum": [
                    "full",
                    "free-preview",
                    "locked"
                  ],
                  "description": "Whether every finding is readable. A free preview shows a subset until unlocked."
                },
                "unlockCredits": {
                  "oneOf": [
                    {
                      "type": "integer",
                      "description": "Credits needed to unlock a free preview."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "findingCount": {
                  "oneOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "issueCount": {
                  "oneOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "progress": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "stage",
                        "stageStatus",
                        "completedStages",
                        "totalStages"
                      ],
                      "properties": {
                        "stage": {
                          "type": "string"
                        },
                        "stageStatus": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "completedStages": {
                          "oneOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "totalStages": {
                          "oneOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "startedAt": {
                  "oneOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "completedAt": {
                  "oneOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        },
        {
          "type": "object",
          "required": [
            "status",
            "preparationId",
            "repositoryId"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "starting"
            },
            "preparationId": {
              "type": "string"
            },
            "repositoryId": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "status",
            "message"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "failed"
            },
            "message": {
              "type": "string"
            }
          }
        }
      ]
    }
  }
}

400

The request payload or parameters are invalid.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSUFFICIENT_SCOPE" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "INSUFFICIENT_CREDITS" | "SCAN_IN_PROGRESS" | "UNLOCK_REQUIRED" | "REPOSITORY_NOT_LINKED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSUFFICIENT_SCOPE",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "INSUFFICIENT_CREDITS",
            "SCAN_IN_PROGRESS",
            "UNLOCK_REQUIRED",
            "REPOSITORY_NOT_LINKED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

401

Authentication is missing, invalid, or expired.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSUFFICIENT_SCOPE" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "INSUFFICIENT_CREDITS" | "SCAN_IN_PROGRESS" | "UNLOCK_REQUIRED" | "REPOSITORY_NOT_LINKED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSUFFICIENT_SCOPE",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "INSUFFICIENT_CREDITS",
            "SCAN_IN_PROGRESS",
            "UNLOCK_REQUIRED",
            "REPOSITORY_NOT_LINKED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

403

The credential is valid but may not perform the operation. `INSUFFICIENT_SCOPE`: the credential was never granted the capability the operation needs. `details.requiredScope` names it, and the `WWW-Authenticate` header carries `Bearer error="insufficient_scope"`. An OAuth client fixes this by requesting the scope; an organization API key cannot gain it. `FORBIDDEN`: the capability is present but the membership behind the credential lacks the role, or the resource belongs to another organization.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSUFFICIENT_SCOPE" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "INSUFFICIENT_CREDITS" | "SCAN_IN_PROGRESS" | "UNLOCK_REQUIRED" | "REPOSITORY_NOT_LINKED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSUFFICIENT_SCOPE",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "INSUFFICIENT_CREDITS",
            "SCAN_IN_PROGRESS",
            "UNLOCK_REQUIRED",
            "REPOSITORY_NOT_LINKED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

Headers

NameTypeDescription
WWW-AuthenticatestringPresent on `INSUFFICIENT_SCOPE`: `Bearer error="insufficient_scope", scope="<required scope>"`.

404

The requested resource was not found.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSUFFICIENT_SCOPE" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "INSUFFICIENT_CREDITS" | "SCAN_IN_PROGRESS" | "UNLOCK_REQUIRED" | "REPOSITORY_NOT_LINKED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSUFFICIENT_SCOPE",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "INSUFFICIENT_CREDITS",
            "SCAN_IN_PROGRESS",
            "UNLOCK_REQUIRED",
            "REPOSITORY_NOT_LINKED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

429

The rate limit was exceeded. API key limits are set by plan tier (Starter 600/min, Pro 1500/min, Enterprise 3000/min). Check the Retry-After header before retrying.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSUFFICIENT_SCOPE" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "INSUFFICIENT_CREDITS" | "SCAN_IN_PROGRESS" | "UNLOCK_REQUIRED" | "REPOSITORY_NOT_LINKED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSUFFICIENT_SCOPE",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "INSUFFICIENT_CREDITS",
            "SCAN_IN_PROGRESS",
            "UNLOCK_REQUIRED",
            "REPOSITORY_NOT_LINKED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}

500

An unexpected internal error occurred.

Content type application/json

PropertyTypeRequiredDescription
successbooleanRequired
errorobjectRequired
error.code"UNAUTHORIZED" | "FORBIDDEN" | "INSUFFICIENT_SCOPE" | "PLAN_LIMIT_REACHED" | "PLAN_REQUIRED" | "INVALID_ORIGIN" | "INVALID_REGION" | "INVALID_PAYLOAD" | "NOT_FOUND" | "CONFLICT" | "KEY_LIMIT_REACHED" | "INSUFFICIENT_CREDITS" | "SCAN_IN_PROGRESS" | "UNLOCK_REQUIRED" | "REPOSITORY_NOT_LINKED" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"Required
error.messagestringRequired
error.detailsunknownOptionalOptional structured error details.
View JSON schema
{
  "type": "object",
  "required": [
    "success",
    "error"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": false
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "UNAUTHORIZED",
            "FORBIDDEN",
            "INSUFFICIENT_SCOPE",
            "PLAN_LIMIT_REACHED",
            "PLAN_REQUIRED",
            "INVALID_ORIGIN",
            "INVALID_REGION",
            "INVALID_PAYLOAD",
            "NOT_FOUND",
            "CONFLICT",
            "KEY_LIMIT_REACHED",
            "INSUFFICIENT_CREDITS",
            "SCAN_IN_PROGRESS",
            "UNLOCK_REQUIRED",
            "REPOSITORY_NOT_LINKED",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "SERVICE_UNAVAILABLE",
            "INTERNAL_ERROR"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "description": "Optional structured error details."
        }
      }
    }
  }
}