Skip to main content

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

FieldTypeDescription
namestringRequired. 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.

FieldTypeDescription
uidstringUnique identifier for the project.
namestringName of the project.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 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 CodeDescription
400 - Bad RequestInvalid request body.
401 - UnauthorizedInvalid or missing API key.
500 - Internal Server ErrorServer error.

List Projects

List all projects for the authenticated user.

Endpoint

GET /tha/v2/projects

Query Parameters

FieldTypeDescription
limitintegerMaximum number of items to return.
cursorstringPagination cursor.

Example Request

curl -X GET "https://api.targon.com/tha/v2/projects?limit=10" \
-H "Authorization: Bearer <YOUR_API_KEY>"

Response

FieldTypeDescription
itemsarrayList of project objects.
next_cursorstringCursor 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 CodeDescription
400 - Bad RequestInvalid query parameters.
401 - UnauthorizedInvalid or missing API key.
500 - Internal Server ErrorServer error.

Get Project

Retrieve a project by its UID.

Endpoint

GET /tha/v2/projects/{project_uid}

Path Parameters

FieldTypeDescription
project_uidstringUnique 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 CodeDescription
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundProject not found.
500 - Internal Server ErrorServer error.

Update Project

Update a project's fields.

Endpoint

PATCH /tha/v2/projects/{project_uid}

Path Parameters

FieldTypeDescription
project_uidstringUnique identifier of the project.

Request Body

FieldTypeDescription
namestringRequired. 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 CodeDescription
400 - Bad RequestInvalid request body.
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundProject not found.
500 - Internal Server ErrorServer error.

Delete Project

Delete a project.

Endpoint

DELETE /tha/v2/projects/{project_uid}

Path Parameters

FieldTypeDescription
project_uidstringUnique 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 CodeDescription
401 - UnauthorizedInvalid or missing API key.
403 - ForbiddenNot allowed.
404 - Not FoundProject not found.
500 - Internal Server ErrorServer error.