---
title: "Link Headless Source Commit"
method: POST
path: "/v2/paywalls/{id}/versions/{version}/source-commit"
tags: ["Paywalls V2"]
---

# Link Headless Source Commit

`POST /v2/paywalls/{id}/versions/{version}/source-commit`

Links a directly-pushed source commit to a pushed version after verifying it is the source repo's branch head, and revokes the mint token. 409 when another publish moved the head first. Requires paywalls:write scope.

## Path parameters

- `id` string, required — Paywall ID
- `version` string, required — a string to be decoded into a number

## Request body

- object
  - `commit_sha` string, required — Git commit SHA the CLI pushed
  - `token_id` string — Token id from the source-access mint, revoked on successful link

## Response `200`

Success

- object
  - `object` 'paywall.source_commit', required — Object type, always `paywall.source_commit`
  - `id` string, required — ID of the paywall
  - `version` number, required — The version this commit is linked to
  - `repo` string, required — Source repo name
  - `commit_sha` string, required — The linked commit

## Other responses

- `400` — The request did not match the expected schema
- `401` — No API key was provided in the request
- `403` — The API key does not have permission to perform this action
- `404` — The requested resource was not found
- `409` — The resource already exists or conflicts with an existing resource
- `422` — @superwall/api-schema/v2/errors/PaywallArchivedError
- `429` — Too many requests have been made in a short period
- `500` — An unexpected error occurred on the server

---

[API](https://skmtc.dev/superwall/apis/superwall-api-v2.md) · [All operations](https://skmtc.dev/superwall/apis/superwall-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/superwall/superwall-api-v2/revisions/44900ad77d2c/schema)
