Skip to content

On-premise users: click in-app to access the full platform documentation for your version of DataRobot.

Custom Jobs

This page outlines the operations, endpoints, parameters, and example requests and responses for the Custom Jobs.

GET /api/v2/customJobLimits/

Retrieve custom job limits.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobLimits/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Example responses

200 Response

{
  "maxCustomJobRuns": 0,
  "maxCustomJobTimeout": 0
}

Responses

Status Meaning Description Schema
200 OK Custom job limits CustomJobLimitsResponse
403 Forbidden Custom jobs are not enabled. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/customJobs/

List custom jobs.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobs/?offset=0&limit=1000 \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
offset query integer true This many results will be skipped.
limit query integer true At most this many results are returned.
onlyRunning query string false Whether only custom jobs that are currently being run should be returned.
search query string false If supplied, only include custom jobs whose name or description contain this string.
jobType query array[string] false The type of the custom job to filter by.

Enumerated Values

Parameter Value
onlyRunning [false, False, true, True]
jobType [default, hostedCustomMetric, notification, retraining]

Example responses

200 Response

{
  "count": 0,
  "data": [
    {
      "created": "string",
      "description": "string",
      "entryPoint": "string",
      "environmentId": "string",
      "environmentVersionId": "string",
      "id": "string",
      "items": [
        {
          "commitSha": "string",
          "created": "string",
          "fileName": "string",
          "filePath": "string",
          "fileSource": "string",
          "id": "string",
          "ref": "string",
          "repositoryFilePath": "string",
          "repositoryLocation": "string",
          "repositoryName": "string"
        }
      ],
      "jobType": "default",
      "lastRun": "string",
      "name": "string",
      "resources": {
        "egressNetworkPolicy": "none",
        "resourceBundleId": "string"
      },
      "runtimeParameters": [
        {
          "allowEmpty": true,
          "credentialType": "adlsGen2Oauth",
          "currentValue": "string",
          "defaultValue": "string",
          "description": "string",
          "fieldName": "string",
          "maxValue": 0,
          "minValue": 0,
          "overrideValue": "string",
          "type": "boolean"
        }
      ],
      "updated": "string"
    }
  ],
  "next": "http://example.com",
  "previous": "http://example.com",
  "totalCount": 0
}

Responses

Status Meaning Description Schema
200 OK List of custom jobs. CustomJobListResponse
403 Forbidden Custom jobs are not enabled. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

POST /api/v2/customJobs/

Create a custom job.

Code samples

curl -X POST https://app.datarobot.com/api/v2/customJobs/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -d '{CreateCustomJob}'

Body parameter

{
  "description": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "file": "string",
  "filePath": "string",
  "jobType": "default",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameterValues": "string"
}

Parameters

Name In Type Required Description
body body CreateCustomJob false none

Example responses

201 Response

{
  "created": "string",
  "description": "string",
  "entryPoint": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobType": "default",
  "lastRun": "string",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "updated": "string"
}

Responses

Status Meaning Description Schema
201 Created Created. CustomJobResponse
403 Forbidden Custom jobs are not enabled. None
422 Unprocessable Entity Input parameters are invalid. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

POST /api/v2/customJobs/fromGalleryTemplate/

Create a custom job.

Notice: Endpoint is currently in [GA_ALL]. Do not use it in production workflows to reduce risk. See details:

This endpoint depends on the following features that are subject to change.

Feature Flag Maturity Enabled by default Description
CUSTOM_JOBS_TEMPLATE_GALLERY PUBLIC_PREVIEW true Enables template gallery for generic and notification Custom Jobs and updates Custom Hosted Metrics gallery UI

Code samples

curl -X POST https://app.datarobot.com/api/v2/customJobs/fromGalleryTemplate/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -d '{CreateCustomJobFromTemplateGallery}'

Body parameter

{
  "description": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "file": "string",
  "filePath": "string",
  "jobType": "default",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameterValues": "string",
  "templateId": "string"
}

Parameters

Name In Type Required Description
body body CreateCustomJobFromTemplateGallery false none

Example responses

201 Response

{
  "created": "string",
  "description": "string",
  "entryPoint": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobType": "default",
  "lastRun": "string",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "updated": "string"
}

Responses

Status Meaning Description Schema
201 Created Created. CustomJobResponse
403 Forbidden Custom jobs are not enabled. None
422 Unprocessable Entity Input parameters are invalid. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

DELETE /api/v2/customJobs/{customJobId}/

Delete custom job.

Code samples

