---
title: "Uploads or updates the source file for a release."
method: PUT
path: "/releases/{releaseId}/source-file"
tags: ["components"]
---

# Uploads or updates the source file for a release.

`PUT /releases/{releaseId}/source-file`

## Request

- Base URL: `https://marketplace-api.mendix.com/v1`
- URL: `https://marketplace-api.mendix.com/v1/releases/{releaseId}/source-file`
- Auth: API key in header `Authorization`

Uploads or updates the source file for a specific release. This allows Marketplace component publishers to provide the component package and to transition the release from `Draft` or `Declined` to `InReview` or `Published`.

**Authorization:** The user must have access to manage the component. The user is a developer of the component and meets user group rules.

**Validation:**
- A release with the given `releaseId` must exist in Marketplace.
- The release must be in `Draft` or `Declined`. Cannot update the source file if it is already in `InReview` or `Published`.
- The source file is validated (for example, widget validation, file name extension validation).

**State Transition:**
After a successful upload, the release transitions to one of the following states:
- `Draft`
  - If the `publishManually` field was set to `true` when the release was created.
- `InReview`
  - Mendix Admin approval is required (for private components) or
  - A security scan is required (for public components).
- `Published`
  - Mendix Admin approval is not required (for private components) and
  - A security scan is not required.

A release in the `InReview` state is automatically published to Marketplace and transitions to `Published` once all required review conditions have been satisfied.

**Supported File Types:**
- For platform-supported components and private components, any file type.
- For non-platform-supported components and public components, only the following file types are supported:
  - `.mpk` - Mendix Package file
  - `.mxmodule` - Mendix Module file
  - `.mxsolution` - Mendix Solution file

## Path parameters

- `releaseId` string, uuid, required

## Headers

- `file-name` string, required

## Request body `application/octet-stream`

- string, binary

## Response `202`

The source file was successfully uploaded and the release is now in `InReview` or `Published`.

## Other responses

- `400`: The request contains invalid data or the validation failed. Possible reasons include: - Invalid file format or extension - Widget validation errors (for example, widget name already taken) - Missing required header (file-name)
- `401`: No usable authentication credentials were found. The error message gives additional information.
- `404`: The required item could not be found. The error message provides additional information.
- `409`: The request could not be completed due to a conflict with the current state of the release. This error occurs when trying to upload a source file for a release that is already in `InReview` or `Published`.
- `500`: An error occurred during the processing of the request. The error message provides additional information.

---

[API](https://skmtc.dev/mendix/apis/publish-api.md) - [All operations](https://skmtc.dev/mendix/apis/publish-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mendix/apis/publish-api/revisions/2cf1d323f0b8?raw)
