client.scripts.list_custom

A method of the Scripts endpoint.

list_custom(*, from_template_id: str = None, author: str = None, status: str = None, hidden: bool = None, archived: str = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) ListResponse | PaginatedResponse

List Custom Scripts

API URL: GET /scripts/custom

import civis
client = civis.APIClient()
response = client.scripts.list_custom(...)
Parameters:
from_template_idstr, optional

If specified, return scripts based on the template with this ID. Specify multiple IDs as a comma-separated list.

authorstr, optional

If specified, return items from any of these authors. It accepts a comma- separated list of user IDs.

statusstr, optional

If specified, returns items with one of these statuses. It accepts a comma- separated list, possible values are ‘running’, ‘failed’, ‘succeeded’, ‘idle’, ‘scheduled’.

hiddenbool, optional

If specified to be true, returns hidden items. Defaults to false, returning non-hidden items.

archivedstr, optional

The archival status of the items to return. One of: true, false, all. A blank value is read as ‘false’, which is also the default.

limitint, optional

Number of results to return. Defaults to its maximum of 50.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to updated_at. Must be one of: updated_at, name, created_at.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.

iteratorbool, optional

If True, return a generator (specifically, a civis.PaginatedResponse object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a civis.ListResponse object (= a list of civis.Response objects), whose size is determined by ‘limit’. Defaults to False.

Returns:
civis.ListResponse | civis.PaginatedResponse
  • idint

    The ID for the script.

  • namestr

    The name of the script.

  • typestr

    The type of the script (e.g Custom)

  • backing_script_typestr

    The type of the script backing this template (e.g Python)

  • created_atstr (time)

    The time this script was created.

  • updated_atstr (time)

    The time the script was last updated.

  • authorcivis.Response
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • statestr

    The state of the last run. One of idle, pending, scheduled, queued, running, succeeded, failed or cancelled.

  • finished_atstr (time)

    The time that the script’s last run finished.

  • projectsList[civis.Response]

    A list of projects containing the script.

    • idint

      The ID for the project.

    • namestr

      The name of the project.

  • parent_idint

    The ID of the parent job that will trigger this script

  • from_template_idint

    The ID of the template script.

  • time_zonestr

    The time zone of this script.

  • last_runcivis.Response
    • id : int

    • statestr

      The state of the run. One of queued, running, succeeded, failed or cancelled.

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • archivedbool

    The archival status of the requested item(s).

  • last_successful_runcivis.Response
    • id : int

    • statestr

      The state of the run. One of queued, running, succeeded, failed or cancelled.

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.