# POST /api/v1/org/{orgId}/repo/{repoId}/applications

**Replace repository application mappings**

## Replace Repository Applications

**Replace** the list of applications for the given repository.

**Usage:**
Only the id parameters are required for this request. All other fields are ignored.
* `orgId`
* `repoId`
* `appInfos.[*].id` - one entry for each app you want to map. You must pass in current mappings to maintain them.

Note that the other fields in `appInfos` are read-only for this request, and will be ignored.

> 🧾 Audited
> This is recorded as `APPLICATIONS_ADDED_FOR_REPOS` [User Activity](https://apidocs.stackhawk.com/reference/listauditactivity#user-activity-types).

> Requires `write:application` permission.

## Parameters

- `orgId` (in: path, string<uuid>) *(required)* — UUID identifier for this StackHawk Organization.
- `repoId` (in: path, string<uuid>) *(required)* — UUID identifier for this StackHawk Repository.

## Request Body

### application/json

- `appInfos` (repository.AppInfo[]) — The list of application mappings for this repository.
  - `appStatus` (string) — Read-only field for the application status.
  - `id` (string) — The application id.
  - `lastScanHost` (string) — Read-only field for the last scan host.
  - `lastScanId` (string) — Read-only field for the last scan id.
  - `lastScanTimestamp` (integer<int64>) — Read-only field for the last scan timestamp.
  - `name` (string) — The application name.
- `orgId` (string) — The organization this operation belong to.
- `repoId` (string) — The repository id to replace application mappings for.

## Responses

### 200 — OK

#### application/json

- `appInfos` (repository.AppInfo[]) — The list of application mappings for this repository.
  - `appStatus` (string) — Read-only field for the application status.
  - `id` (string) — The application id.
  - `lastScanHost` (string) — Read-only field for the last scan host.
  - `lastScanId` (string) — Read-only field for the last scan id.
  - `lastScanTimestamp` (integer<int64>) — Read-only field for the last scan timestamp.
  - `name` (string) — The application name.
- `orgId` (string) — The organization this operation belong to.
- `repoId` (string) — The repository id to replace application mappings for.

#### application/x-protobuf

- `appInfos` (repository.AppInfo[]) — The list of application mappings for this repository.
  - `appStatus` (string) — Read-only field for the application status.
  - `id` (string) — The application id.
  - `lastScanHost` (string) — Read-only field for the last scan host.
  - `lastScanId` (string) — Read-only field for the last scan id.
  - `lastScanTimestamp` (integer<int64>) — Read-only field for the last scan timestamp.
  - `name` (string) — The application name.
- `orgId` (string) — The organization this operation belong to.
- `repoId` (string) — The repository id to replace application mappings for.

### 400 — Bad Request

- (no body)

### 401 — Unauthorized

- (no body)
