API Reference / Workspace Tasks
Verified against Flow 5.0.0-beta.39
| Name | Method | Endpoint |
|---|---|---|
| Update, replace, or create a workspace task using Tekton Task YAML | PUT | /api/v2/workspace/{workspace}/task/{name} |
| Create a new Task Template using Tekton Task YAML | POST | /api/v2/workspace/{workspace}/task |
| Delete a Workspace Task | DELETE | /api/v2/workspace/{workspace}/task/{name} |
| Retrieve a workspace task as Tekton Task YAML. If no version specified, the latest version is returned. | GET | /api/v2/workspace/{workspace}/task/{name} |
| Retrieve a workspace task's changelog | GET | /api/v2/workspace/{workspace}/task/{name}/changelog |
| Search for Tasks. If workspaces are provided it will query the workspaces. If no workspaces are provided it will query Global Task Templates | GET | /api/v2/workspace/{workspace}/task/query |
| Validate a workspace task's Tekton Task YAML | POST | /api/v2/workspace/{workspace}/task/validate |
PUT /api/v2/workspace/{workspace}/task/{name}
The name must only contain alphanumeric and - characeters. If the name exists, apply will create a new version.
Requires the task/write permission, from a global, key, session, user token.
| Name | Type | Required | Description | Notes | Example |
|---|---|---|---|---|---|
| name | String | true | Name of Task | ||
| workspace | String | true | Owning workspace name. | my-amazing-workspace |
|
| replace | Boolean | false | Replace existing version | Defaults to false. |
| Schema | Required |
|---|---|
| Task | true |
One of BearerAuth, x-access-token
application/json, application/x-yaml*/*curl -X PUT "$FLOW_URL/api/v2/workspace/$WORKSPACE/task/$TASK" \
-H "Authorization: Bearer $FLOW_TOKEN" \
-H "Content-Type: application/json" \
-d @body.jsonThe request sends this as body.json:
{
"name": "hello-world",
"displayName": "Hello world",
"type": "template",
"spec": {
"image": "alpine:3.20",
"command": [
"echo"
],
"arguments": [
"Hello from Flow"
]
}
}POST /api/v2/workspace/{workspace}/task
The name needs to be unique and must only contain alphanumeric and - characeters.
Requires the task/write permission, from a global, key, session, user token.
| Name | Type | Required | Description | Notes | Example |
|---|---|---|---|---|---|
| workspace | String | true | Owning workspace name. | my-amazing-workspace |
| Schema | Required |
|---|---|
| Task | true |
One of BearerAuth, x-access-token
application/json, application/x-yaml*/*curl -X POST "$FLOW_URL/api/v2/workspace/$WORKSPACE/task" \
-H "Authorization: Bearer $FLOW_TOKEN" \
-H "Content-Type: application/json" \
-d @body.jsonThe request sends this as body.json:
{
"name": "hello-world",
"displayName": "Hello world",
"type": "template",
"spec": {
"image": "alpine:3.20",
"command": [
"echo"
],
"arguments": [
"Hello from Flow"
]
}
}DELETE /api/v2/workspace/{workspace}/task/{name}
Requires the task/delete permission, from a global, key, session, user token.
| Name | Type | Required | Description | Notes | Example |
|---|---|---|---|---|---|
| workspace | String | true | Owning workspace name. | my-amazing-workspace |
|
| name | String | true | Name of Task |
This endpoint does not require a request body.
One of BearerAuth, x-access-token
Not definedNot definedNo response body
curl -X DELETE "$FLOW_URL/api/v2/workspace/$WORKSPACE/task/$TASK" \
-H "Authorization: Bearer $FLOW_TOKEN"GET /api/v2/workspace/{workspace}/task/{name}
Requires the task/read permission, from a global, key, session, user token.
Requires the task/read permission, from a global, key, session, user token.
| Name | Type | Required | Description | Notes | Example |
|---|---|---|---|---|---|
| name | String | true | Name of Task | ||
| workspace | String | true | Owning workspace name. | my-amazing-workspace |
|
| version | Integer | false | Task Version |
This endpoint does not require a request body.
One of BearerAuth, x-access-token
Not defined*/*curl -X GET "$FLOW_URL/api/v2/workspace/$WORKSPACE/task/$TASK" \
-H "Authorization: Bearer $FLOW_TOKEN"GET /api/v2/workspace/{workspace}/task/{name}/changelog
Retrieves each versions changelog and returns them all as a list.
Requires the task/read permission, from a global, key, session, user token.
| Name | Type | Required | Description | Notes | Example |
|---|---|---|---|---|---|
| workspace | String | true | Owning workspace name. | my-amazing-workspace |
|
| name | String | true | Name of Task |
This endpoint does not require a request body.
One of BearerAuth, x-access-token
Not defined*/*List of ChangeLogVersion
curl -X GET "$FLOW_URL/api/v2/workspace/$WORKSPACE/task/$TASK/changelog" \
-H "Authorization: Bearer $FLOW_TOKEN"GET /api/v2/workspace/{workspace}/task/query
Requires the task/read permission, from a global, key, session, user token.
| Name | Type | Required | Description | Notes | Example |
|---|---|---|---|---|---|
| workspace | String | true | Owning workspace name. | my-amazing-workspace |
|
| limit | Integer | true | Result Size | 10 |
|
| page | Integer | true | Page Number | Defaults to 0. |
0 |
| sort | String | true | Ascending (ASC) or Descending (DESC) sort on creationDate | Defaults to ASC. Enum: [ASC, DESC] |
ASC |
| labels | List of String | false | List of url encoded labels. For example Organization=Boomerang,customKey=test would be encoded as Organization%3DBoomerang,customKey%3Dtest) | ||
| statuses | List of String | false | List of statuses to filter for. | Defaults to ["active"]. |
active,inactive |
| names | List of String | false | List of Task Names to filter for. Defaults to all. | switch,event-wait |
This endpoint does not require a request body.
One of BearerAuth, x-access-token
Not defined*/*curl -X GET "$FLOW_URL/api/v2/workspace/$WORKSPACE/task/query?limit=10&page=0&sort=ASC" \
-H "Authorization: Bearer $FLOW_TOKEN"POST /api/v2/workspace/{workspace}/task/validate
Validates the Task YAML as a Tekton Task
Requires the task/read permission, from a global, key, session, user token.
| Name | Type | Required | Description | Notes | Example |
|---|---|---|---|---|---|
| workspace | String | true | Owning workspace name. | my-amazing-workspace |
| Schema | Required |
|---|---|
| TektonTask | true |
One of BearerAuth, x-access-token
application/x-yamlNot definedNo response body
curl -X POST "$FLOW_URL/api/v2/workspace/$WORKSPACE/task/validate" \
-H "Authorization: Bearer $FLOW_TOKEN" \
-H "Content-Type: application/x-yaml" \
--data-binary @task.yaml