Skip to main content
GET
/
projects
/
{projectId}
/
environments
/
{environmentId}
/
tasks
cURL
curl --request GET \
  --url {schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks \
  --header 'Authorization: Bearer <token>'
import requests

url = "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("{schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/tasks")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
[
  {
    "id": "<string>",
    "resources": {
      "base_memory": 123,
      "memory_ratio": 123
    },
    "authorizations": [
      {
        "action": "<string>",
        "resource": "<string>"
      }
    ],
    "relationships": {},
    "additional_hosts": {},
    "mounts": {},
    "timezone": "<string>",
    "variables": {},
    "container_profile": "<string>",
    "type": "<string>",
    "source": {
      "root": "<string>"
    },
    "hooks": {
      "build": "<string>",
      "deploy": "<string>"
    },
    "dependencies": {},
    "runtime": {},
    "run": {
      "command": "<string>",
      "timeout": 123
    },
    "name": "<string>"
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string
required
environmentId
string
required

Response

default - application/json
id
string
required

The identifier of Task

resources
Resources · object | null
required

Resources configuration (base memory and memory ratio)

authorizations
Authorizations · object[]
required

Authorizations available to this container

relationships
Service Relationships · object
required

The relationships of the container to defined services

additional_hosts
Additional hosts · object
required

A mapping of hostname to ip address to be added to the container's hosts file

mounts
Mounts · object
required

Filesystem mounts of this container. If not specified the container will have no writeable disk space

timezone
string | null
required

The timezone of the task. Defaults to the project's timezone if not specified

variables
Environment Variables · object
required

Variables provide environment-sensitive information to control how this container behaves. To set a Unix environment variable, specify a key of env:, and then each sub-item of that is a key/value pair that will be injected into the environment

container_profile
string | null
required

Selected container profile for this container

type
string
required

The runtime type and version for the task (e.g., python:3.8)

source
Source Code Configuration · object
required

Configuration related to the source code of the task

hooks
Hooks · object
required

Scripts executed at various points in the lifecycle of the task

dependencies
Dependencies · object
required

External global dependencies of this task. They will be downloaded by the language's package manager

runtime
Runtime Configuration · object
required

Runtime-specific configuration

run
Run Configuration · object
required

Configuration for task execution

name
string
required

The unique name of the task

Last modified on July 14, 2026