curl -X DELETE https://app.datarobot.com/api/v2/customJobs/{customJobId}/ \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.

Responses

Status Meaning Description Schema
204 No Content Custom job deleted. None
403 Forbidden Custom jobs are not enabled. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/customJobs/{customJobId}/

Retrieve custom job.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobs/{customJobId}/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.

Example responses

200 Response

{
  "created": "string",
  "description": "string",
  "entryPoint": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobType": "default",
  "lastRun": "string",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "updated": "string"
}

Responses

Status Meaning Description Schema
200 OK Custom job CustomJobResponse
403 Forbidden Custom jobs are not enabled. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

PATCH /api/v2/customJobs/{customJobId}/

Update custom job.

Code samples

curl -X PATCH https://app.datarobot.com/api/v2/customJobs/{customJobId}/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -d '{undefined}'

Body parameter

{
  "description": "string",
  "entryPoint": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "file": "string",
  "filePath": "string",
  "filesToDelete": "string",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameterValues": "string"
}

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
body body UpdateCustomJob false none

Example responses

201 Response

{
  "created": "string",
  "description": "string",
  "entryPoint": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobType": "default",
  "lastRun": "string",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "updated": "string"
}

Responses

Status Meaning Description Schema
201 Created Updated custom job CustomJobResponse
403 Forbidden Custom jobs are not enabled. None
422 Unprocessable Entity Input parameters are invalid. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/customJobs/{customJobId}/items/{itemId}/

Retrieve custom job file content.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobs/{customJobId}/items/{itemId}/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
itemId path string true ID of the file item.

Example responses

200 Response

{
  "content": "string",
  "fileName": "string",
  "filePath": "string",
  "id": "string"
}

Responses

Status Meaning Description Schema
200 OK Custom job file content CustomJobFileResponse
403 Forbidden Custom jobs are not enabled. None
404 Not Found No file found. None
422 Unprocessable Entity File is not utf-8 encoded. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/customJobs/{customJobId}/runs/

List custom job runs.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobs/{customJobId}/runs/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
offset query integer false This many results will be skipped.
limit query integer false At most this many results are returned.
scheduledJobId query string false If supplied, only include custom job runs that are scheduled with this scheduled job id.
customJobId path string true ID of the custom job.

Example responses

200 Response

{
  "count": 0,
  "data": [
    {
      "created": "string",
      "customJobId": "string",
      "description": "string",
      "duration": 0,
      "entryPoint": "string",
      "id": "string",
      "items": [
        {
          "commitSha": "string",
          "created": "string",
          "fileName": "string",
          "filePath": "string",
          "fileSource": "string",
          "id": "string",
          "ref": "string",
          "repositoryFilePath": "string",
          "repositoryLocation": "string",
          "repositoryName": "string"
        }
      ],
      "jobStatusId": "string",
      "resources": {
        "egressNetworkPolicy": "none",
        "resourceBundleId": "string"
      },
      "runtimeParameters": [
        {
          "allowEmpty": true,
          "credentialType": "adlsGen2Oauth",
          "currentValue": "string",
          "defaultValue": "string",
          "description": "string",
          "fieldName": "string",
          "maxValue": 0,
          "minValue": 0,
          "overrideValue": "string",
          "type": "boolean"
        }
      ],
      "status": "succeeded"
    }
  ],
  "next": "http://example.com",
  "previous": "http://example.com",
  "totalCount": 0
}

Responses

Status Meaning Description Schema
200 OK List of custom job runs. CustomJobRunListResponse
403 Forbidden Custom jobs are not enabled. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

POST /api/v2/customJobs/{customJobId}/runs/

Create a custom job run.

Code samples

curl -X POST https://app.datarobot.com/api/v2/customJobs/{customJobId}/runs/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -d '{undefined}'

Body parameter

{
  "description": "string",
  "runtimeParameterValues": [
    {
      "fieldName": "string",
      "type": "boolean",
      "value": "string"
    }
  ]
}

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
body body CreateCustomJobRun false none

Example responses

201 Response

{
  "created": "string",
  "customJobId": "string",
  "description": "string",
  "duration": 0,
  "entryPoint": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobStatusId": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "status": "succeeded"
}

Responses

Status Meaning Description Schema
201 Created Created. CustomJobRunResponse
403 Forbidden Custom jobs are not enabled. None
422 Unprocessable Entity Input parameters are invalid. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

DELETE /api/v2/customJobs/{customJobId}/runs/{customJobRunId}/

Cancel custom job run.

Code samples

