---
title: Update an application's threat model
description: Rebuild an application's threat model.
url: https://www.hacktron.ai/docs/api/applications/update-application-threat-model
---

# Update an application's threat model

Rebuilds an application's [threat model](/docs/platform/context/threat-models#application-threat-models) from its repositories' threat models, together with the context documents uploaded for the application. Hacktron first builds a threat model from the code for any repository that has none. Name the application by its `id` or `slug`. An application with no repositories returns `400 Bad Request`. You need the member role or above.

The build runs in the background, and the response returns once it has started. To read the result, list the context documents of any of the application's repositories with [`GET /context-documents`](/docs/api/context-documents/list-context-documents). The application's threat model is the document of kind `application_threat_model`.

## Request

`POST /applications/{idOrSlug}/threat-model/sync`

Send an [API key](/docs/api/authentication) with the `write` scope in the `X-Api-Key` header.

:::examples

```bash title="Request" wrap=false
curl -X POST "https://api.hacktron.ai/v1/applications/payments/threat-model/sync" \
  -H "X-Api-Key: $HACKTRON_API_KEY"
```

```json title="Response 200 OK" showLineNumbers=false wrap=false
{
  "started": true
}
```

:::

### Path parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `idOrSlug` | string, required | |

## Responses

### 200 OK

| Field | Type | Description |
| --- | --- | --- |
| `started` | boolean, required | True if a workflow was started; false if nothing was pending. |
