Apps
Apps provide a way to group related workloads together within a project.
Authentication
All app endpoints require authentication using a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer <YOUR_API_KEY>
Create App
Create a new app.
Endpoint
POST /tha/v2/apps
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Required. Name for the app. |
project_id | string | UID of the project this app belongs to. |
Example Request
curl -X POST https://api.targon.com/tha/v2/apps \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "my-app",
"project_id": "prj-abc123def456"
}'
Response
Returns the app object. If an app with the same name already exists, it returns the existing app with 200. Otherwise returns 201.
| Field | Type | Description |
|---|---|---|
uid | string | Unique identifier for the app. |
name | string | Name of the app. |
project_id | string | UID of the parent project. |
created_at | string | ISO 8601 creation timestamp. |
updated_at | string | ISO 8601 last update timestamp. |
Example Response
{
"uid": "app-abc123def456",
"name": "my-app",
"project_id": "prj-abc123def456",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
Errors
| Status Code | Description |
|---|---|
| 400 - Bad Request | Invalid request body. |
| 401 - Unauthorized | Invalid or missing API key. |
| 403 - Forbidden | Not allowed. |
| 404 - Not Found | Related project not found. |
| 500 - Internal Server Error | Server error. |
List Apps
List all apps for the authenticated user.
Endpoint
GET /tha/v2/apps
Query Parameters
| Field | Type | Description |
|---|---|---|
limit | integer | Maximum number of items to return. |
cursor | string | Pagination cursor. |
project_id | string | Filter apps by project UID. |
Example Request
curl -X GET "https://api.targon.com/tha/v2/apps?project_id=prj-abc123def456&limit=10" \
-H "Authorization: Bearer <YOUR_API_KEY>"
Response
| Field | Type | Description |
|---|---|---|
items | array | List of app objects. |
next_cursor | string | Cursor for the next page of results. |
Example Response
{
"items": [
{
"uid": "app-abc123def456",
"name": "my-app",
"project_id": "prj-abc123def456",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
],
"next_cursor": ""
}
Errors
| Status Code | Description |
|---|---|
| 400 - Bad Request | Invalid query parameters. |
| 401 - Unauthorized | Invalid or missing API key. |
| 500 - Internal Server Error | Server error. |
Get App
Retrieve an app by its UID.
Endpoint
GET /tha/v2/apps/{app_uid}
Path Parameters
| Field | Type | Description |
|---|---|---|
app_uid | string | Unique identifier of the app. |
Example Request
curl -X GET https://api.targon.com/tha/v2/apps/app-abc123def456 \
-H "Authorization: Bearer <YOUR_API_KEY>"
Response
Returns the app object.
Example Response
{
"uid": "app-abc123def456",
"name": "my-app",
"project_id": "prj-abc123def456",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
Errors
| Status Code | Description |
|---|---|
| 401 - Unauthorized | Invalid or missing API key. |
| 403 - Forbidden | Not allowed. |
| 404 - Not Found | App not found. |
| 500 - Internal Server Error | Server error. |
Update App
Update an app's fields.
Endpoint
PATCH /tha/v2/apps/{app_uid}
Path Parameters
| Field | Type | Description |
|---|---|---|
app_uid | string | Unique identifier of the app. |
Request Body
| Field | Type | Description |
|---|---|---|
name | string | New name for the app. |
project_id | string | New project UID to move the app to. |
Example Request
curl -X PATCH https://api.targon.com/tha/v2/apps/app-abc123def456 \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "renamed-app"
}'
Response
Returns the updated app object.
Example Response
{
"uid": "app-abc123def456",
"name": "renamed-app",
"project_id": "prj-abc123def456",
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-16T08:00:00Z"
}
Errors
| Status Code | Description |
|---|---|
| 400 - Bad Request | Invalid request body. |
| 401 - Unauthorized | Invalid or missing API key. |
| 403 - Forbidden | Not allowed. |
| 404 - Not Found | App or related project not found. |
| 500 - Internal Server Error | Server error. |
Delete App
Delete an app.
Endpoint
DELETE /tha/v2/apps/{app_uid}
Path Parameters
| Field | Type | Description |
|---|---|---|
app_uid | string | Unique identifier of the app. |
Example Request
curl -X DELETE https://api.targon.com/tha/v2/apps/app-abc123def456 \
-H "Authorization: Bearer <YOUR_API_KEY>"
Response
Returns 204 No Content on success.
Errors
| Status Code | Description |
|---|---|
| 401 - Unauthorized | Invalid or missing API key. |
| 403 - Forbidden | Not allowed. |
| 404 - Not Found | App not found. |
| 500 - Internal Server Error | Server error. |