---
title: "Create diff scan from repository HEAD full-scan"
method: POST
path: "/orgs/{org_slug}/diff-scans/from-repo/{repo_slug}"
tags: ["diff-scans"]
---

# Create diff scan from repository HEAD full-scan

`POST /orgs/{org_slug}/diff-scans/from-repo/{repo_slug}`

Create a diff scan between the repository's current HEAD full scan and a new full scan from uploaded manifest files.
Returns metadata about the diff scan. Once the diff scan is created, fetch the diff scan from
the [api_url](/reference/getDiffScanById) URL to get the contents of the diff.

The maximum number of files you can upload at a time is 10000 and each file can be no bigger than 268 MB.

This endpoint consumes 1 unit of your quota.

This endpoint requires the following org token scopes:
      - repo:list
- diff-scans:create
- full-scans:create

## Path parameters

- `org_slug` string, required
- `repo_slug` string, required

## Query parameters

- `description` string
- `external_href` string
- `branch` string
- `commit_message` string
- `commit_hash` string
- `pull_request` integer
- `committers` string
- `integration_type` 'api' | 'github' | 'gitlab' | 'bitbucket' | 'azure' | 'web'
- `integration_org_slug` string
- `merge` boolean
- `workspace` string

## Response `201`

The details of the new full scan and diff scan between the two scans.

- object
  - `diff_scan` object, required
    - `id` string, required — The ID of the diff scan.
    - `organization_id` string, required — The ID of the organization that owns the diff scan.
    - `repository_id` string, required — The ID of the repository the diff scan was run against.
    - `created_at` string, required — ISO 8601 timestamp of when the diff scan was created.
    - `updated_at` string, required — ISO 8601 timestamp of when the diff scan was last updated.
    - `before_full_scan` object, required
      - `id` string, required
      - `created_at` string, required
      - `updated_at` string, required
      - `organization_id` string, required
      - `organization_slug` string, required
      - `repository_id` string, required
      - `repository_slug` string, required
      - `branch` string, nullable, required
      - `commit_message` string, nullable, required
      - `commit_hash` string, nullable, required
      - `pull_request` integer, nullable, required
      - `committers` string[], required
      - `html_url` string, nullable, required
      - `api_url` string, nullable, required
    - `after_full_scan` object, required
      - `id` string, required
      - `created_at` string, required
      - `updated_at` string, required
      - `organization_id` string, required
      - `organization_slug` string, required
      - `repository_id` string, required
      - `repository_slug` string, required
      - `branch` string, nullable, required
      - `commit_message` string, nullable, required
      - `commit_hash` string, nullable, required
      - `pull_request` integer, nullable, required
      - `committers` string[], required
      - `html_url` string, nullable, required
      - `api_url` string, nullable, required
    - `description` string, nullable, required — Human readable description of the diff scan, e.g. the pull request title.
    - `external_href` string, nullable, required — Link to the external resource the diff scan was created for, e.g. the pull request URL.
    - `merge` boolean, required — True when the diff scan was created for a merge event rather than an open pull request.
    - `html_url` string, nullable, required — Link to the diff scan report in the Socket dashboard.
    - `api_url` string, nullable, required — Link to the diff scan resource in the Socket API.
  - `unmatchedAfterFiles` string[], required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Insufficient max_quota for API method
- `404` — Resource not found
- `409` — Resource already exists
- `429` — Insufficient quota for API route

---

[API](https://skmtc.dev/socket-dev/apis/socket.md) · [All operations](https://skmtc.dev/socket-dev/apis/socket/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/socket-dev/socket/revisions/bf994b75d33f/schema)
