---
title: Create an application
description: Group connected repositories into an application.
url: https://www.hacktron.ai/docs/api/applications/create-application
---

# Create an application

Creates an [application](/docs/platform/context/applications) from 1 to 50 connected repositories that make up one product or service. Name the repositories by their ids from [`GET /repos`](/docs/api/repos/list-repos). Hacktron makes the application's `slug` from its name, unique within the organisation. Only organisation admins can call it.

When every repository already has a threat model, Hacktron starts building the application's threat model straight away. Otherwise, build it with [`POST /applications/{idOrSlug}/threat-model/sync`](/docs/api/applications/update-application-threat-model), which builds the missing repository threat models first.

## Request

`POST /applications`

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" \
  -H "X-Api-Key: $HACKTRON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Payments",
  "repository_ids": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}'
```

```json title="Response 200 OK" showLineNumbers=false wrap=false
{
  "id": "8d3c5f7e-2b1a-4c9d-9e6f-0a1b2c3d4e5f",
  "organization_id": "f336d0bc-b841-465b-8045-024475c079dd",
  "slug": "payments",
  "name": "Payments",
  "tags": [],
  "created_by": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_at": "2026-11-08T10:02:41.000Z",
  "updated_at": "2026-11-08T10:02:41.000Z",
  "repos": [
    {
      "application_id": "8d3c5f7e-2b1a-4c9d-9e6f-0a1b2c3d4e5f",
      "repo_url": "https://github.com/acme/api",
      "added_by": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "added_at": "2026-11-08T10:02:41.000Z"
    }
  ]
}
```

:::

### Body

A required `application/json` body.

| Field | Type | Description |
| --- | --- | --- |
| `name` | string, required | At most 128 characters. |
| `repository_ids` | array of string, required | Ids from the repository list. |

## Responses

### 200 OK

| Field | Type | Description |
| --- | --- | --- |
| `id` | string, required | |
| `organization_id` | string, required | |
| `slug` | string, required | |
| `name` | string, required | |
| `tags` | array of string, required | |
| `created_by` | string, required, nullable | |
| `created_at` | string (date-time), required | |
| `updated_at` | string (date-time), required | |
| `repos` | array of object | |
| `repos[].application_id` | string, required | |
| `repos[].repo_url` | string, required | |
| `repos[].added_by` | string, required, nullable | |
| `repos[].added_at` | string (date-time), required | |
| `repo_count` | number | |
| `finding_count` | number | |
| `threat_model_updated_at` | string, nullable | ISO timestamp of the most recently updated threat_model.md across the application's repos, or null if none have one. The list endpoint orders applications by this (most recent first; applications without a threat model last). |