curl -X DELETE https://app.datarobot.com/api/v2/customJobs/{customJobId}/runs/{customJobRunId}/ \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
customJobRunId path string true ID of the custom job run.

Responses

Status Meaning Description Schema
204 No Content Custom job run canceled None
403 Forbidden Custom jobs are not enabled. None
422 Unprocessable Entity Input parameters are invalid. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/customJobs/{customJobId}/runs/{customJobRunId}/

Retrieve custom job run.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobs/{customJobId}/runs/{customJobRunId}/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
customJobRunId path string true ID of the custom job run.

Example responses

200 Response

{
  "created": "string",
  "customJobId": "string",
  "description": "string",
  "duration": 0,
  "entryPoint": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobStatusId": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "status": "succeeded"
}

Responses

Status Meaning Description Schema
200 OK Custom job run CustomJobRunResponse
403 Forbidden Custom jobs are not enabled. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

PATCH /api/v2/customJobs/{customJobId}/runs/{customJobRunId}/

Update custom job run.

Code samples

curl -X PATCH https://app.datarobot.com/api/v2/customJobs/{customJobId}/runs/{customJobRunId}/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -d '{undefined}'

Body parameter

{
  "description": "string",
  "runtimeParameterValues": [
    {
      "fieldName": "string",
      "type": "boolean",
      "value": "string"
    }
  ]
}

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
customJobRunId path string true ID of the custom job run.
body body CreateCustomJobRun false none

Example responses

201 Response

{
  "created": "string",
  "customJobId": "string",
  "description": "string",
  "duration": 0,
  "entryPoint": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobStatusId": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "status": "succeeded"
}

Responses

Status Meaning Description Schema
201 Created Updated custom job run CustomJobRunResponse
403 Forbidden Custom jobs are not enabled. None
422 Unprocessable Entity Input parameters are invalid. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/customJobs/{customJobId}/runs/{customJobRunId}/items/{itemId}/

Retrieve custom job run file content.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobs/{customJobId}/runs/{customJobRunId}/items/{itemId}/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
customJobRunId path string true ID of the custom job run.
itemId path string true ID of the file item.

Example responses

200 Response

{
  "content": "string",
  "fileName": "string",
  "filePath": "string",
  "id": "string"
}

Responses

Status Meaning Description Schema
200 OK Custom job run file content CustomJobFileResponse
403 Forbidden Custom jobs are not enabled. None
404 Not Found No file found. None
422 Unprocessable Entity File is not utf-8 encoded. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

DELETE /api/v2/customJobs/{customJobId}/runs/{customJobRunId}/logs/

Delete custom job run logs.

Code samples

curl -X DELETE https://app.datarobot.com/api/v2/customJobs/{customJobId}/runs/{customJobRunId}/logs/ \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
customJobRunId path string true ID of the custom job run.

Responses

Status Meaning Description Schema
204 No Content Custom job run logs deleted. None
404 Not Found No log found. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/customJobs/{customJobId}/runs/{customJobRunId}/logs/

Retrieve custom job run logs.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobs/{customJobId}/runs/{customJobRunId}/logs/ \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
customJobRunId path string true ID of the custom job run.

Responses

Status Meaning Description Schema
200 OK The log file download. None
404 Not Found No log found. None

Response Headers

Status Header Type Format Description
200 Content-Disposition string Contains an auto generated filename for this download ("attachment;filename=custom-job-run--.log").

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/customJobs/{customJobId}/sharedRoles/

Get a list of users, groups and organizations who have access to this custom job and their roles on the custom job.

Code samples

curl -X GET https://app.datarobot.com/api/v2/customJobs/{customJobId}/sharedRoles/?offset=0&limit=10 \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
id query string false Only return roles for a user, group or organization with this identifier.
offset query integer true This many results will be skipped
limit query integer true At most this many results are returned
name query string false Only return roles for a user, group or organization with this name.
shareRecipientType query string false List access controls for recipients with this type.
customJobId path string true ID of the custom job.

Enumerated Values

Parameter Value
shareRecipientType [user, group, organization]

Example responses

200 Response

{
  "count": 0,
  "data": [
    {
      "id": "string",
      "name": "string",
      "role": "ADMIN",
      "shareRecipientType": "user"
    }
  ],
  "next": "string",
  "previous": "string",
  "totalCount": 0
}

Responses

Status Meaning Description Schema
200 OK The Custom Job's access control list. SharingListV2Response
404 Not Found Either the Custom Job does not exist or the user does not have permissions to view the Custom Job. None
422 Unprocessable Entity Both username and userId were specified None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

