# Getting started

> Getting started - Deploy your first container.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-05-06T18:17:09.610062+00:00` (UTC).

## Primary page

- [Getting started](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/getting-started.html): Full documentation for this topic (HTML).

## Sections on this page

- [Prerequisites](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/getting-started.html#prerequisites): In-page section heading.
- [Set environment variables](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/getting-started.html#set-environment-variables): In-page section heading.
- [Step 1: Deploy the whoami container](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/getting-started.html#step-1-deploy-whoami): In-page section heading.
- [Step 2: Monitor workload status](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/getting-started.html#step-2-monitor-status): In-page section heading.
- [Step 3: Access the running service](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/getting-started.html#step-3-access-service): In-page section heading.
- [Step 4: Stop the running workload](https://docs.datarobot.com/en/docs/api/dev-learning/workload-api/getting-started.html#step-4-stop-workload): In-page section heading.

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.

## Documentation content

This guide walks you through deploying your first container using the Workload API.

## Prerequisites

Before you begin, ensure you have:

- DataRobot API endpoint (base URL) —your DataRobot instance URL.
- Container images hosted in a registry accessible by the DataRobot cluster.
- DataRobot API token for authentication.

## Set environment variables

Before running any commands, set your DataRobot API credentials:

```
export DATAROBOT_ENDPOINT=https://app.datarobot.com/api/v2
export DATAROBOT_API_TOKEN=<your-api-token>
```

Ensure your container:

- Runs in unprivileged mode—containers cannot run as root.
- Exposes a port higher than 1024—privileged ports (0–1024) are not available.
- Implements health check endpoints for readiness probes.
- Exposes an HTTP server.

## Step 1: Deploy the whoami container

Before deploying your own container, try this example using the `containous/whoami` image—a simple HTTP server that returns request information.

Create the workload:

```
curl -X POST "${DATAROBOT_ENDPOINT}/console/workloads/" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "test-whoami",
    "artifact": {
      "name": "whoami-artifact",
      "description": "Simple HTTP server for testing",
      "spec": {
        "containerGroups": [{
          "containers": [{
            "imageUri": "containous/whoami:latest",
            "port": 8080,
            "primary": true,
            "resourceRequest": {"cpu": 1, "memory": 536870912},
            "entrypoint": ["/whoami", "--port", "8080"],
            "readinessProbe": {
              "path": "/",
              "port": 8080,
              "initialDelaySeconds": 5
            }
          }]
        }]
      }
    },
    "runtime": {"replicaCount": 1}
  }'
```

> [!NOTE] Draft artifacts
> This creates an artifact in draft status. Draft artifacts can be edited and are useful for testing before finalizing your deployment configuration.

## Step 2: Monitor workload status

Poll the workload status to track deployment progress. Status progression: submitted → initializing → running.

```
curl -s -X GET "${DATAROBOT_ENDPOINT}/console/workloads/{workloadId}" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}" | jq '.status'
```

## Step 3: Access the running service

Once the workload reaches running status, you can access it:

```
curl -X GET "${DATAROBOT_ENDPOINT}/endpoints/workloads/{workloadId}/" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}"
```

The invoke URL is a base prefix. Append your application's path to reach specific endpoints (for example, `/health` or `/api/...`). Requests are forwarded to the container with the same path and method.

## Step 4: Stop the running workload

When you're done experimenting, stop the running workload:

```
curl -X POST "${DATAROBOT_ENDPOINT}/console/workloads/{workloadId}/stop" \
  -H "Authorization: Bearer ${DATAROBOT_API_TOKEN}"
```
