Skip to content

Studio REST API v1.0.0

Scroll down for code samples, example requests and responses. .

DataChain Studio provides REST API for programmatically managing datasets, jobs, and storage operations. All API endpoints require authentication and are scoped to specific teams.

Authorization:

All API endpoints require authentication via a Studio token. The token must be included in the Authorization header. You can get a token by using datachain auth token after logging in with datachain auth login or from Tokens page in the Studio UI Settings. Once you get a token, attach it to the Authorization header in the following format:

Authorization: Bearer <token>

  • Base URL: https://studio.datachain.ai/api

Default

Get Jobs

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/jobs/?team_name=string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://example.com/api/datachain/jobs/?team_name=string' \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY'

GET /api/datachain/jobs/

Retrieve a list of jobs with optional status filtering.

Requires a token with read access to JOB scope.

Example responses

200 Response

[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "url": "https://studio.datachain.ai/team/team_name/datasets/jobs/0502eef6-a32e-45fa-8e3b-d20ecpabbcf0",
    "status": "CREATED",
    "created_at": "2021-01-01T00:00:00Z",
    "created_by": "username",
    "finished_at": "2021-01-01T00:00:00Z",
    "query": "print('Hello, World!')",
    "query_type": "PYTHON",
    "team": "TeamName",
    "name": "QueryName",
    "workers": 1,
    "python_version": "3.13",
    "requirements": "numpy==1.24.0",
    "repository": "https://github.com/user/repo",
    "environment": {
      "ENV_NAME": "ENV_VALUE"
    },
    "exit_code": 0,
    "error_message": "Error message",
    "error_stack": "",
    "params": {},
    "metrics": {},
    "parent_job_id": "550e8400-e29b-41d4-a716-446655440000",
    "rerun_from_job_id": "550e8400-e29b-41d4-a716-446655440000",
    "run_group_id": "550e8400-e29b-41d4-a716-446655440000"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Create Job

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"query\":\"print('Hello, World!')\",\"query_type\":\"PYTHON\",\"team_name\":\"TeamName\",\"environment\":\"ENV_NAME=ENV_VALUE\",\"workers\":1,\"query_name\":\"QueryName\",\"rerun_from_job_id\":\"550e8400-e29b-41d4-a716-446655440000\",\"files\":[\"2\",\"3\"],\"python_version\":\"3.13\",\"requirements\":\"numpy==1.24.0\",\"repository\":\"https://github.com/user/repo\",\"priority\":1,\"compute_cluster_name\":\"ComputeClusterName\",\"compute_cluster_id\":1,\"start_after\":\"2021-01-01T00:00:00Z\",\"cron_expression\":\"0 0 * * *\",\"credentials_name\":\"CredentialsName\",\"reset\":false}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/jobs/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/jobs/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"query":"print('\''Hello, World!'\'')","query_type":"PYTHON","team_name":"TeamName","environment":"ENV_NAME=ENV_VALUE","workers":1,"query_name":"QueryName","rerun_from_job_id":"550e8400-e29b-41d4-a716-446655440000","files":["2","3"],"python_version":"3.13","requirements":"numpy==1.24.0","repository":"https://github.com/user/repo","priority":1,"compute_cluster_name":"ComputeClusterName","compute_cluster_id":1,"start_after":"2021-01-01T00:00:00Z","cron_expression":"0 0 * * *","credentials_name":"CredentialsName","reset":false}'

POST /api/datachain/jobs/

Creates a job and returns the job metadata.

Note that compute_cluster_name and compute_cluster_id are mutually exclusive. Requires a token with write access to JOB scope.

Body parameter

{
  "query": "print('Hello, World!')",
  "query_type": "PYTHON",
  "team_name": "TeamName",
  "environment": "ENV_NAME=ENV_VALUE",
  "workers": 1,
  "query_name": "QueryName",
  "rerun_from_job_id": "550e8400-e29b-41d4-a716-446655440000",
  "files": [
    "2",
    "3"
  ],
  "python_version": "3.13",
  "requirements": "numpy==1.24.0",
  "repository": "https://github.com/user/repo",
  "priority": 1,
  "compute_cluster_name": "ComputeClusterName",
  "compute_cluster_id": 1,
  "start_after": "2021-01-01T00:00:00Z",
  "cron_expression": "0 0 * * *",
  "credentials_name": "CredentialsName",
  "reset": false
}

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://studio.datachain.ai/team/team_name/datasets/jobs/0502eef6-a32e-45fa-8e3b-d20ecpabbcf0",
  "status": "CREATED",
  "created_at": "2021-01-01T00:00:00Z",
  "created_by": "username",
  "finished_at": "2021-01-01T00:00:00Z",
  "query": "print('Hello, World!')",
  "query_type": "PYTHON",
  "team": "TeamName",
  "name": "QueryName",
  "workers": 1,
  "python_version": "3.13",
  "requirements": "numpy==1.24.0",
  "repository": "https://github.com/user/repo",
  "environment": {
    "ENV_NAME": "ENV_VALUE"
  },
  "exit_code": 0,
  "error_message": "Error message",
  "error_stack": "",
  "params": {},
  "metrics": {},
  "parent_job_id": "550e8400-e29b-41d4-a716-446655440000",
  "rerun_from_job_id": "550e8400-e29b-41d4-a716-446655440000",
  "run_group_id": "550e8400-e29b-41d4-a716-446655440000"
}