PATCH /api/v2/customJobs/{customJobId}/sharedRoles/

Set roles for users on this custom job.

Code samples

curl -X PATCH https://app.datarobot.com/api/v2/customJobs/{customJobId}/sharedRoles/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -d '{undefined}'

Body parameter

{
  "operation": "updateRoles",
  "roles": [
    {
      "role": "string",
      "shareRecipientType": "user",
      "username": "string"
    }
  ]
}

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.
body body SharedRolesUpdate false none

Responses

Status Meaning Description Schema
204 No Content Roles updated successfully. None
409 Conflict The request would leave the custom job without an owner. None
422 Unprocessable Entity One of the users in the request does not exist, or the request is otherwise invalid None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

POST /api/v2/customJobsCleanup/{customJobId}/

Permanently delete custom job.

Code samples

curl -X POST https://app.datarobot.com/api/v2/customJobsCleanup/{customJobId}/ \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
customJobId path string true ID of the custom job.

Responses

Status Meaning Description Schema
204 No Content Custom job permanently deleted. None
401 Unauthorized Permadelete not enabled or user not permitted to permadelete. None
403 Forbidden Custom jobs are not enabled. None
409 Conflict At least one of the custom job componenets are not soft-deleted, therefore can not permanently delete. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/deletedCustomJobs/

List deleted custom jobs.

Code samples

curl -X GET https://app.datarobot.com/api/v2/deletedCustomJobs/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
offset query integer false This many results will be skipped.
limit query integer false At most this many results are returned.

Example responses

200 Response

{
  "count": 0,
  "data": [
    {
      "created": "string",
      "description": "string",
      "entryPoint": "string",
      "environmentId": "string",
      "environmentVersionId": "string",
      "id": "string",
      "items": [
        {
          "commitSha": "string",
          "created": "string",
          "fileName": "string",
          "filePath": "string",
          "fileSource": "string",
          "id": "string",
          "ref": "string",
          "repositoryFilePath": "string",
          "repositoryLocation": "string",
          "repositoryName": "string"
        }
      ],
      "jobType": "default",
      "lastRun": "string",
      "name": "string",
      "resources": {
        "egressNetworkPolicy": "none",
        "resourceBundleId": "string"
      },
      "runtimeParameters": [
        {
          "allowEmpty": true,
          "credentialType": "adlsGen2Oauth",
          "currentValue": "string",
          "defaultValue": "string",
          "description": "string",
          "fieldName": "string",
          "maxValue": 0,
          "minValue": 0,
          "overrideValue": "string",
          "type": "boolean"
        }
      ],
      "updated": "string"
    }
  ],
  "next": "http://example.com",
  "previous": "http://example.com",
  "totalCount": 0
}

Responses

Status Meaning Description Schema
200 OK List of deleted custom jobs. CustomJobListResponse
403 Forbidden Custom jobs are not enabled. None

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

Schemas

AccessControlV2

{
  "id": "string",
  "name": "string",
  "role": "ADMIN",
  "shareRecipientType": "user"
}

Properties

Name Type Required Restrictions Description
id string true The identifier of the recipient.
name string true The name of the recipient.
role string true The role of the recipient on this entity.
shareRecipientType string true The type of the recipient.

Enumerated Values

Property Value
role [ADMIN, CONSUMER, DATA_SCIENTIST, EDITOR, OBSERVER, OWNER, READ_ONLY, READ_WRITE, USER]
shareRecipientType [user, group, organization]

CreateCustomJob

{
  "description": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "file": "string",
  "filePath": "string",
  "jobType": "default",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameterValues": "string"
}

Properties

Name Type Required Restrictions Description
description string false maxLength: 10000
The description of the custom job.
environmentId string false The ID of the execution environment to use for this custom job.
environmentVersionId string false The ID of the execution environment version to use for this custom job. If not provided, the latest execution environment version will be used.
file string(binary) false A file with code for a custom task or a custom model. For each file supplied as form data, you must have a corresponding filePath supplied that shows the relative location of the file. For example, you have two files: /home/username/custom-task/main.py and /home/username/custom-task/helpers/helper.py. When uploading these files, you would also need to include two filePath fields of, "main.py" and "helpers/helper.py". If the supplied file already exists at the supplied filePath, the old file is replaced by the new file.
filePath any false The local path of the file being uploaded. See the file field explanation for more details.

oneOf

Name Type Required Restrictions Description
» anonymous string false none

xor

