Projects
Projects provide a way to organize your workloads and apps into logical groups.
Authentication
All project endpoints require authentication using a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer <YOUR_API_KEY>
Create Project
Create a new project.
Endpoint
POST /tha/v2/projects
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Required. Name for the project. |
Example Request
curl -X POST https://api.targon.com/tha/v2/projects \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "my-project"
}'
Response
Returns the project object. If a project with the same name already exists, it returns the existing project with 200. Otherwise returns 201.
| Field | Type | Description |
|---|---|---|
uid | string | Unique identifier for the project. |
name | string | Name of the project. |
created_at | string | ISO 8601 creation timestamp. |
updated_at | string | ISO 8601 last update timestamp. |
Example Response
{
"uid": "prj-abc123def456",
"name": "my-project",
"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. |
| 500 - Internal Server Error | Server error. |
List Projects
List all projects for the authenticated user.
Endpoint
GET /tha/v2/projects
Query Parameters
| Field | Type | Description |
|---|---|---|
limit | integer | Maximum number of items to return. |
cursor | string | Pagination cursor. |
Example Request
curl -X GET "https://api.targon.com/tha/v2/projects?limit=10" \
-H "Authorization: Bearer <YOUR_API_KEY>"
Response
| Field | Type | Description |
|---|---|---|
items | array | List of project objects. |
next_cursor | string | Cursor for the next page of results. |
Example Response
{
"items": [
{
"uid": "prj-abc123def456",
"name": "my-project",
"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 Project
Retrieve a project by its UID.
Endpoint
GET /tha/v2/projects/{project_uid}
Path Parameters
| Field | Type | Description |
|---|---|---|
project_uid | string | Unique identifier of the project. |
Example Request
curl -X GET https://api.targon.com/tha/v2/projects/prj-abc123def456 \
-H "Authorization: Bearer <YOUR_API_KEY>"
Response
Returns the project object.
Example Response
{
"uid": "prj-abc123def456",
"name": "my-project",
"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 | Project not found. |
| 500 - Internal Server Error | Server error. |
Update Project
Update a project's fields.
Endpoint
PATCH /tha/v2/projects/{project_uid}
Path Parameters
| Field | Type | Description |
|---|---|---|
project_uid | string | Unique identifier of the project. |
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Required. New name for the project. |
Example Request
curl -X PATCH https://api.targon.com/tha/v2/projects/prj-abc123def456 \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "renamed-project"
}'
Response
Returns the updated project object.
Example Response
{
"uid": "prj-abc123def456",
"name": "renamed-project",
"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 | Project not found. |
| 500 - Internal Server Error | Server error. |
Delete Project
Delete a project.
Endpoint
DELETE /tha/v2/projects/{project_uid}
Path Parameters
| Field | Type | Description |
|---|---|---|
project_uid | string | Unique identifier of the project. |
Example Request
curl -X DELETE https://api.targon.com/tha/v2/projects/prj-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 | Project not found. |
| 500 - Internal Server Error | Server error. |