---
title: "Initialize an empty repository with a project's stored source"
method: POST
path: "/projects/{id}/source-export"
tags: ["Projects", "Git Connections"]
---

# Initialize an empty repository with a project's stored source

`POST /projects/{id}/source-export`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/source-export`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Creates the first commit in the connected repository and pushes it
directly to the configured production branch. The push enters the
ordinary Git auto-deploy flow. Direct source writes remain frozen until
that deployment succeeds and the repository becomes the source of truth.

The caller confirms the production branch shown before export. Starting
export pins that branch: later GitHub default-branch changes do not
repoint the project. If the configured branch changed after the caller
read it, the request fails without exporting so the caller can show and
confirm the new value.

The response lists what the export could not carry: resources with no
successful deployment to take source from (`skipped`), and things no
export can hand back (`omitted`) — migrations, which Volcano stores no
copy of, and credential-shaped files, which are left for their owner to
add.

Requires a connected repository with no commits or branches, and runs
once. Volcano never creates the repository. If GitHub did not confirm
the push, retrying creates the same commit and adopts it when it already
reached the repository.

## Path parameters

- `id` string, uuid, required

## Request body

- ExportProjectSourceRequest
  - `production_branch` string, required: The currently configured production branch the user confirmed for export.

## Response `201`

The initial production-branch commit that was pushed

- ProjectSourceExport: The initial production-branch commit, and everything export could not carry.
  - `repo_full_name` string, required
  - `branch` string, required: The production branch that was created.
  - `commit_sha` string, required
  - `file_count` integer, required
  - `skipped` ProjectSourceExportSkip[], required: Resources whose source could not be taken, with the reason. Most often a resource that has never deployed successfully.
    - `kind` string, required: The kind of resource, "function" or "frontend". Deliberately not an enum: the generated constants would collide with an existing resource-type enum and rename its members.
    - `name` string, required
    - `reason` string, required
  - `omitted` ProjectSourceExportOmission[], required: Things deliberately left out of the branch.
    - `kind` string, required: What was left out: migrations Volcano stores no copy of, variable values, a credential-shaped file, installed dependencies, or an archive entry a repository cannot carry.
    - `resource` string, required: The resource it came from, empty when project-wide.
    - `path` string, required

## Other responses

- `400`: Malformed request body
- `401`: Unauthorized - invalid or missing token
- `403`: Forbidden - project not owned by the caller
- `404`: Project not found, or it has no repository connected
- `409`: The source has already been exported, the repository has already taken over as the source of truth, the confirmed production branch is stale, a function or frontend deployment is still in progress, or the project has no stored source to export
- `422`: The repository refused the branch, or its contents cannot be laid out as a repository — a stored file that only ever carries credentials, or a layout Git auto-deploy would not read back
- `429`: GitHub rate limited the request
- `500`: Internal server error
- `501`: Source export is not available in this deployment mode
- `503`: GitHub integration is not configured

## Changes

- **2026-10-07** `23e7875e7c4c`: 1 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
- **2026-09-19** `3a6f365f3f35`: 11 breaking, 20 info
  - added the new path request parameter `id`
  - the response's body type changed from no type to `object` for status `400`
  - the response's body type changed from no type to `object` for status `401`
  - the response's body type changed from no type to `object` for status `403`
  - …27 more
- **2026-09-04** `c2ec82fb8ce8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/source-export/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
