> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GenerateGitCodeStoreProjectUploadUrl

# Package: gitCodestore

# Namespace: GitCodeStoreManagedProjectManagement

# Method link: https://dev.wix.com/docs/api-reference/account-level/git-codestore/generate-git-code-store-project-upload-url.md

## Introduction

Generates a temporary, project-scoped URL for uploading a ZIP with HTTP PUT.

PUT the ZIP with the returned headers, then call
[Commit Git Code Store Project Upload](https://dev.wix.com/docs/api-reference/account-level/git-codestore/commit-git-code-store-project-upload.md).
The 64 MiB compressed size limit is checked when committing the upload, not by the signed PUT.
Uploading alone never changes the repository. ZIP paths must be relative to its root.
When committing, paths are limited to 1,024 characters, with at most 255 UTF-8 bytes per file or folder name.
Requires an authenticated user with update access to the app or its companion site.

---

## REST API

### Schema

```
 Method: generateGitCodeStoreProjectUploadUrl
 Description: Generates a temporary, project-scoped URL for uploading a ZIP with HTTP PUT.  PUT the ZIP with the returned headers, then call [Commit Git Code Store Project Upload](https://dev.wix.com/docs/api-reference/account-level/git-codestore/commit-git-code-store-project-upload.md). The 64 MiB compressed size limit is checked when committing the upload, not by the signed PUT. Uploading alone never changes the repository. ZIP paths must be relative to its root. When committing, paths are limited to 1,024 characters, with at most 255 UTF-8 bytes per file or folder name. Requires an authenticated user with update access to the app or its companion site.
 URL: https://www.wixapis.com/codestore/v2/git-code-store-projects/{managedProjectId}/generate-upload-url
 Method: POST
 Return type: GenerateGitCodeStoreProjectUploadUrlResponse
  - name: uploadId | type: string | description: Project-scoped upload identifier. Pass it to CommitGitCodeStoreProjectUpload after PUT succeeds.  | validation: format GUID
  - name: uploadUrl | type: string | description: Signed URL accepting HTTP PUT for one staged object. Valid for 5 minutes. Anyone holding this URL can replace the staged object until it expires.  | validation: format WEB_URL
  - name: headers | type: object | description: Required headers for the PUT, in addition to headers automatically set by the HTTP client.  | validation: maxItems 20, format map
  - name: expiresAt | type: string | description: Expiration of the signed URL; credential expiry or revocation can invalidate it earlier.  | validation: format date-time


```

### Examples

### Stage an upload for the same project
Generate a signed upload URL using an authenticated Wix user and the companion site's context. PUT the ZIP to the returned URL with every returned header before committing. The URL shown here is illustrative.

```curl
curl -X POST \
'https://www.wixapis.com/codestore/v2/git-code-store-projects/72357e9a-2094-40b3-8626-9354a5089b49/generate-upload-url' \
-H 'Authorization: <AUTH>' \
-H 'wix-site-id: 426f1a4c-cc7a-43b0-92d9-e267c56f8d27' \
-H 'Content-Type: application/json' \
-d '{}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.gitCodeStore.projects.generateGitCodeStoreProjectUploadUrl(managedProjectId)
 Description: Generates a temporary, project-scoped URL for uploading a ZIP with HTTP PUT.  PUT the ZIP with the returned headers, then call [Commit Git Code Store Project Upload](https://dev.wix.com/docs/api-reference/account-level/git-codestore/commit-git-code-store-project-upload.md). The 64 MiB compressed size limit is checked when committing the upload, not by the signed PUT. Uploading alone never changes the repository. ZIP paths must be relative to its root. When committing, paths are limited to 1,024 characters, with at most 255 UTF-8 bytes per file or folder name. Requires an authenticated user with update access to the app or its companion site.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  managedProjectId
 Method parameters: 
   param name: managedProjectId | type: string | description: GUID of the existing AppManagedProject receiving the upload. Use the same `managedProjectId` for downloading, uploading, and committing. | required: true | validation: format GUID
 Return type: PROMISE<GenerateGitCodeStoreProjectUploadUrlResponse>
  - name: uploadId | type: string | description: Project-scoped upload identifier. Pass it to CommitGitCodeStoreProjectUpload after PUT succeeds.  | validation: format GUID
  - name: uploadUrl | type: string | description: Signed URL accepting HTTP PUT for one staged object. Valid for 5 minutes. Anyone holding this URL can replace the staged object until it expires.  | validation: format WEB_URL
  - name: headers | type: object | description: Required headers for the PUT, in addition to headers automatically set by the HTTP client.  | validation: maxItems 20, format map
  - name: expiresAt | type: Date | description: Expiration of the signed URL; credential expiry or revocation can invalidate it earlier.  


```

### Examples

### Stage an upload for the same project
Requires authenticated Wix user and account context, plus the site context for a companion app. PUT the complete ZIP with the returned headers before committing. Response values are illustrative.

```javascript
import { projects } from "@wix/git-code-store";

async function stageProjectUpload() {
  const response = await projects.generateGitCodeStoreProjectUploadUrl(
    "72357e9a-2094-40b3-8626-9354a5089b49",
  );
  return response;
}

/* Promise resolves to:
 * {
 *   uploadId: "d9ef51cb-d776-4fc8-8d33-3ac139d2bb9a",
 *   uploadUrl: "https://example.com/signed-upload-url",
 *   headers: { "content-type": "application/zip" },
 *   expiresAt: new Date("2026-10-12T10:10:00Z")
 * }
 */

```

### generateGitCodeStoreProjectUploadUrl (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { projects } from '@wix/git-code-store';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { projects },
  // Include the auth strategy and host as relevant
});


async function generateGitCodeStoreProjectUploadUrl(managedProjectId) {
  const response = await myWixClient.projects.generateGitCodeStoreProjectUploadUrl(managedProjectId);
};
```

---