Name Type Required Restrictions Description
» anonymous [string] false maxItems: 1000
none

continued

Name Type Required Restrictions Description
jobType string false Type of the custom job.
name string true maxLength: 255
Name of the custom job.
resources CustomJobResources false The custom job resources that will be applied in the k8s cluster.
runtimeParameterValues string false Ability to inject values into a custom job at runtime. The fieldName must match a fieldName that is listed in the runtimeParameterDefinitions section of the metadata.yaml file. This list will be merged with any existing runtime values set from the prior version when issuing a PATCH request so it is possible to specify a null value to unset specific parameters and fall back to the defaultValue from the definition.

Enumerated Values

Property Value
jobType [default, hostedCustomMetric, notification, retraining]

CreateCustomJobFromTemplateGallery

{
  "description": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "file": "string",
  "filePath": "string",
  "jobType": "default",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameterValues": "string",
  "templateId": "string"
}

Properties

Name Type Required Restrictions Description
description string false maxLength: 10000
The description of the custom job.
environmentId string false The ID of the execution environment to use for this custom job.
environmentVersionId string false The ID of the execution environment version to use for this custom job. If not provided, the latest execution environment version will be used.
file string(binary) false A file with code for a custom task or a custom model. For each file supplied as form data, you must have a corresponding filePath supplied that shows the relative location of the file. For example, you have two files: /home/username/custom-task/main.py and /home/username/custom-task/helpers/helper.py. When uploading these files, you would also need to include two filePath fields of, "main.py" and "helpers/helper.py". If the supplied file already exists at the supplied filePath, the old file is replaced by the new file.
filePath any false The local path of the file being uploaded. See the file field explanation for more details.

oneOf

Name Type Required Restrictions Description
» anonymous string false none

xor

Name Type Required Restrictions Description
» anonymous [string] false maxItems: 1000
none

continued

Name Type Required Restrictions Description
jobType string false Type of the custom job.
resources CustomJobResources false The custom job resources that will be applied in the k8s cluster.
runtimeParameterValues string false Ability to inject values into a custom job at runtime. The fieldName must match a fieldName that is listed in the runtimeParameterDefinitions section of the metadata.yaml file. This list will be merged with any existing runtime values set from the prior version when issuing a PATCH request so it is possible to specify a null value to unset specific parameters and fall back to the defaultValue from the definition.
templateId string true Custom Job Template ID.

Enumerated Values

Property Value
jobType [default, hostedCustomMetric, notification, retraining]

CreateCustomJobRun