Responses

Status Meaning Description Schema
200 OK OK JobOutput

Get Job Logs

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'Authorization': "API_KEY" }

conn.request("GET", "/api/datachain/jobs/497f6eca-6276-4993-bfeb-53cbbbba6f08/logs", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://example.com/api/datachain/jobs/497f6eca-6276-4993-bfeb-53cbbbba6f08/logs \
  --header 'Authorization: API_KEY'

GET /api/datachain/jobs/{job_id}/logs

Retrieve the logs for an active job.

Requires a token with read access to JOB scope.

Responses

Status Meaning Description Schema
200 OK OK None

Cancel Job

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"team_name\":\"TeamName\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/jobs/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/jobs/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"team_name":"TeamName"}'

POST /api/datachain/jobs/{job_id}/cancel

Cancel a running or queued job.

Requires a token with write access to JOB scope.

Body parameter

{
  "team_name": "TeamName"
}

Example responses

200 Response

{
  "message": "Successfully canceled"
}

Responses

Status Meaning Description Schema
200 OK OK ActionFeedback

Upload File

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n"

headers = {
    'Content-Type': "multipart/form-data; boundary=---011000010111000001101001",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/jobs/files?team_name=string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url 'https://example.com/api/datachain/jobs/files?team_name=string' \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
  --form file=string

POST /api/datachain/jobs/files

Upload a file to use with a job.

Use the file id returned by this endpoint in the files field of the job input. Requires a token with write access to JOB scope.

Body parameter

file: string

Example responses

200 Response

{
  "id": 1,
  "filename": "file.txt",
  "size": 100,
  "state": "pending",
  "error": "Error message"
}

Responses

Status Meaning Description Schema
200 OK OK UploadFileOutput

Get Clusters

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/clusters/", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://example.com/api/datachain/clusters/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY'

GET /api/datachain/clusters/

Example responses

200 Response

[
  {
    "id": 1,
    "name": "ComputeClusterName",
    "status": "ACTIVE",
    "cloud_provider": "AWS",
    "cloud_credentials": "CredentialsName",
    "is_active": true,
    "default": true,
    "max_workers": 1
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Create Pipeline Schedule

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"schedule_name\":\"schedule_name\",\"team_name\":\"team_name\",\"pipeline_id\":\"pipeline_id\",\"pipeline_name\":\"rathy-kyat\",\"start_after\":\"2019-08-24T14:15:22Z\",\"cron_expression\":\"0 0 * * *\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/create-schedule", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/create-schedule \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"schedule_name":"schedule_name","team_name":"team_name","pipeline_id":"pipeline_id","pipeline_name":"rathy-kyat","start_after":"2019-08-24T14:15:22Z","cron_expression":"0 0 * * *"}'

POST /api/datachain/pipeline/create-schedule

Body parameter

{
  "schedule_name": "schedule_name",
  "team_name": "team_name",
  "pipeline_id": "pipeline_id",
  "pipeline_name": "rathy-kyat",
  "start_after": "2019-08-24T14:15:22Z",
  "cron_expression": "0 0 * * *"
}

Example responses

200 Response

{
  "ok": true,
  "schedule": {
    "id": 0,
    "schedule_name": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "start_after": "2019-08-24T14:15:22Z",
    "cron_expression": "string",
    "next_run": "2019-08-24T14:15:22Z",
    "latest_run": {
      "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
      "status": "RUNNING",
      "job_runs": [
        {
          "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
          "status": "string",
          "parent_job_ids": [
            "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          ],
          "name": "string",
          "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
        }
      ],
      "completed": 10,
      "total": 16,
      "error_message": "Error message",
      "error_stack": "Error stack",
      "triggered_from": "@amritghimire.project.dataset",
      "name": "rathe-kyat",
      "created_at": "2021-01-01T00:00:00Z",
      "updated_at": "2021-01-01T00:00:00Z",
      "is_definition": false,
      "schedule_name": "schedule_name",
      "python_version": "3.12",
      "requirements": "pandas==2.0.0",
      "repository": "git@github.com:user/repo.git",
      "workers": 4,
      "priority": 5,
      "environment_variables": {
        "TEST_ENV": "1"
      },
      "created_via": "manual"
    },
    "pipeline": {
      "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
      "status": "RUNNING",
      "job_runs": [
        {
          "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
          "status": "string",
          "parent_job_ids": [
            "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          ],
          "name": "string",
          "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
        }
      ],
      "completed": 10,
      "total": 16,
      "error_message": "Error message",
      "error_stack": "Error stack",
      "triggered_from": "@amritghimire.project.dataset",
      "name": "rathe-kyat",
      "created_at": "2021-01-01T00:00:00Z",
      "updated_at": "2021-01-01T00:00:00Z",
      "is_definition": false,
      "schedule_name": "schedule_name",
      "python_version": "3.12",
      "requirements": "pandas==2.0.0",
      "repository": "git@github.com:user/repo.git",
      "workers": 4,
      "priority": 5,
      "environment_variables": {
        "TEST_ENV": "1"
      },
      "created_via": "manual"
    },
    "created_by": {
      "username": "string",
      "first_name": "string",
      "last_name": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineScheduleUpdateOutput

Update Pipeline Schedule

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"schedule_name\":\"schedule_name\",\"team_name\":\"team_name\",\"schedule_id\":1,\"start_after\":\"2019-08-24T14:15:22Z\",\"cron_expression\":\"0 0 * * *\",\"pause_pipeline\":true}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/update-schedule", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/update-schedule \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"schedule_name":"schedule_name","team_name":"team_name","schedule_id":1,"start_after":"2019-08-24T14:15:22Z","cron_expression":"0 0 * * *","pause_pipeline":true}'

POST /api/datachain/pipeline/update-schedule

Body parameter

{
  "schedule_name": "schedule_name",
  "team_name": "team_name",
  "schedule_id": 1,
  "start_after": "2019-08-24T14:15:22Z",
  "cron_expression": "0 0 * * *",
  "pause_pipeline": true
}

Example responses

200 Response

{
  "ok": true,
  "schedule": {
    "id": 0,
    "schedule_name": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "start_after": "2019-08-24T14:15:22Z",
    "cron_expression": "string",
    "next_run": "2019-08-24T14:15:22Z",
    "latest_run": {
      "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
      "status": "RUNNING",
      "job_runs": [
        {
          "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
          "status": "string",
          "parent_job_ids": [
            "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          ],
          "name": "string",
          "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
        }
      ],
      "completed": 10,
      "total": 16,
      "error_message": "Error message",
      "error_stack": "Error stack",
      "triggered_from": "@amritghimire.project.dataset",
      "name": "rathe-kyat",
      "created_at": "2021-01-01T00:00:00Z",
      "updated_at": "2021-01-01T00:00:00Z",
      "is_definition": false,
      "schedule_name": "schedule_name",
      "python_version": "3.12",
      "requirements": "pandas==2.0.0",
      "repository": "git@github.com:user/repo.git",
      "workers": 4,
      "priority": 5,
      "environment_variables": {
        "TEST_ENV": "1"
      },
      "created_via": "manual"
    },
    "pipeline": {
      "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
      "status": "RUNNING",
      "job_runs": [
        {
          "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
          "status": "string",
          "parent_job_ids": [
            "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          ],
          "name": "string",
          "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
        }
      ],
      "completed": 10,
      "total": 16,
      "error_message": "Error message",
      "error_stack": "Error stack",
      "triggered_from": "@amritghimire.project.dataset",
      "name": "rathe-kyat",
      "created_at": "2021-01-01T00:00:00Z",
      "updated_at": "2021-01-01T00:00:00Z",
      "is_definition": false,
      "schedule_name": "schedule_name",
      "python_version": "3.12",
      "requirements": "pandas==2.0.0",
      "repository": "git@github.com:user/repo.git",
      "workers": 4,
      "priority": 5,
      "environment_variables": {
        "TEST_ENV": "1"
      },
      "created_via": "manual"
    },
    "created_by": {
      "username": "string",
      "first_name": "string",
      "last_name": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineScheduleUpdateOutput

Delete Pipeline Schedule

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"team_name\":\"team_name\",\"schedule_id\":1}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/delete-schedule", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/delete-schedule \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"team_name":"team_name","schedule_id":1}'

POST /api/datachain/pipeline/delete-schedule

Body parameter

{
  "team_name": "team_name",
  "schedule_id": 1
}

Example responses

200 Response

{
  "ok": true
}

Responses

Status Meaning Description Schema
200 OK OK DeletePipelineScheduleOutput

Get Pipeline Schedule

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/pipeline/schedule?team_name=string&schedule_id=0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://example.com/api/datachain/pipeline/schedule?team_name=string&schedule_id=0' \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY'

GET /api/datachain/pipeline/schedule

Example responses

200 Response

{
  "id": 0,
  "schedule_name": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "start_after": "2019-08-24T14:15:22Z",
  "cron_expression": "string",
  "next_run": "2019-08-24T14:15:22Z",
  "latest_run": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  },
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  },
  "created_by": {
    "username": "string",
    "first_name": "string",
    "last_name": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineScheduleOutput

List Pipeline Schedules

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/pipeline/schedules?team_name=string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://example.com/api/datachain/pipeline/schedules?team_name=string' \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY'

GET /api/datachain/pipeline/schedules

Example responses

200 Response

[
  {
    "id": 0,
    "schedule_name": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "start_after": "2019-08-24T14:15:22Z",
    "cron_expression": "string",
    "next_run": "2019-08-24T14:15:22Z",
    "created_by": {
      "username": "string",
      "first_name": "string",
      "last_name": "string"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Trigger Pipeline

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"datasets\":[\"@amritghimire.project_name.dataset_name@v1.0.0\",\"@amritghimire.project_name.dataset_name\",\"dataset_name\",\"dataset_name@v1.0.0\"],\"team_name\":\"team_name\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/trigger", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/trigger \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"datasets":["@amritghimire.project_name.dataset_name@v1.0.0","@amritghimire.project_name.dataset_name","dataset_name","dataset_name@v1.0.0"],"team_name":"team_name"}'

POST /api/datachain/pipeline/trigger

Create a pipeline definition from dataset dependencies (DAG builds async; does not start a run).

Body parameter

{
  "datasets": [
    "@amritghimire.project_name.dataset_name@v1.0.0",
    "@amritghimire.project_name.dataset_name",
    "dataset_name",
    "dataset_name@v1.0.0"
  ],
  "team_name": "team_name"
}

Example responses

200 Response

{
  "ok": true,
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineOutput

Create Pipeline Run

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"team_name\":\"team_name\",\"definition_id\":\"definition_id\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/run", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/run \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"team_name":"team_name","definition_id":"definition_id"}'

POST /api/datachain/pipeline/run

Create and start a run from an existing definition.

Body parameter

{
  "team_name": "team_name",
  "definition_id": "definition_id"
}

Example responses

200 Response

{
  "ok": true,
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineOutput

Update Pipeline Settings

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"team_name\":\"team_name\",\"pipeline_name\":\"rathy-kyat\",\"python_version\":\"3.12\",\"requirements\":\"pandas==2.0.0\",\"repository\":\"git@github.com:user/repo.git\",\"workers\":4,\"priority\":5,\"environment\":\"TEST_ENV=1\",\"files\":[\"file_id_1\",\"file_id_2\"],\"credentials_names\":[\"cred_name_1\"]}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/settings", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/settings \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"team_name":"team_name","pipeline_name":"rathy-kyat","python_version":"3.12","requirements":"pandas==2.0.0","repository":"git@github.com:user/repo.git","workers":4,"priority":5,"environment":"TEST_ENV=1","files":["file_id_1","file_id_2"],"credentials_names":["cred_name_1"]}'

POST /api/datachain/pipeline/settings

Body parameter

{
  "team_name": "team_name",
  "pipeline_name": "rathy-kyat",
  "python_version": "3.12",
  "requirements": "pandas==2.0.0",
  "repository": "git@github.com:user/repo.git",
  "workers": 4,
  "priority": 5,
  "environment": "TEST_ENV=1",
  "files": [
    "file_id_1",
    "file_id_2"
  ],
  "credentials_names": [
    "cred_name_1"
  ]
}

Example responses

200 Response

{
  "ok": true,
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineOutput

Get Pipeline

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/pipeline/status?team_name=string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://example.com/api/datachain/pipeline/status?team_name=string' \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY'

GET /api/datachain/pipeline/status

Example responses

200 Response

{
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "status": "RUNNING",
  "job_runs": [
    {
      "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
      "status": "string",
      "parent_job_ids": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ],
      "name": "string",
      "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
    }
  ],
  "completed": 10,
  "total": 16,
  "error_message": "Error message",
  "error_stack": "Error stack",
  "triggered_from": "@amritghimire.project.dataset",
  "name": "rathe-kyat",
  "created_at": "2021-01-01T00:00:00Z",
  "updated_at": "2021-01-01T00:00:00Z",
  "is_definition": false,
  "schedule_name": "schedule_name",
  "python_version": "3.12",
  "requirements": "pandas==2.0.0",
  "repository": "git@github.com:user/repo.git",
  "workers": 4,
  "priority": 5,
  "environment_variables": {
    "TEST_ENV": "1"
  },
  "created_via": "manual"
}

Responses

Status Meaning Description Schema
200 OK OK JobPipelineOutput

Pause Pipeline

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"team_name\":\"team_name\",\"pipeline_id\":\"ec036e81-7903-4e4d-bbfa-ac8516341cf0\",\"name\":\"string\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/pause", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/pause \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"team_name":"team_name","pipeline_id":"ec036e81-7903-4e4d-bbfa-ac8516341cf0","name":"string"}'

POST /api/datachain/pipeline/pause

Body parameter

{
  "team_name": "team_name",
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "name": "string"
}

Example responses

200 Response

{
  "ok": true,
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineOutput

Resume Pipeline

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"team_name\":\"team_name\",\"pipeline_id\":\"ec036e81-7903-4e4d-bbfa-ac8516341cf0\",\"name\":\"string\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/resume", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/resume \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"team_name":"team_name","pipeline_id":"ec036e81-7903-4e4d-bbfa-ac8516341cf0","name":"string"}'

POST /api/datachain/pipeline/resume

Body parameter

{
  "team_name": "team_name",
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "name": "string"
}

Example responses

200 Response

{
  "ok": true,
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineOutput

Duplicate Pipeline

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"team_name\":\"team_name\",\"pipeline_id\":\"ec036e81-7903-4e4d-bbfa-ac8516341cf0\",\"name\":\"string\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/duplicate", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/duplicate \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"team_name":"team_name","pipeline_id":"ec036e81-7903-4e4d-bbfa-ac8516341cf0","name":"string"}'

POST /api/datachain/pipeline/duplicate

Snapshot a run (or copy a definition) into a new definition.

Body parameter

{
  "team_name": "team_name",
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "name": "string"
}

Example responses

200 Response

{
  "ok": true,
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineOutput

Remove Job From Pipeline

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"team_name\":\"team_name\",\"pipeline_id\":\"ec036e81-7903-4e4d-bbfa-ac8516341cf0\",\"name\":\"string\",\"job_id\":\"job_id\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/pipeline/remove-job", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/pipeline/remove-job \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"team_name":"team_name","pipeline_id":"ec036e81-7903-4e4d-bbfa-ac8516341cf0","name":"string","job_id":"job_id"}'

POST /api/datachain/pipeline/remove-job

Body parameter

{
  "team_name": "team_name",
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "name": "string",
  "job_id": "job_id"
}

Example responses

200 Response

{
  "ok": true,
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
}

Responses

Status Meaning Description Schema
200 OK OK PipelineOutput

List Pipelines

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "[\"string\"]"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/pipeline/list?team_name=string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://example.com/api/datachain/pipeline/list?team_name=string' \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '["string"]'

GET /api/datachain/pipeline/list

Body parameter

[
  "string"
]

Example responses

200 Response

[
  {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Create Group

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"name\":\"production-team\",\"description\":\"\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/rbac/access-groups/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/rbac/access-groups/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"name":"production-team","description":""}'

POST /api/datachain/rbac/access-groups/

Body parameter

{
  "name": "production-team",
  "description": ""
}

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "description": "string",
  "member_count": 0,
  "created_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
201 Created Created AccessGroupOutput

List Groups

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/rbac/access-groups/", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://example.com/api/datachain/rbac/access-groups/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY'

GET /api/datachain/rbac/access-groups/

Example responses

200 Response

[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "description": "string",
    "member_count": 0,
    "created_at": "2019-08-24T14:15:22Z"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Update Group

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"name\":\"string\",\"description\":\"string\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("PATCH", "/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request PATCH \
  --url https://example.com/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"name":"string","description":"string"}'

PATCH /api/datachain/rbac/access-groups/{group_id}/

Body parameter

{
  "name": "string",
  "description": "string"
}

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "description": "string",
  "member_count": 0,
  "created_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
200 OK OK AccessGroupOutput

Delete Group

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'Authorization': "API_KEY" }

conn.request("DELETE", "/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request DELETE \
  --url https://example.com/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/ \
  --header 'Authorization: API_KEY'

DELETE /api/datachain/rbac/access-groups/{group_id}/

Responses

Status Meaning Description Schema
204 No Content No Content None

List Group Members

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://example.com/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY'

GET /api/datachain/rbac/access-groups/{group_id}/members/

Example responses

200 Response

[
  {
    "user_id": 0,
    "username": "string",
    "email": "string",
    "role": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Add Group Member

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"user_id\":0,\"role\":\"write\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"user_id":0,"role":"write"}'

POST /api/datachain/rbac/access-groups/{group_id}/members/

Body parameter

{
  "user_id": 0,
  "role": "write"
}

Example responses

201 Response

{
  "user_id": 0,
  "username": "string",
  "email": "string",
  "role": "string"
}

Responses

Status Meaning Description Schema
201 Created Created AccessGroupMemberOutput

Update Group Member

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"role\":\"write\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("PATCH", "/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/0/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request PATCH \
  --url https://example.com/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/0/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"role":"write"}'

PATCH /api/datachain/rbac/access-groups/{group_id}/members/{user_id}/

Body parameter

{
  "role": "write"
}

Example responses

200 Response

{
  "user_id": 0,
  "username": "string",
  "email": "string",
  "role": "string"
}

Responses

Status Meaning Description Schema
200 OK OK AccessGroupMemberOutput

Remove Group Member

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'Authorization': "API_KEY" }

conn.request("DELETE", "/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/0/", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request DELETE \
  --url https://example.com/api/datachain/rbac/access-groups/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/0/ \
  --header 'Authorization: API_KEY'

DELETE /api/datachain/rbac/access-groups/{group_id}/members/{user_id}/

Responses

Status Meaning Description Schema
204 No Content No Content None

Create Rule

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"resource_type\":\"namespace\",\"resource_id\":\"string\",\"permission\":\"write\",\"user_id\":0,\"group_id\":\"306db4e0-7449-4501-b76f-075576fe2d8f\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("POST", "/api/datachain/rbac/access-rules/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://example.com/api/datachain/rbac/access-rules/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"resource_type":"namespace","resource_id":"string","permission":"write","user_id":0,"group_id":"306db4e0-7449-4501-b76f-075576fe2d8f"}'

POST /api/datachain/rbac/access-rules/

Body parameter

{
  "resource_type": "namespace",
  "resource_id": "string",
  "permission": "write",
  "user_id": 0,
  "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f"
}

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource_type": "string",
  "resource_uuid": "string",
  "resource_id": 0,
  "resource_name": "string",
  "permission": "string",
  "user_id": 0,
  "user_email": "string",
  "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
  "group_name": "string"
}

Responses

Status Meaning Description Schema
201 Created Created AccessRuleOutput

List Rules

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = {
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("GET", "/api/datachain/rbac/access-rules/", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://example.com/api/datachain/rbac/access-rules/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY'

GET /api/datachain/rbac/access-rules/

Example responses

200 Response

[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "resource_type": "string",
    "resource_uuid": "string",
    "resource_id": 0,
    "resource_name": "string",
    "permission": "string",
    "user_id": 0,
    "user_email": "string",
    "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
    "group_name": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline

Response Schema

Status Code 200

Update Rule

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

payload = "{\"permission\":\"write\"}"

headers = {
    'Content-Type': "application/json",
    'Accept': "application/json",
    'Authorization': "API_KEY"
    }

conn.request("PATCH", "/api/datachain/rbac/access-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request PATCH \
  --url https://example.com/api/datachain/rbac/access-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08/ \
  --header 'Accept: application/json' \
  --header 'Authorization: API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"permission":"write"}'

PATCH /api/datachain/rbac/access-rules/{rule_id}/

Body parameter

{
  "permission": "write"
}

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource_type": "string",
  "resource_uuid": "string",
  "resource_id": 0,
  "resource_name": "string",
  "permission": "string",
  "user_id": 0,
  "user_email": "string",
  "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
  "group_name": "string"
}

Responses

Status Meaning Description Schema
200 OK OK AccessRuleOutput

Delete Rule

Code samples

import http.client

conn = http.client.HTTPSConnection("example.com")

headers = { 'Authorization': "API_KEY" }

conn.request("DELETE", "/api/datachain/rbac/access-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08/", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request DELETE \
  --url https://example.com/api/datachain/rbac/access-rules/497f6eca-6276-4993-bfeb-53cbbbba6f08/ \
  --header 'Authorization: API_KEY'

DELETE /api/datachain/rbac/access-rules/{rule_id}/

Responses

Status Meaning Description Schema
204 No Content No Content None

Schemas

JobOutput

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://studio.datachain.ai/team/team_name/datasets/jobs/0502eef6-a32e-45fa-8e3b-d20ecpabbcf0",
  "status": "CREATED",
  "created_at": "2021-01-01T00:00:00Z",
  "created_by": "username",
  "finished_at": "2021-01-01T00:00:00Z",
  "query": "print('Hello, World!')",
  "query_type": "PYTHON",
  "team": "TeamName",
  "name": "QueryName",
  "workers": 1,
  "python_version": "3.13",
  "requirements": "numpy==1.24.0",
  "repository": "https://github.com/user/repo",
  "environment": {
    "ENV_NAME": "ENV_VALUE"
  },
  "exit_code": 0,
  "error_message": "Error message",
  "error_stack": "",
  "params": {},
  "metrics": {},
  "parent_job_id": "550e8400-e29b-41d4-a716-446655440000",
  "rerun_from_job_id": "550e8400-e29b-41d4-a716-446655440000",
  "run_group_id": "550e8400-e29b-41d4-a716-446655440000"
}

JobInput

{
  "query": "print('Hello, World!')",
  "query_type": "PYTHON",
  "team_name": "TeamName",
  "environment": "ENV_NAME=ENV_VALUE",
  "workers": 1,
  "query_name": "QueryName",
  "rerun_from_job_id": "550e8400-e29b-41d4-a716-446655440000",
  "files": [
    "2",
    "3"
  ],
  "python_version": "3.13",
  "requirements": "numpy==1.24.0",
  "repository": "https://github.com/user/repo",
  "priority": 1,
  "compute_cluster_name": "ComputeClusterName",
  "compute_cluster_id": 1,
  "start_after": "2021-01-01T00:00:00Z",
  "cron_expression": "0 0 * * *",
  "credentials_name": "CredentialsName",
  "reset": false
}

ActionFeedback

{
  "message": "Successfully canceled"
}

JobCancelInput

{
  "team_name": "TeamName"
}

UploadFileOutput

{
  "id": 1,
  "filename": "file.txt",
  "size": 100,
  "state": "pending",
  "error": "Error message"
}

ComputeClusterOutput

{
  "id": 1,
  "name": "ComputeClusterName",
  "status": "ACTIVE",
  "cloud_provider": "AWS",
  "cloud_credentials": "CredentialsName",
  "is_active": true,
  "default": true,
  "max_workers": 1
}

JobPipelineOutput

{
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "status": "RUNNING",
  "job_runs": [
    {
      "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
      "status": "string",
      "parent_job_ids": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ],
      "name": "string",
      "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
    }
  ],
  "completed": 10,
  "total": 16,
  "error_message": "Error message",
  "error_stack": "Error stack",
  "triggered_from": "@amritghimire.project.dataset",
  "name": "rathe-kyat",
  "created_at": "2021-01-01T00:00:00Z",
  "updated_at": "2021-01-01T00:00:00Z",
  "is_definition": false,
  "schedule_name": "schedule_name",
  "python_version": "3.12",
  "requirements": "pandas==2.0.0",
  "repository": "git@github.com:user/repo.git",
  "workers": 4,
  "priority": 5,
  "environment_variables": {
    "TEST_ENV": "1"
  },
  "created_via": "manual"
}

JobPipelineRunOutput

{
  "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
  "status": "string",
  "parent_job_ids": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "name": "string",
  "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
}

PipelineScheduleOutput

{
  "id": 0,
  "schedule_name": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "start_after": "2019-08-24T14:15:22Z",
  "cron_expression": "string",
  "next_run": "2019-08-24T14:15:22Z",
  "latest_run": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  },
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  },
  "created_by": {
    "username": "string",
    "first_name": "string",
    "last_name": "string"
  }
}

PipelineScheduleUpdateOutput

{
  "ok": true,
  "schedule": {
    "id": 0,
    "schedule_name": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "start_after": "2019-08-24T14:15:22Z",
    "cron_expression": "string",
    "next_run": "2019-08-24T14:15:22Z",
    "latest_run": {
      "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
      "status": "RUNNING",
      "job_runs": [
        {
          "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
          "status": "string",
          "parent_job_ids": [
            "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          ],
          "name": "string",
          "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
        }
      ],
      "completed": 10,
      "total": 16,
      "error_message": "Error message",
      "error_stack": "Error stack",
      "triggered_from": "@amritghimire.project.dataset",
      "name": "rathe-kyat",
      "created_at": "2021-01-01T00:00:00Z",
      "updated_at": "2021-01-01T00:00:00Z",
      "is_definition": false,
      "schedule_name": "schedule_name",
      "python_version": "3.12",
      "requirements": "pandas==2.0.0",
      "repository": "git@github.com:user/repo.git",
      "workers": 4,
      "priority": 5,
      "environment_variables": {
        "TEST_ENV": "1"
      },
      "created_via": "manual"
    },
    "pipeline": {
      "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
      "status": "RUNNING",
      "job_runs": [
        {
          "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
          "status": "string",
          "parent_job_ids": [
            "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          ],
          "name": "string",
          "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
        }
      ],
      "completed": 10,
      "total": 16,
      "error_message": "Error message",
      "error_stack": "Error stack",
      "triggered_from": "@amritghimire.project.dataset",
      "name": "rathe-kyat",
      "created_at": "2021-01-01T00:00:00Z",
      "updated_at": "2021-01-01T00:00:00Z",
      "is_definition": false,
      "schedule_name": "schedule_name",
      "python_version": "3.12",
      "requirements": "pandas==2.0.0",
      "repository": "git@github.com:user/repo.git",
      "workers": 4,
      "priority": 5,
      "environment_variables": {
        "TEST_ENV": "1"
      },
      "created_via": "manual"
    },
    "created_by": {
      "username": "string",
      "first_name": "string",
      "last_name": "string"
    }
  }
}

UserOutput

{
  "username": "string",
  "first_name": "string",
  "last_name": "string"
}

CreatePipelineScheduleInput

{
  "schedule_name": "schedule_name",
  "team_name": "team_name",
  "pipeline_id": "pipeline_id",
  "pipeline_name": "rathy-kyat",
  "start_after": "2019-08-24T14:15:22Z",
  "cron_expression": "0 0 * * *"
}

UpdatePipelineScheduleInput

{
  "schedule_name": "schedule_name",
  "team_name": "team_name",
  "schedule_id": 1,
  "start_after": "2019-08-24T14:15:22Z",
  "cron_expression": "0 0 * * *",
  "pause_pipeline": true
}

DeletePipelineScheduleOutput

{
  "ok": true
}

DeletePipelineScheduleInput

{
  "team_name": "team_name",
  "schedule_id": 1
}

PipelineScheduleItem

{
  "id": 0,
  "schedule_name": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "start_after": "2019-08-24T14:15:22Z",
  "cron_expression": "string",
  "next_run": "2019-08-24T14:15:22Z",
  "created_by": {
    "username": "string",
    "first_name": "string",
    "last_name": "string"
  }
}

PipelineOutput

{
  "ok": true,
  "pipeline": {
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "status": "RUNNING",
    "job_runs": [
      {
        "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
        "status": "string",
        "parent_job_ids": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "name": "string",
        "created_job_id": "31f5fe21-b847-420d-8689-ef5a1d3104a4"
      }
    ],
    "completed": 10,
    "total": 16,
    "error_message": "Error message",
    "error_stack": "Error stack",
    "triggered_from": "@amritghimire.project.dataset",
    "name": "rathe-kyat",
    "created_at": "2021-01-01T00:00:00Z",
    "updated_at": "2021-01-01T00:00:00Z",
    "is_definition": false,
    "schedule_name": "schedule_name",
    "python_version": "3.12",
    "requirements": "pandas==2.0.0",
    "repository": "git@github.com:user/repo.git",
    "workers": 4,
    "priority": 5,
    "environment_variables": {
      "TEST_ENV": "1"
    },
    "created_via": "manual"
  }
}

TriggerPipelineInput

{
  "datasets": [
    "@amritghimire.project_name.dataset_name@v1.0.0",
    "@amritghimire.project_name.dataset_name",
    "dataset_name",
    "dataset_name@v1.0.0"
  ],
  "team_name": "team_name"
}

CreatePipelineRunInput

{
  "team_name": "team_name",
  "definition_id": "definition_id"
}

UpdatePipelineSettingsInput

{
  "team_name": "team_name",
  "pipeline_name": "rathy-kyat",
  "python_version": "3.12",
  "requirements": "pandas==2.0.0",
  "repository": "git@github.com:user/repo.git",
  "workers": 4,
  "priority": 5,
  "environment": "TEST_ENV=1",
  "files": [
    "file_id_1",
    "file_id_2"
  ],
  "credentials_names": [
    "cred_name_1"
  ]
}

PipelineInput

{
  "team_name": "team_name",
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "name": "string"
}

RemoveJobFromPipelineInput

{
  "team_name": "team_name",
  "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
  "name": "string",
  "job_id": "job_id"
}

AccessGroupOutput

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "description": "string",
  "member_count": 0,
  "created_at": "2019-08-24T14:15:22Z"
}

AccessGroupInput

{
  "name": "production-team",
  "description": ""
}

AccessGroupUpdateInput

{
  "name": "string",
  "description": "string"
}

AccessGroupMemberOutput

{
  "user_id": 0,
  "username": "string",
  "email": "string",
  "role": "string"
}

AccessGroupMemberInput

{
  "user_id": 0,
  "role": "write"
}

AccessGroupMemberUpdateInput

{
  "role": "write"
}

AccessRuleOutput

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource_type": "string",
  "resource_uuid": "string",
  "resource_id": 0,
  "resource_name": "string",
  "permission": "string",
  "user_id": 0,
  "user_email": "string",
  "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
  "group_name": "string"
}

AccessRuleInput

{
  "resource_type": "namespace",
  "resource_id": "string",
  "permission": "write",
  "user_id": 0,
  "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f"
}

AccessRuleUpdateInput

{
  "permission": "write"
}