{
  "description": "string",
  "runtimeParameterValues": [
    {
      "fieldName": "string",
      "type": "boolean",
      "value": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
description string false maxLength: 10000
The description of the custom job run.
runtimeParameterValues [RuntimeParameterValue] false maxItems: 100
Ability to inject values at runtime. The fieldName must match a fieldName that is listed in the runtimeParameterDefinitions section of the custom job metadata.yaml file. It has a priority over an existing runtime parameter overrides defined at the custom job level.

CustomJobFileResponse

{
  "content": "string",
  "fileName": "string",
  "filePath": "string",
  "id": "string"
}

Properties

Name Type Required Restrictions Description
content string true Content of the chosen file.
fileName string true Name of the chosen file.
filePath string true Path of the chosen file.
id string true The ID of the custom job.

CustomJobLimitsResponse

{
  "maxCustomJobRuns": 0,
  "maxCustomJobTimeout": 0
}

Properties

Name Type Required Restrictions Description
maxCustomJobRuns integer true Number of custom jobs allowed to run in parallel.
maxCustomJobTimeout integer true Execution time limit for the custom job in seconds.

CustomJobListResponse

{
  "count": 0,
  "data": [
    {
      "created": "string",
      "description": "string",
      "entryPoint": "string",
      "environmentId": "string",
      "environmentVersionId": "string",
      "id": "string",
      "items": [
        {
          "commitSha": "string",
          "created": "string",
          "fileName": "string",
          "filePath": "string",
          "fileSource": "string",
          "id": "string",
          "ref": "string",
          "repositoryFilePath": "string",
          "repositoryLocation": "string",
          "repositoryName": "string"
        }
      ],
      "jobType": "default",
      "lastRun": "string",
      "name": "string",
      "resources": {
        "egressNetworkPolicy": "none",
        "resourceBundleId": "string"
      },
      "runtimeParameters": [
        {
          "allowEmpty": true,
          "credentialType": "adlsGen2Oauth",
          "currentValue": "string",
          "defaultValue": "string",
          "description": "string",
          "fieldName": "string",
          "maxValue": 0,
          "minValue": 0,
          "overrideValue": "string",
          "type": "boolean"
        }
      ],
      "updated": "string"
    }
  ],
  "next": "http://example.com",
  "previous": "http://example.com",
  "totalCount": 0
}

Properties

Name Type Required Restrictions Description
count integer false Number of items returned on this page.
data [CustomJobResponse] true maxItems: 1000
List of custom jobs.
next string,null(uri) true URL pointing to the next page (if null, there is no next page).
previous string,null(uri) true URL pointing to the previous page (if null, there is no previous page).
totalCount integer true The total number of items across all pages.

CustomJobResources

{
  "egressNetworkPolicy": "none",
  "resourceBundleId": "string"
}

The custom job resources that will be applied in the k8s cluster.

Properties

Name Type Required Restrictions Description
egressNetworkPolicy string true Egress network policy.
resourceBundleId string,null false A single identifier that represents a bundle of resources: Memory, CPU, GPU, etc. A list of available bundles can be obtained via the resource bundles endpoint.

Enumerated Values

Property Value
egressNetworkPolicy [none, public]

CustomJobResponse

{
  "created": "string",
  "description": "string",
  "entryPoint": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobType": "default",
  "lastRun": "string",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "updated": "string"
}

Properties

Name Type Required Restrictions Description
created string true ISO-8601 timestamp of when the custom job was created.
description string false maxLength: 10000
The description of the custom job.
entryPoint string,null false The ID of the entry point file to use.
environmentId string,null true The ID of the execution environment used for this custom job.
environmentVersionId string,null true The ID of the execution environment version used for this custom job.
id string true The ID of the custom job.
items [WorkspaceItemResponse] true maxItems: 1000
List of file items.
jobType string true Type of the custom job.
lastRun string,null true The last custom job run.
name string true The name of the custom job.
resources CustomJobResources true The custom job resources that will be applied in the k8s cluster.
runtimeParameters [RuntimeParameterUnified] false maxItems: 100
Unified view of the defined runtime parameters for this custom job along with any values that are currently set that override the default value from their definition.
updated string true ISO-8601 timestamp of when custom job was last updated.

Enumerated Values

Property Value
jobType [default, hostedCustomMetric, notification, retraining]

CustomJobRunListResponse

{
  "count": 0,
  "data": [
    {
      "created": "string",
      "customJobId": "string",
      "description": "string",
      "duration": 0,
      "entryPoint": "string",
      "id": "string",
      "items": [
        {
          "commitSha": "string",
          "created": "string",
          "fileName": "string",
          "filePath": "string",
          "fileSource": "string",
          "id": "string",
          "ref": "string",
          "repositoryFilePath": "string",
          "repositoryLocation": "string",
          "repositoryName": "string"
        }
      ],
      "jobStatusId": "string",
      "resources": {
        "egressNetworkPolicy": "none",
        "resourceBundleId": "string"
      },
      "runtimeParameters": [
        {
          "allowEmpty": true,
          "credentialType": "adlsGen2Oauth",
          "currentValue": "string",
          "defaultValue": "string",
          "description": "string",
          "fieldName": "string",
          "maxValue": 0,
          "minValue": 0,
          "overrideValue": "string",
          "type": "boolean"
        }
      ],
      "status": "succeeded"
    }
  ],
  "next": "http://example.com",
  "previous": "http://example.com",
  "totalCount": 0
}

Properties

Name Type Required Restrictions Description
count integer false Number of items returned on this page.
data [CustomJobRunResponse] true maxItems: 1000
List of custom job runs.
next string,null(uri) true URL pointing to the next page (if null, there is no next page).
previous string,null(uri) true URL pointing to the previous page (if null, there is no previous page).
totalCount integer true The total number of items across all pages.

CustomJobRunResponse

{
  "created": "string",
  "customJobId": "string",
  "description": "string",
  "duration": 0,
  "entryPoint": "string",
  "id": "string",
  "items": [
    {
      "commitSha": "string",
      "created": "string",
      "fileName": "string",
      "filePath": "string",
      "fileSource": "string",
      "id": "string",
      "ref": "string",
      "repositoryFilePath": "string",
      "repositoryLocation": "string",
      "repositoryName": "string"
    }
  ],
  "jobStatusId": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameters": [
    {
      "allowEmpty": true,
      "credentialType": "adlsGen2Oauth",
      "currentValue": "string",
      "defaultValue": "string",
      "description": "string",
      "fieldName": "string",
      "maxValue": 0,
      "minValue": 0,
      "overrideValue": "string",
      "type": "boolean"
    }
  ],
  "status": "succeeded"
}

Properties

Name Type Required Restrictions Description
created string true ISO-8601 timestamp of when the model was created.
customJobId string true The ID of the custom job.
description string false maxLength: 10000
The description of the custom job run.
duration number true Duration of the custom test run is seconds.
entryPoint string false The entry point file item ID in the custom job's workspace.
id string true The ID of the custom job.
items [WorkspaceItemResponse] true maxItems: 1000
List of file items.
jobStatusId string,null true ID to track the custom job run execution status.
resources CustomJobResources true The custom job resources that will be applied in the k8s cluster.
runtimeParameters [RuntimeParameterUnified] false maxItems: 100
Unified view of the defined runtime parameters for this custom job along with any values that are currently set that override the default value from their definition.
status string true The status of the custom job run.

Enumerated Values

Property Value
status [succeeded, failed, running, interrupted, canceling, canceled]

GrantAccessControlWithId

{
  "id": "string",
  "role": "string",
  "shareRecipientType": "user"
}

Properties

Name Type Required Restrictions Description
id string true The ID of the recipient.
role string true The role of the recipient on this entity. One of OWNER, USER, OBSERVER.
shareRecipientType string true Describes the recipient type, either user, group, or organization.

Enumerated Values

Property Value
shareRecipientType [user, group, organization]

GrantAccessControlWithUsername

{
  "role": "string",
  "shareRecipientType": "user",
  "username": "string"
}

Properties

Name Type Required Restrictions Description
role string true The role of the recipient on this entity. One of OWNER, USER, OBSERVER.
shareRecipientType string true Describes the recipient type, either user, group, or organization.
username string true Username of the user to update the access role for.

Enumerated Values

Property Value
shareRecipientType [user, group, organization]

RuntimeParameterUnified

{
  "allowEmpty": true,
  "credentialType": "adlsGen2Oauth",
  "currentValue": "string",
  "defaultValue": "string",
  "description": "string",
  "fieldName": "string",
  "maxValue": 0,
  "minValue": 0,
  "overrideValue": "string",
  "type": "boolean"
}

Properties

Name Type Required Restrictions Description
allowEmpty boolean false Indicates whether the param must be set before registration
credentialType string,null false The type of credential, required only for credentials parameters.
currentValue any false Given the default and the override, this is the actual current value of the parameter.

anyOf

Name Type Required Restrictions Description
» anonymous string false none

or

Name Type Required Restrictions Description
» anonymous number false none

or

Name Type Required Restrictions Description
» anonymous boolean false none

continued

Name Type Required Restrictions Description
defaultValue any false The default value for the given field.

anyOf

Name Type Required Restrictions Description
» anonymous string false none

or

Name Type Required Restrictions Description
» anonymous number false none

or

Name Type Required Restrictions Description
» anonymous boolean false none

continued

Name Type Required Restrictions Description
description string,null false Description how this parameter impacts the running model.
fieldName string true The parameter name. This value will be added as an environment variable when running custom models.
maxValue number,null false The maximum value for a numeric field.
minValue number,null false The minimum value for a numeric field.
overrideValue any false Value set by the user that overrides the default set in the definition.

anyOf

Name Type Required Restrictions Description
» anonymous string false none

or

Name Type Required Restrictions Description
» anonymous number false none

or

Name Type Required Restrictions Description
» anonymous boolean false none

continued

Name Type Required Restrictions Description
type string true The type of this value.

Enumerated Values

Property Value
credentialType [adlsGen2Oauth, apiToken, azure, azureServicePrincipal, basic, bearer, databricksAccessTokenAccount, databricksServicePrincipalAccount, gcp, oauth, rsa, s3, sapOauth, snowflakeKeyPairUserAccount, snowflakeOauthUserAccount, tableauAccessToken]
type [boolean, credential, customMetric, deployment, modelPackage, numeric, string]

RuntimeParameterValue

{
  "fieldName": "string",
  "type": "boolean",
  "value": "string"
}

Properties

Name Type Required Restrictions Description
fieldName string true The required field name. This value will be added as an environment variable when running custom models.
type string true The type of this value.
value any true The string, boolean or numeric value for the given field.

anyOf

Name Type Required Restrictions Description
» anonymous string,null false maxLength: 4096
The value for the given field.

or

Name Type Required Restrictions Description
» anonymous boolean false The boolean value for the field (default False)

or

Name Type Required Restrictions Description
» anonymous number,null false The numeric value for the field

Enumerated Values

Property Value
type [boolean, credential, customMetric, deployment, modelPackage, numeric, string]

SharedRolesUpdate

{
  "operation": "updateRoles",
  "roles": [
    {
      "role": "string",
      "shareRecipientType": "user",
      "username": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
operation string true Name of the action being taken. The only operation is 'updateRoles'.
roles [oneOf] true maxItems: 100
minItems: 1
Array of GrantAccessControl objects., up to maximum 100 objects.

oneOf

Name Type Required Restrictions Description
» anonymous GrantAccessControlWithUsername false none

xor

Name Type Required Restrictions Description
» anonymous GrantAccessControlWithId false none

Enumerated Values

Property Value
operation updateRoles

SharingListV2Response

{
  "count": 0,
  "data": [
    {
      "id": "string",
      "name": "string",
      "role": "ADMIN",
      "shareRecipientType": "user"
    }
  ],
  "next": "string",
  "previous": "string",
  "totalCount": 0
}

Properties

Name Type Required Restrictions Description
count integer true The number of items returned.
data [AccessControlV2] true maxItems: 1000
The access control list.
next string,null true URL pointing to the next page.
previous string,null true URL pointing to the previous page.
totalCount integer true Total number of items matching the condition.

UpdateCustomJob

{
  "description": "string",
  "entryPoint": "string",
  "environmentId": "string",
  "environmentVersionId": "string",
  "file": "string",
  "filePath": "string",
  "filesToDelete": "string",
  "name": "string",
  "resources": {
    "egressNetworkPolicy": "none",
    "resourceBundleId": "string"
  },
  "runtimeParameterValues": "string"
}

Properties

Name Type Required Restrictions Description
description string false maxLength: 10000
The description of the custom job.
entryPoint string false The ID of the entry point file to use.
environmentId string false The ID of the execution environment to use for this custom job.
environmentVersionId string false The ID of the execution environment version to use for this custom job. If not provided, the latest execution environment version will be used.
file string(binary) false A file with code for a custom task or a custom model. For each file supplied as form data, you must have a corresponding filePath supplied that shows the relative location of the file. For example, you have two files: /home/username/custom-task/main.py and /home/username/custom-task/helpers/helper.py. When uploading these files, you would also need to include two filePath fields of, "main.py" and "helpers/helper.py". If the supplied file already exists at the supplied filePath, the old file is replaced by the new file.
filePath any false The local path of the file being uploaded. See the file field explanation for more details.

oneOf

Name Type Required Restrictions Description
» anonymous string false none

xor

Name Type Required Restrictions Description
» anonymous [string] false maxItems: 1000
none

continued

Name Type Required Restrictions Description
filesToDelete any false The IDs of the files to be deleted.

oneOf

Name Type Required Restrictions Description
» anonymous string false none

xor

Name Type Required Restrictions Description
» anonymous [string] false maxItems: 100
none

continued

Name Type Required Restrictions Description
name string false maxLength: 255
Name of the custom job.
resources CustomJobResources false The custom job resources that will be applied in the k8s cluster.
runtimeParameterValues string false Ability to inject values into a custom job at runtime. The fieldName must match a fieldName that is listed in the runtimeParameterDefinitions section of the metadata.yaml file. This list will be merged with any existing runtime values set from the prior version when issuing a PATCH request so it is possible to specify a null value to unset specific parameters and fall back to the defaultValue from the definition.

WorkspaceItemResponse

{
  "commitSha": "string",
  "created": "string",
  "fileName": "string",
  "filePath": "string",
  "fileSource": "string",
  "id": "string",
  "ref": "string",
  "repositoryFilePath": "string",
  "repositoryLocation": "string",
  "repositoryName": "string"
}

Properties

Name Type Required Restrictions Description
commitSha string,null false SHA1 hash pointing to the original file revision (set only for files pulled from Git-like repositories).
created string true ISO-8601 timestamp of when the file item was created.
fileName string true Name of the file item.
filePath string true Path of the file item.
fileSource string true Source of the file item.
id string true ID of the file item.
ref string,null false Remote reference (branch, commit, tag). Branch "master", if not specified.
repositoryFilePath string,null false Full path to the file in the remote repository.
repositoryLocation string,null false URL to remote repository from which the file was pulled (e.g. Git server or S3 Bucket name).
repositoryName string,null false Name of the repository from which the file was pulled.

Updated March 25, 2025