Civis API Python Client

The Civis Platform API Python client is a Python package that helps analysts and developers interact with the Civis Platform. The package includes a set of tools around common workflows as well as a convenient interface to make requests directly to the Civis API.

API Keys

In order to make requests to the Civis API, you will need a Civis Platform API key that is unique to you. Instructions for creating a new key are found here. API keys have a set expiration date and new keys will need to be created at least every 30 days. The API client will look for a CIVIS_API_KEY environmental variable to access your API key, so after creating a new API key, follow the steps below for your operating system to set up your environment.

Linux / MacOS

  1. Add the following to your shell configuration file (~/.zshrc for MacOS or ~/.bashrc for Linux, by default):

    export CIVIS_API_KEY="alphaNumericApiK3y"
    
  2. Source your shell configuration file (or restart your terminal).

Windows 10

  1. Navigate to “Settings” -> type “environment” in search bar -> “Edit environment variables for your account”. This can also be found in “System Properties” -> “Advanced” -> “Environment Variables…”.

  2. In the user variables section, if CIVIS_API_KEY already exists in the list of environment variables, click on it and press “Edit…”. Otherwise, click “New..”.

  3. Enter CIVIS_API_KEY as the “Variable name”.

  4. Enter your API key as the “Variable value”. Your API key should look like a long string of letters and numbers.

Installation

After creating an API key and setting the CIVIS_API_KEY environmental variable, install the Python package civis with the recommended method via pip:

pip install civis

Alternatively, if you are interested in the latest functionality not yet released through pip, you may clone the code from GitHub and build from source:

git clone https://github.com/civisanalytics/civis-python.git
cd civis-python
python setup.py install

You can test your installation by running

import civis
client = civis.APIClient()
print(client.users.list_me()['username'])

If civis was installed correctly, this will print your Civis Platform username.

The client has a soft dependency on pandas to support features such as data type parsing. If you are using the io namespace to read or write data from Civis, it is highly recommended that you install pandas and set use_pandas=True in functions that accept that parameter. To install pandas:

pip install pandas

Machine learning features in the ml namespace have a soft dependency on scikit-learn and pandas. Install scikit-learn to export your trained models from the Civis Platform or to provide your own custom models. Use pandas to download model predictions from the Civis Platform. The civis.ml code optionally uses the feather format to transfer data from your local computer to Civis Platform. Install these dependencies with

pip install scikit-learn
pip install pandas
pip install feather-format

Some CivisML models have open-source dependencies in addition to scikit-learn, which you may need if you want to download the model object. These dependencies are civisml-extensions, glmnet, and muffnn. Install these dependencies with

pip install civisml-extensions
pip install glmnet
pip install muffnn

User Guide

For a more detailed walkthrough, see the User Guide.

Retries

The API client will automatically retry for certain API error responses.

If the error is one of [413, 429, 503] and the API client is told how long it needs to wait before it’s safe to retry (this is always the case with 429s, which are rate limit errors), then the client will wait the specified amount of time before retrying the request.

If the error is one of [429, 502, 503, 504] and the request is not a patch* or post* method, then the API client will retry the request several times, with an exponential delay, to see if it will succeed. If the request is of type post* it will retry with the same parameters for error codes [429, 503].

Client API Reference

User Guide

Getting Started

After installing the Civis API Python client and setting up your API key, you can now import the package civis:

>>> import civis

There are two entrypoints for working with the Civis API. The first is the civis namespace, which contains tools for typical workflows in a user friendly manner. For example, you may want to perform some transformation on your data in Python that might be tricky to code in SQL. This code downloads data from Civis, calculates the correlation between all the columns and then uploads the data back into Civis:

>>> df = civis.io.read_civis(table="my_schema.my_table",
...                          database="database",
...                          use_pandas=True)
>>> correlation_matrix = df.corr()
>>> correlation_matrix["corr_var"] = correlation_matrix.index
>>> fut = civis.io.dataframe_to_civis(df=correlation_matrix,
...                                   database="database",
...                                   table="my_schema.my_correlations")
>>> fut.result()

Civis Futures

In the code above, dataframe_to_civis() returns a special CivisFuture object. Making a request to the Civis API usually results in a long running job. To account for this, various functions in the civis namespace return a CivisFuture to allow you to process multiple long running jobs simultaneously. For instance, you may want to start many jobs in parallel and wait for them all to finish rather than wait for each job to finish before starting the next one.

The CivisFuture follows the concurrent.futures.Future API fairly closely. For example, calling result() on fut above forces the program to wait for the job started with dataframe_to_civis() to finish and returns the result or raises an exception.

You can create CivisFuture objects for many tasks (e.g., scripts, imports). Here, we will create a container script that does the simple task of printing the text “HELLO WORLD”, execute it, and then wait for it to finish.

>>> import civis
>>> import concurrent.futures
>>>
>>> client = civis.APIClient()
>>>
>>> # Create a container script. This is just a simple example. Futures can
>>> # also be used with SQL queries, imports, etc.
>>> response_script = client.scripts.post_containers(
...     required_resources={'cpu': 512, 'memory': 1024},
...     docker_command="echo 'HELLO WORLD'",
...     docker_image_name='civisanalytics/datascience-python')
>>> script_id = response_script.id
>>>
>>> # Create a run in order to execute the script.
>>> response_run = client.scripts.post_containers_runs(script_id)
>>> run_id = response_run.id
>>>
>>> # Create a future to represent the result of the run.
>>> future = civis.futures.CivisFuture(
...     client.scripts.get_containers_runs, (script_id, run_id))
>>>
>>> # You can then have your code block and wait for the future to be done as
>>> # follows. Note that this does not raise an exception on error like
>>> # `future.result()`.
>>> concurrent.futures.wait([future])
>>>
>>> # Alternatively, you can call `future.result()` to block and get the
>>> # status of the run once it finishes. If the run is already completed, the
>>> # result will be returned immediately.
>>> result = future.result()
>>>
>>> # Alternatively, one can start a run and get a future for it with the helper
>>> # function `civis.utils.run_job`:
>>> future2 = civis.utils.run_job(script_id)
>>> future2.result()

Working Directly with the Client

Although many common workflows are included in the Civis API Python client, projects often require direct calls to the Civis API. For convenience, the Civis API Python client implements an APIClient object to make these API calls with Python syntax rather than a manually crafted HTTP request. To make a call, first instantiate an APIClient object:

>>> client = civis.APIClient()

Note

Creating an instance of APIClient makes an HTTP request to determine the functions to attach to the object. You must have an API key and internet connection to create an APIClient object.

With the client object instantiated, you can now make API requests like listing your user information:

>>> client.users.list_me()
{'email': 'user@email.com',
 'feature_flags': {'left_nav_basic': True,
                   'results': True,
                   'scripts_notify': True,
                   'table_person_matching': True},
 'id': 1,
 'initials': 'UN',
 'name': 'User Name',
 'username': 'uname'}

For a complete list of the API endpoints and their methods, check out API Resources.

Suppose we did not have the civis.io namespace. This is how we might export a CSV file from Civis. As you will see, this can be quite involved and the civis namespace entrypoint should be preferred whenever possible.

First, we get the ID for our database then we get the default credential for the current user.

>>> db_id = client.get_database_id('cluster-name')
>>> cred_id = client.default_credential

In order to export a table, we need to write some SQL that will generate the data to export. Then we create the export job and run it.

>>> generate_table = "select * from schema.tablename"
>>> export_job = client.scripts.post_sql(name="our export job",
                                         remote_host_id=db_id,
                                         credential_id=cred_id,
                                         sql=generate_table)
>>> export_run = client.scripts.post_sql_runs(export_job.id)

We can then poll and wait for the export to be completed.

>>> import time
>>> export_state = client.scripts.get_sql_runs(export_job.id,
...                                            export_run.id)
>>> while export_state.state in ['queued', 'running']:
...    time.sleep(60)
...    export_state = client.scripts.get_sql_runs(export_job.id,
...                                               export_run.id)

Now, we can get the URL of the exported csv. First, we grab the result of our export job.

>>> export_result = client.scripts.get_sql_runs(export_job.id,
...                                             export_run.id)

In the future, a script may export multiple jobs, so the output of this is a list.

The path returned will have a gzipped csv file, which we could load, for example, with pandas.

>>> url = export_result.output[0].path

API Response Types and Functions

Many API requests via an APIClient instance return an iterable of civis.response.Response objects. For endpoints that support pagination when the iterator kwarg is specified, a civis.response.PaginatedResponse object is returned. To facilitate working with civis.response.Response objects, the helper functions civis.find() and civis.find_one() are defined.

Testing Your Code

Once you’ve written code that uses APIClient, you’ve got to test it. Because you want a testing environment not dependent upon an API key or an internet connection, you will employ the mocking technique.

To this end, civis.tests.create_client_mock() will create a mock object that looks like an API client object. This mock object is configured to error if any method calls have non-existent / misspelled parameters.

Suppose this function is in your code:

def get_timestamps_from_table(..., client=None, ...):
    ...
    client = client if not client else civis.APIClient()
    ...
    df = civis.io.read_civis_sql(
        ...,
        client=client,
        ...,
    )
    ...
    return ...

Whatever function you define, it needs to have a client argument. If it’s not provided, an actual API client object will be created. Throughout this function, the client object has to be used to interact with the Civis API. It is through this argument that you as a developer can pass in a custom API client object.

When you’re testing your functions in your test suite, you might have code like this:

from civis.tests import create_client_mock

from <your-package> import get_timestamps_from_table

def test_get_timestamps_from_table():
    mock_client = create_client_mock()

    mock_client.scripts.get_sql_runs.return_value = {
        "output": [
            {
                "path": ...
                "file_id": ...
            }
        ]
    }
    actual_timestamps = get_timestamps_from_table(
        ...
        client=mock_client,
        ...
    )

    expected_timestamps = ...

    # Run assertion tests as necessary
    assert actual_timestamps == expected_timestamps

Once you’ve created a mock client object, you have to define its behavior based on expected API calls from the function you’ve defined. Also, be sure to use mock_client so you don’t actually have to process an actual API call in your test.

Data Import and Export

The civis.io namespace provides several functions for moving data in and out of Civis.

Tables

Often, your data will be in structured format like a table in a relational database, a CSV, or a dataframe. The following functions handle moving structured data to and from Civis. When using these functions, it is recommended to have pandas installed and to pass use_pandas=True in the appropriate functions. If pandas is not installed, data returned from Civis will all be treated as strings.

civis_to_csv(filename, sql, database[, ...])

Export data from Civis to a local CSV file.

civis_to_multifile_csv(sql, database[, ...])

Unload the result of SQL query and return presigned urls.

civis_file_to_table(file_id, database, table)

Upload the contents of one or more Civis files to a Civis table.

csv_to_civis(filename, database, table[, ...])

Upload the contents of a local CSV file to Civis.

dataframe_to_civis(df, database, table[, ...])

Upload a pandas DataFrame into a Civis table.

read_civis(table, database[, columns, ...])

Read data from a Civis table.

read_civis_sql(sql, database[, use_pandas, ...])

Read data from Civis using a custom SQL string.

export_to_civis_file(sql, database[, ...])

Store results of a query to a Civis file

split_schema_tablename(table)

Split a Redshift 'schema.tablename' string

Files

These functions will pass flat files to and from Civis. This is useful if you have data stored in binary or JSON format. Any type of file can be stored in platform via the files endpoint.

civis_to_file(file_id, buf[, api_key, client])

Download a file from Civis.

dataframe_to_file(df[, name, expires_at, client])

Store a DataFrame as a CSV in Civis Platform

file_id_from_run_output(name, job_id, run_id)

Find the file ID of a File run output with the name "name"

file_to_civis(buf[, name, api_key, client])

Upload a file to Civis.

file_to_dataframe(file_id[, compression, client])

Load a DataFrame from a CSV stored in a Civis File

file_to_json(file_id[, client])

Restore JSON stored in a Civis File

json_to_file(obj[, name, expires_at, client])

Store a JSON-serializable object in a Civis File

Databases

These functions move data from one database to another and expose an interface to run SQL in the database. Use query_civis() when you need to execute SQL that does not return data (for example, a GRANT or DROP TABLE statement).

transfer_table(source_db, dest_db, ...[, ...])

Transfer a table from one location to another.

query_civis(sql, database[, api_key, ...])

Execute a SQL statement as a Civis query.

Machine Learning

CivisML uses the Civis Platform to train machine learning models and parallelize their predictions over large datasets. It contains best-practice models for general-purpose classification and regression modeling as well as model quality evaluations and visualizations. All CivisML models use the scikit-learn API for interoperability with other platforms and to allow you to leverage resources in the open-source software community when creating machine learning models.

Optional Dependencies

You do not need any external libraries installed to use CivisML, but the following pip-installable dependencies enhance the capabilities of the ModelPipeline:

  • pandas

  • scikit-learn

  • glmnet

  • feather-format

  • civisml-extensions

  • muffnn

Install pandas if you wish to download tables of predictions. You can also model on DataFrame objects in your interpreter.

If you wish to use the ModelPipeline code to model on DataFrame objects in your local environment, the feather-format package (requires pandas >= 0.20) will improve data transfer speeds and guarantee that your data types are correctly detected by CivisML. You must install feather-format if you wish to use pd.Categorical columns in your DataFrame objects, since that type information is lost when writing data as a CSV.

If you wish to use custom models or download trained models, you’ll need scikit-learn installed.

Several pre-defined models rely on public Civis Analytics libraries. The “sparse_logistic”, “sparse_linear_regressor”, “sparse_ridge_regressor”, “stacking_classifier”, and “stacking_regressor” models all use the glmnet library. Pre-defined MLP models (“multilayer_perceptron_classifier” and “multilayer_perceptron_regressor”) depend on the muffnn library. Finally, models which use the default CivisML ETL, along with models which use stacking or hyperband, depend on civisml-extensions. Install these packages if you wish to download the pre-defined models that depend on them.

Define Your Model

Start the modeling process by defining your model. Do this by creating an instance of the ModelPipeline class. Each ModelPipeline corresponds to a scikit-learn Pipeline which will run in Civis Platform. A Pipeline allows you to combine multiple modeling steps (such as missing value imputation and feature selection) into a single model. The Pipeline is treated as a unit – for example, cross-validation happens over all steps together.

You can define your model in two ways, either by selecting a pre-defined algorithm or by providing your own scikit-learn Pipeline or BaseEstimator object. Note that whichever option you chose, CivisML will pre-process your data using either its default ETL, or ETL that you provide (see Custom ETL).

If you have already trained a scikit-learn model outside of Civis Platform, you can register it with Civis Platform as a CivisML model so that you can score it using CivisML. Read Registering Models Trained Outside of Civis for how to do this.

Pre-Defined Models

You can use the following pre-defined models with CivisML. All models start by imputing missing values with the mean of non-null values in a column. The “sparse_*” models include a LASSO regression step (using the glmnet package) to do feature selection before passing data to the final model. In some models, CivisML uses default parameters different from those in scikit-learn, as indicated in the “Altered Defaults” column. All models also have random_state=42.

Name

Model Type

Algorithm

Altered Defaults

sparse_logistic

classification

LogisticRegression

C=499999950, tol=1e-08

gradient_boosting_classifier

classification

GradientBoostingClassifier

n_estimators=500, max_depth=2

random_forest_classifier

classification

RandomForestClassifier

n_estimators=500, max_depth=7

extra_trees_classifier

classification

ExtraTreesClassifier

n_estimators=500, max_depth=7

multilayer_perceptron_classifier

classification

muffnn.MLPClassifier

stacking_classifier

classification

civismlext.StackedClassifier

sparse_linear_regressor

regression

LinearRegression

sparse_ridge_regressor

regression

Ridge

gradient_boosting_regressor

regression

GradientBoostingRegressor

n_estimators=500, max_depth=2

random_forest_regressor

regression

RandomForestRegressor

n_estimators=500, max_depth=7

extra_trees_regressor

regression

ExtraTreesRegressor

n_estimators=500, max_depth=7

multilayer_perceptron_regressor

regression

muffnn.MLPRegressor

stacking_regressor

regression

civismlext.StackedRegressor

The “stacking_classifier” model stacks the “gradient_boosting_classifier”, and “random_forest_classifier” predefined models together with a glmnet.LogitNet(alpha=0, n_splits=4, max_iter=10000, tol=1e-5, scoring='log_loss'). The models are combined using a Pipeline containing a Normalizer step, followed by LogisticRegressionCV with penalty='l2' and tol=1e-08. The “stacking_regressor” works similarly, stacking together the “gradient_boosting_regressor” and “random_forest_regressor” models and a glmnet.ElasticNet(alpha=0, n_splits=4, max_iter=10000, tol=1e-5, scoring='r2'), combining them using NonNegativeLinearRegression. The estimators that are being stacked have the same names as the associated pre-defined models, and the meta-estimator steps are named “meta-estimator”. Note that although default parameters are provided for multilayer perceptron models, it is highly recommended that multilayer perceptrons be run using hyperband.

Custom Models

You can create your own Pipeline instead of using one of the pre-defined ones. Create the object and pass it as the model parameter of the ModelPipeline. Your model must follow the scikit-learn API, and you will need to include any dependencies as Custom Dependencies if they are not already installed in CivisML. Please check here for the available pre-installed libraries and their versions.

When you’re assembling your own model, remember that you’ll have to make certain that either you add a missing value imputation step or that your data doesn’t have any missing values. If you’re making a classification model, the model must have a predict_proba method. If the class you’re using doesn’t have a predict_proba method, you can add one by wrapping it in a CalibratedClassifierCV.

Custom ETL

By default, CivisML pre-processes data using the DataFrameETL class, with cols_to_drop equal to the excluded_columns parameter. You can replace this with your own ETL by creating an object of class BaseEstimator and passing it as the etl parameter during training.

By default, DataFrameETL automatically one-hot encodes all categorical columns in the dataset. If you are passing a custom ETL estimator, you will have to ensure that no categorical columns remain after the transform method is called on the dataset.

Hyperparameter Tuning

You can tune hyperparamters using one of two methods: grid search or hyperband. CivisML will perform grid search if you pass a dictionary of hyperparameters to the cross_validation_parameters parameter, where the keys are hyperparameter names, and the values are lists of hyperparameter values to grid search over. You can run hyperparameter tuning in parallel by setting the n_jobs parameter to however many jobs you would like to run in parallel. By default, n_jobs is dynamically calculated based on the resources available on your cluster, such that a modeling job will never take up more than 90% of the cluster resources at once.

Hyperband is an efficient approach to hyperparameter optimization, and recommended over grid search where possible. CivisML will perform hyperband optimization for a pre-defined model if you pass the string 'hyperband' to cross_validation_parameters. Hyperband is currently only supported for the following models: gradient_boosting_classifier, random_forest_classifier, extra_trees_classifier, multilayer_perceptron_classifier, stacking_classifier, gradient_boosting_regressor, random_forest_regressor, extra_trees_regressor, multilayer_perceptron_regressor, and stacking_regressor. Although hyperband is supported for stacking models, stacking itself is a kind of model tuning, and the combination of stacking and hyperband is likely too computationally intensive to be useful in many cases.

Hyperband cannot be used to tune GLMs. For this reason, preset GLMs do not have a hyperband option. Similarly, when cross_validation_parameters='hyperband' and the model is stacking_classifier or stacking_regressor, only the GBT and random forest steps of the stacker are tuned using hyperband. Note that if you want to use hyperband with a custom model, you will need to wrap your estimator in a civismlext.hyperband.HyperbandSearchCV estimator yourself.

CivisML runs pre-defined models with hyperband using the following distributions:

Models

Cost Parameter

Hyperband Distributions

gradient_boosting_classifier
gradient_boosting_regressor
GBT step in stacking_classifier
GBT step in stacking_regressor
n_estimators
min = 100,
max = 1000
max_depth: randint(low=1, high=5)
max_features: [None, 'sqrt', 'log2', 0.5, 0.3, 0.1, 0.05, 0.01]
learning_rate: truncexpon(b=5, loc=.0003, scale=1./167.)
random_forest_classifier
random_forest_regressor
extra_trees_classifier
extra_trees_regressor
RF step in stacking_classifier
RF step in stacking_regressor
n_estimators
min = 100,
max = 1000
criterion: ['gini', 'entropy']
max_features: truncexpon(b=10., loc=.01, scale=1./10.11)
max_depth: [1, 2, 3, 4, 6, 10]
multilayer_perceptron_classifier
multilayer_perceptron_regressor
n_epochs
min = 5,
max = 50
keep_prob: uniform()
hidden_units: [(), (16,), (32,), (64,), (64, 64), (64, 64, 64),
(128,), (128, 128), (128, 128, 128), (256,),
(256, 256), (256, 256, 256), (512, 256, 128, 64),
(1024, 512, 256, 128)]
learning_rate: [1e-2, 2e-2, 5e-2, 8e-2, 1e-3, 2e-3, 5e-3, 8e-3, 1e-4]

The truncated exponential distribution for the gradient boosting classifier and regressor was chosen to skew the distribution toward small values, ranging between .0003 and .03, with a mean close to .006. Similarly, the truncated exponential distribution for the random forest and extra trees models skews toward small values, ranging between .01 and 1, and with a mean close to .1.

Custom Dependencies

Installing packages from PyPI is straightforward. You can specify a dependencies

argument to ModelPipeline which will install the dependencies in your runtime environment. VCS support is also enabled (see docs.) Installing a remote git repository from, say, Github only requires passing the HTTPS URL in the form of, for example, git+https://github.com/scikit-learn/scikit-learn.

CivisML will run pip install [your package here]. We strongly encourage you to pin package versions for consistency. Example code looks like:

from civis.ml import ModelPipeline
from pyearth import Earth
deps = ['git+https://github.com/scikit-learn-contrib/py-earth.git@da856e11b2a5d16aba07f51c3c15cef5e40550c7']
est = Earth()
model = ModelPipeline(est, dependent_variable='age', dependencies=deps)
train = model.train(table_name='donors.from_march', database_name='client')

Additionally, you can store a remote git host’s API token in the Civis Platform as a credential to use for installing private git repositores. For example, you can go to Github at the https://github.com/settings/tokens URL, copy your token into the password field of a credential, and pass the credential name to the git_token_name argument in ModelPipeline. This also works with other hosting services. A simple example of how to do this with API looks as follows

import civis
password = 'abc123'  # token copied from https://github.com/settings/tokens
username = 'user123'  # Github username
git_token_name = 'Github credential'

client = civis.APIClient()
credential = client.credentials.post(password=password,
                                     username=username,
                                     name=git_token_name,
                                     type="Custom")

pipeline = civis.ml.ModelPipeline(..., git_token_name=git_token_name)

Note, installing private dependencies with submodules is not supported.

CivisML Versions

By default, CivisML uses its latest version in production. If you would like a specific version (e.g., for a production pipeline where pinning the CivisML version is desirable), ModelPipeline (both its constructor and the class method civis.ml.ModelPipeline.register_pretrained_model()) has the optional parameter civisml_version that accepts a string, e.g., 'v2.3' for CivisML v2.3. Please see here for the list of CivisML versions.

Asynchronous Execution

All calls to a ModelPipeline object are non-blocking, i.e. they immediately provide a result without waiting for the job in the Civis Platform to complete. Calls to civis.ml.ModelPipeline.train() and civis.ml.ModelPipeline.predict() return a ModelFuture object, which is a subclass of Future from the Python standard library. This behavior lets you train multiple models at once, or generate predictions from models, while still doing other work while waiting for your jobs to complete.

The ModelFuture can find and retrieve outputs from your CivisML jobs, such as trained Pipeline objects or out-of-sample predictions. The ModelFuture only downloads outputs when you request them.

Model Persistence

Civis Platform permanently stores all models, indexed by the job ID and the run ID (also called a “build”) of the training job. If you wish to use an existing model, call civis.ml.ModelPipeline.from_existing() with the job ID of the training job. You can find the job ID with the train_job_id attribute of a ModelFuture, or by looking at the URL of your model on the Civis Platform models page. If the training job has multiple runs, you may also provide a run ID to select a run other than the most recent. You can list all model runs of a training job by calling civis.APIClient().jobs.get(train_job_id)['runs']. You may also store the ModelPipeline itself with the pickle module.

Examples

Future objects have the method add_done_callback(). This is called as soon as the run completes. It takes a single argument, the Future for the completed job. You can use this method to chain jobs together:

from concurrent import futures
from civis.ml import ModelPipeline
import pandas as pd
df = pd.read_csv('data.csv')
training, predictions = [], []
model = ModelPipeline('sparse_logistic', dependent_variable='type')
training.append(model.train(df))
training[-1].add_done_callback(lambda fut: predictions.append(model.predict(df)))
futures.wait(training)  # Blocks until all training jobs complete
futures.wait(predictions)  # Blocks until all prediction jobs complete

You can create and train multiple models at once to find the best approach for solving a problem. For example:

from civis.ml import ModelPipeline
algorithms = ['gradient_boosting_classifier', 'sparse_logistic', 'random_forest_classifier']
pkey = 'person_id'
depvar = 'likes_cats'
models = [ModelPipeline(alg, primary_key=pkey, dependent_variable=depvar) for alg in algorithms]
train = [model.train(table_name='schema.name', database_name='My DB') for model in models]
aucs = [tr.metrics['roc_auc'] for tr in train]  # Code blocks here

Registering Models Trained Outside of Civis

Instead of using CivisML to train your model, you may train any scikit-learn-compatible model outside of Civis Platform and use civis.ml.ModelPipeline.register_pretrained_model() to register it as a CivisML model in Civis Platform. This will let you use Civis Platform to make predictions using your model, either to take advantage of distributed predictions on large datasets, or to create predictions as part of a workflow or service in Civis Platform.

When registering a model trained outside of Civis Platform, you are strongly advised to provide an ordered list of feature names used for training. This will allow CivisML to ensure that tables of data input for predictions have the correct features in the correct order. If your model has more than one output, you should also provide a list of output names so that CivisML knows how many outputs to expect and how to name them in the resulting table of model predictions.

If your model uses dependencies which aren’t part of the default CivisML execution environment, you must provide them to the dependencies parameter of the register_pretrained_model() function, just as with the ModelPipeline constructor.

Sharing Models

Models produced by CivisML can’t be shared directly through the Civis Platform UI or API. The ml namespace provides functions which will let you share your CivisML models with other Civis Platform users. To share your models, use the functions

To find out what models a user has, use list_models().

Object and Function Reference

class civis.ml.ModelPipeline(model, dependent_variable, primary_key=None, parameters=None, cross_validation_parameters=None, model_name=None, calibration=None, excluded_columns=None, client=None, cpu_requested=None, memory_requested=None, disk_requested=None, notifications=None, dependencies=None, git_token_name=None, verbose=False, etl=None, civisml_version=None)[source]

Interface for scikit-learn modeling in the Civis Platform

Each ModelPipeline corresponds to a scikit-learn Pipeline which will run in Civis Platform.

Note that this object can be safely pickled and unpickled, but it does not store the state of any attached APIClient object. An unpickled ModelPipeline will use the API key from the user’s environment.

Parameters
modelstring or Estimator

Either the name of a pre-defined model (e.g. “sparse_logistic” or “gradient_boosting_classifier”) or else a pre-existing Estimator object.

dependent_variablestring or List[str]

The dependent variable of the training dataset. For a multi-target problem, this should be a list of column names of dependent variables. Nulls in a single dependent variable will automatically be dropped.

primary_keystring, optional

The unique ID (primary key) of the training dataset. This will be used to index the out-of-sample scores.

parametersdict, optional

Specify parameters for the final stage estimator in a predefined model, e.g. {'C': 2} for a “sparse_logistic” model.

cross_validation_parametersdict or string, optional

Options for cross validation. For grid search, supply a parameter grid as a dictionary, e.g., {{'n_estimators': [100, 200, 500], 'learning_rate': [0.01, 0.1], 'max_depth': [2, 3]}}. For hyperband, pass the string “hyperband”.

model_namestring, optional

The prefix of the Platform modeling jobs. It will have ” Train” or ” Predict” added to become the Script title.

calibration{None, “sigmoid”, “isotonic”}

If not None, calibrate output probabilities with the selected method. Valid only with classification models.

excluded_columnsarray, optional

A list of columns which will be considered ineligible to be independent variables.

clientAPIClient, optional

If not provided, an APIClient object will be created from the CIVIS_API_KEY.

cpu_requestedint, optional

Number of CPU shares requested in the Civis Platform for training jobs. 1024 shares = 1 CPU.

memory_requestedint, optional

Memory requested from Civis Platform for training jobs, in MiB

disk_requestedfloat, optional

Disk space requested on Civis Platform for training jobs, in GB

notificationsdict

See post_custom() for further documentation about email and URL notification.

dependenciesarray, optional

List of packages to install from PyPI or git repository (e.g., Github or Bitbucket). If a private repo is specified, please include a git_token_name argument as well (see below). Make sure to pin dependencies to a specific version, since dependencies will be reinstalled during every training and predict job.

git_token_namestr, optional

Name of remote git API token stored in Civis Platform as the password field in a custom platform credential. Used only when installing private git repositories.

verbosebool, optional

If True, supply debug outputs in Platform logs and make prediction child jobs visible.

etlEstimator, optional

Custom ETL estimator which overrides the default ETL, and is run before training and validation.

civisml_versionstr, optional

CivisML version to use for training and prediction. If not provided, the latest version in production is used.

Examples

>>> from civis.ml import ModelPipeline
>>> model = ModelPipeline('gradient_boosting_classifier', 'depvar',
...                       primary_key='voterbase_id')
>>> train = model.train(table_name='schema.survey_data',
...                     fit_params={'sample_weight': 'survey_weight'},
...                     database_name='My Redshift Cluster',
...                     oos_scores='scratch.survey_depvar_oos_scores')
>>> train
<ModelFuture at 0x11be7ae10 state=queued>
>>> train.running()
True
>>> train.done()
False
>>> df = train.table  # Read OOS scores from its Civis File. Blocking.
>>> meta = train.metadata  # Metadata from training run
>>> train.metrics['roc_auc']
0.88425
>>> pred = model.predict(table_name='schema.demographics_table ',
...                      database_name='My Redshift Cluster',
...                      output_table='schema.predicted_survey_response',
...                      if_exists='drop')
>>> df_pred = pred.table  # Blocks until finished
# Modify the parameters of the base estimator in a default model:
>>> model = ModelPipeline('sparse_logistic', 'depvar',
...                       primary_key='voterbase_id',
...                       parameters={'C': 2})
# Grid search over hyperparameters in the base estimator:
>>> model = ModelPipeline('sparse_logistic', 'depvar',
...                       primary_key='voterbase_id',
...                       cross_validation_parameters={'C': [0.1, 1, 10]})
Attributes
estimatorPipeline

The trained scikit-learn Pipeline

train_result_ModelFuture

ModelFuture encapsulating this model’s training run

statestr

Status of the training job (non-blocking)

Methods

train()

Train the model on data in Civis Platform; outputs ModelFuture

predict()

Make predictions on new data; outputs ModelFuture

from_existing()

Class method; use to create a ModelPipeline from an existing model training run

classmethod from_existing(train_job_id, train_run_id='latest', client=None)[source]

Create a ModelPipeline object from existing model IDs

Parameters
train_job_idint

The ID of the CivisML job in the Civis Platform

train_run_idint or string, optional

Location of the model run, either

  • an explicit run ID,

  • “latest” : The most recent run

  • “active” : The run designated by the training job’s “active build” parameter

clientAPIClient, optional

If not provided, an APIClient object will be created from the CIVIS_API_KEY.

Returns
ModelPipeline

A ModelPipeline which refers to a previously-trained model

Examples

>>> from civis.ml import ModelPipeline
>>> model = ModelPipeline.from_existing(job_id)
>>> model.train_result_.metrics['roc_auc']
0.843
predict(df=None, csv_path=None, table_name=None, database_name=None, manifest=None, file_id=None, sql_where=None, sql_limit=None, primary_key=Sentinel(), output_table=None, output_db=None, if_exists='fail', n_jobs=None, polling_interval=None, cpu=None, memory=None, disk_space=None, dvs_to_predict=None)[source]

Make predictions on a trained model

Provide input through one of a DataFrame (df), a local CSV (csv_path), a Civis Table (table_name and database_name), a Civis File containing a CSV (file_id), or a Civis File containing a manifest file (manifest).

A “manifest file” is JSON which specifies the location of many shards of the data to be used for prediction. A manifest file is the output of a Civis export job with force_multifile=True set, e.g. from civis.io.civis_to_multifile_csv(). Large Civis Tables (provided using table_name) will automatically be exported to manifest files.

Prediction outputs will always be stored as gzipped CSVs in one or more Civis Files. You can find a list of File ID numbers for output files at the “output_file_ids” key in the metadata returned by the prediction job. Provide an output_table (and optionally an output_db, if it’s different from database_name) to copy these predictions into a Civis Table.

Parameters
dfpd.DataFrame, optional

A DataFrame of data for prediction. The DataFrame will be uploaded to a Civis file so that CivisML can access it. Note that the index of the DataFrame will be ignored – use df.reset_index() if you want your index column to be included with the data passed to CivisML. NB: You must install feather-format if your DataFrame contains Categorical columns, to ensure that CivisML preserves data types.

csv_pathstr, optional

The location of a CSV of data on the local disk. It will be uploaded to a Civis file.

table_namestr, optional

The qualified name of the table containing your data

database_namestr, optional

Name of the database holding the data, e.g., ‘My Redshift Cluster’.

manifestint, optional

ID for a manifest file stored as a Civis file. (Note: if the manifest is not a Civis Platform-specific manifest, like the one returned from civis.io.civis_to_multfile_csv(), this must be used in conjunction with table_name and database_name due to the need for column discovery via Redshift.)

file_idint, optional

If the data are a CSV stored in a Civis file, provide the integer file ID.

sql_wherestr, optional

A SQL WHERE clause used to scope the rows to be predicted

sql_limitint, optional

SQL LIMIT clause to restrict the size of the prediction set

primary_keystr, optional

Primary key of the prediction table. Defaults to the primary key of the training data. Use None to indicate that the prediction data don’t have a primary key column.

output_table: str, optional

The table in which to put the predictions.

output_dbstr, optional

Database of the output table. Defaults to the database of the input table.

if_exists{‘fail’, ‘append’, ‘drop’, ‘truncate’}

Action to take if the prediction table already exists.

n_jobsint, optional

Number of concurrent Platform jobs to use for multi-file / large table prediction. Defaults to None, which allows CivisML to dynamically calculate an appropriate number of workers to use (in general, as many as possible without using all resources in the cluster).

polling_intervalfloat, optional

Check for job completion every this number of seconds. Do not set if using the notifications endpoint.

cpuint, optional

CPU shares requested by the user for a single job.

memoryint, optional

RAM requested by the user for a single job.

disk_spacefloat, optional

disk space requested by the user for a single job.

dvs_to_predictlist of str, optional

If this is a multi-output model, you may list a subset of dependent variables for which you wish to generate predictions. This list must be a subset of the original dependent_variable input. The scores for the returned subset will be identical to the scores which those outputs would have had if all outputs were written, but ignoring some of the model’s outputs will let predictions complete faster and use less disk space. The default is to produce scores for all DVs.

Returns
ModelFuture
classmethod register_pretrained_model(model, dependent_variable=None, features=None, primary_key=None, model_name=None, dependencies=None, git_token_name=None, skip_model_check=False, verbose=False, client=None, civisml_version=None)[source]

Use a fitted scikit-learn model with CivisML scoring

Use this function to set up your own fitted scikit-learn-compatible Estimator object for scoring with CivisML. This function will upload your model to Civis Platform and store enough metadata about it that you can subsequently use it with a CivisML scoring job.

The only required input is the model itself, but you are strongly recommended to also provide a list of feature names. Without a list of feature names, CivisML will have to assume that your scoring table contains only the features needed for scoring (perhaps also with a primary key column), in all in the correct order.

Parameters
modelsklearn.base.BaseEstimator or int

The model object. This must be a fitted scikit-learn compatible Estimator object, or else the integer Civis File ID of a pickle or joblib-serialized file which stores such an object. If an Estimator object is provided, it will be uploaded to the Civis Files endpoint and set to be available indefinitely.

dependent_variablestring or List[str], optional

The dependent variable of the training dataset. For a multi-target problem, this should be a list of column names of dependent variables.

featuresstring or List[str], optional

A list of column names of features which were used for training. These will be used to ensure that tables input for prediction have the correct features in the correct order.

primary_keystring, optional

The unique ID (primary key) of the scoring dataset

model_namestring, optional

The name of the Platform registration job. It will have ” Predict” added to become the Script title for predictions.

dependenciesarray, optional

List of packages to install from PyPI or git repository (e.g., GitHub or Bitbucket). If a private repo is specified, please include a git_token_name argument as well (see below). Make sure to pin dependencies to a specific version, since dependencies will be reinstalled during every predict job.

git_token_namestr, optional

Name of remote git API token stored in Civis Platform as the password field in a custom platform credential. Used only when installing private git repositories.

skip_model_checkbool, optional

If you’re sure that your model will work with CivisML, but it will fail the comprehensive verification, set this to True.

verbosebool, optional

If True, supply debug outputs in Platform logs and make prediction child jobs visible.

clientAPIClient, optional

If not provided, an APIClient object will be created from the CIVIS_API_KEY.

civisml_versionstr, optional

CivisML version to use. If not provided, the latest version in production is used.

Returns
ModelPipeline

Examples

This example assumes that you already have training data X and y, where X is a DataFrame.

>>> from civis.ml import ModelPipeline
>>> from sklearn.linear_model import Lasso
>>> est = Lasso().fit(X, y)
>>> model = ModelPipeline.register_pretrained_model(
...     est, 'concrete', features=X.columns)
>>> model.predict(table_name='my.table', database_name='my-db')
train(df=None, csv_path=None, table_name=None, database_name=None, file_id=None, sql_where=None, sql_limit=None, oos_scores=None, oos_scores_db=None, if_exists='fail', fit_params=None, polling_interval=None, validation_data='train', n_jobs=None)[source]

Start a Civis Platform job to train your model

Provide input through one of a DataFrame (df), a local CSV (csv_path), a Civis Table (table_name and database_name), or a Civis File containing a CSV (file_id).

Model outputs will always contain out-of-sample scores (accessible through ModelFuture.table on this function’s output), and you may chose to store these out-of-sample scores in a Civis Table with the oos_scores, oos_scores_db, and if_exists parameters.

Parameters
dfpd.DataFrame, optional

A DataFrame of training data. The DataFrame will be uploaded to a Civis file so that CivisML can access it. Note that the index of the DataFrame will be ignored – use df.reset_index() if you want your index column to be included with the data passed to CivisML. NB: You must install feather-format if your DataFrame contains Categorical columns, to ensure that CivisML preserves data types.

csv_pathstr, optional

The location of a CSV of data on the local disk. It will be uploaded to a Civis file.

table_namestr, optional

The qualified name of the table containing the training set from which to build the model.

database_namestr, optional

Name of the database holding the training set table used to build the model. E.g., ‘My Cluster Name’.

file_idint, optional

If the training data are stored in a Civis file, provide the integer file ID.

sql_wherestr, optional

A SQL WHERE clause used to scope the rows of the training set (used for table input only)

sql_limitint, optional

SQL LIMIT clause for querying the training set (used for table input only)

oos_scoresstr, optional

If provided, store out-of-sample predictions on training set data to this Redshift “schema.tablename”.

oos_scores_dbstr, optional

If not provided, store OOS predictions in the same database which holds the training data.

if_exists{‘fail’, ‘append’, ‘drop’, ‘truncate’}

Action to take if the out-of-sample prediction table already exists.

fit_params: Dict[str, str]

Mapping from parameter names in the model’s fit method to the column names which hold the data, e.g. {'sample_weight': 'survey_weight_column'}.

polling_intervalfloat, optional

Check for job completion every this number of seconds. Do not set if using the notifications endpoint.

validation_datastr, optional

Source for validation data. There are currently two options: ‘train’ (the default), which cross-validates over training data for validation; and ‘skip’, which skips the validation step.

n_jobsint, optional

Number of jobs to use for training and validation. Defaults to None, which allows CivisML to dynamically calculate an appropriate number of workers to use (in general, as many as possible without using all resources in the cluster). Increase n_jobs to parallelize over many hyperparameter combinations in grid search/hyperband, or decrease to use fewer computational resources at once.

Returns
ModelFuture
class civis.ml.ModelFuture(job_id, run_id, train_job_id=None, train_run_id=None, polling_interval=None, client=None, poll_on_creation=True)[source]

Encapsulates asynchronous execution of a CivisML job

This object knows where to find modeling outputs from CivisML jobs. All data attributes are lazily retrieved and block on job completion.

This object can be pickled, but it does not store the state of the attached APIClient object. An unpickled ModelFuture will use the API key from the user’s environment.

Parameters
job_idint

ID of the modeling job

run_idint

ID of the modeling run

train_job_idint, optional

If not provided, this object is assumed to encapsulate a training job, and train_job_id will equal job_id.

train_run_idint, optional

If not provided, this object is assumed to encapsulate a training run, and train_run_id will equal run_id.

polling_intervalint or float, optional

The number of seconds between API requests to check whether a result is ready.

clientcivis.APIClient, optional

If not provided, an civis.APIClient object will be created from the CIVIS_API_KEY.

poll_on_creationbool, optional

If True (the default), it will poll upon calling result() the first time. If False, it will wait the number of seconds specified in polling_interval from object creation before polling.

See also

civis.futures.CivisFuture
civis.futures.ContainerFuture
concurrent.futures.Future
Attributes
metadatadict, blocking

The metadata associated with this modeling job

metricsdict, blocking

Validation metrics from this job’s training

validation_metadatadict, blocking

Metadata from this modeling job’s validation run

train_metadatadict, blocking

Metadata from this modeling job’s training run (will be identical to metadata if this is a training run)

estimatorsklearn.pipeline.Pipeline, blocking

The fitted scikit-learn Pipeline resulting from this model run

tablepandas.DataFrame, blocking

The table output from this modeling job: out-of-sample predictions on the training set for a training job, or a table of predictions for a prediction job. If the prediction job was split into multiple files (this happens automatically for large tables), this attribute will provide only predictions for the first file.

statestr

The current state of the Civis Platform run

job_idint
run_idint
train_job_idint

Container ID for the training job – identical to job_id if this is a training job.

train_run_idint

As train_job_id but for runs

is_trainingbool

True if this ModelFuture corresponds to a train-validate job.

Methods

cancel()

Cancels the corresponding Platform job before completion

succeeded()

(Non-blocking) Is the job a success?

failed()

(Non-blocking) Did the job fail?

cancelled()

(Non-blocking) Was the job cancelled?

running()

(Non-blocking) Is the job still running?

done()

(Non-blocking) Is the job finished?

result()

(Blocking) Return the final status of the Civis Platform job.

add_done_callback(fn)

Attaches a callable that will be called when the future finishes.

Args:
fn: A callable that will be called with this future as its only

argument when the future completes or is cancelled. The callable will always be called by a thread in the same process in which it was added. If the future has already completed or been cancelled then the callable will be called immediately. These callables are called in the order that they were added.

cancel()

Submit a request to cancel the container/script/run.

Returns
bool

Whether or not the job is in a cancelled state.

cancelled()

Return True if the future was cancelled.

done()

Return True of the future was cancelled or finished executing.

exception(timeout=None)

Return the exception raised by the call that the future represents.

Args:
timeout: The number of seconds to wait for the exception if the

future isn’t done. If None, then there is no limit on the wait time.

Returns:

The exception raised by the call that the future represents or None if the call completed without raising.

Raises:

CancelledError: If the future was cancelled. TimeoutError: If the future didn’t finish executing before the given

timeout.

failed()

Return True if the Civis job failed.

outputs()

Block on job completion and return a list of run outputs.

The method will only return run outputs for successful jobs. Failed jobs will raise an exception.

Returns
list[dict]

List of run outputs from a successfully completed job.

Raises
civis.base.CivisJobFailure

If the job fails.

result(timeout=None)

Return the result of the call that the future represents.

Args:
timeout: The number of seconds to wait for the result if the future

isn’t done. If None, then there is no limit on the wait time.

Returns:

The result of the call that the future represents.

Raises:

CancelledError: If the future was cancelled. TimeoutError: If the future didn’t finish executing before the given

timeout.

Exception: If the call raised then that exception will be raised.

running()

Return True if the future is currently executing.

set_exception(exception)

Sets the result of the future as being the given exception.

This is adapted from https://github.com/python/cpython/blob/3.8/Lib/concurrent/futures/_base.py#L532-L545 This version does not try to change the _state or check that the initial _state is running since the Civis implementation has _state depend on the Platform job state.

set_result(result)

Sets the return value of work associated with the future.

This is adapted from https://github.com/python/cpython/blob/3.8/Lib/concurrent/futures/_base.py#L517-L530 This version does not try to change the _state or check that the initial _state is running since the Civis implementation has _state depend on the Platform job state.

set_running_or_notify_cancel()

Mark the future as running or process any cancel notifications.

Should only be used by Executor implementations and unit tests.

If the future has been cancelled (cancel() was called and returned True) then any threads waiting on the future completing (though calls to as_completed() or wait()) are notified and False is returned.

If the future was not cancelled then it is put in the running state (future calls to running() will return True) and True is returned.

This method should be called by Executor implementations before executing the work associated with this future. If this method returns False then the work should not be executed.

Returns:

False if the Future was cancelled, True otherwise.

Raises:
RuntimeError: if this method was already called or if set_result()

or set_exception() was called.

succeeded()

Return True if the job completed in Civis with no error.

civis.ml.put_models_shares_users(id, user_ids, permission_level, client=None, share_email_body='DEFAULT', send_shared_email='DEFAULT')[source]

Set the permissions users have on this object

Use this on both training and scoring jobs. If used on a training job, note that “read” permission is sufficient to score the model.

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

clientcivis.APIClient, optional

If not provided, an civis.APIClient object will be created from the CIVIS_API_KEY.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
readersdict::
  • userslist::
    • id : integer

    • name : string

  • groupslist::
    • id : integer

    • name : string

writersdict::
  • userslist::
    • id : integer

    • name : string

  • groupslist::
    • id : integer

    • name : string

ownersdict::
  • userslist::
    • id : integer

    • name : string

  • groupslist::
    • id : integer

    • name : string

total_user_sharesinteger

For owners, the number of total users shared. For writers and readers, the number of visible users shared.

total_group_sharesinteger

For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

civis.ml.put_models_shares_groups(id, group_ids, permission_level, client=None, share_email_body='DEFAULT', send_shared_email='DEFAULT')[source]

Set the permissions groups have on this model.

Use this on both training and scoring jobs. If used on a training job, note that “read” permission is sufficient to score the model.

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

clientcivis.APIClient, optional

If not provided, an civis.APIClient object will be created from the CIVIS_API_KEY.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
readersdict::
  • userslist::
    • id : integer

    • name : string

  • groupslist::
    • id : integer

    • name : string

writersdict::
  • userslist::
    • id : integer

    • name : string

  • groupslist::
    • id : integer

    • name : string

ownersdict::
  • userslist::
    • id : integer

    • name : string

  • groupslist::
    • id : integer

    • name : string

total_user_sharesinteger

For owners, the number of total users shared. For writers and readers, the number of visible users shared.

total_group_sharesinteger

For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

civis.ml.delete_models_shares_users(id, user_id, client=None)[source]

Revoke the permissions a user has on this object

Use this function on both training and scoring jobs.

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

clientcivis.APIClient, optional

If not provided, an civis.APIClient object will be created from the CIVIS_API_KEY.

Returns
None

Response code 204: success

civis.ml.delete_models_shares_groups(id, group_id, client=None)[source]

Revoke the permissions a group has on this object

Use this function on both training and scoring jobs.

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

clientcivis.APIClient, optional

If not provided, an civis.APIClient object will be created from the CIVIS_API_KEY.

Returns
None

Response code 204: success

civis.ml.list_models(job_type='train', author=Sentinel(), client=None, **kwargs)[source]

List a user’s CivisML models.

Parameters
job_type{“train”, “predict”, None}

The type of model job to list. If “train”, list training jobs only (including registered models trained outside of CivisML). If “predict”, list prediction jobs only. If None, list both.

authorint, optional

User id of the user whose models you want to list. Defaults to the current user. Use None to list models from all users.

clientcivis.APIClient, optional

If not provided, an civis.APIClient object will be created from the CIVIS_API_KEY.

**kwargskwargs

Extra keyword arguments passed to client.scripts.list_custom()

See also

APIClient.scripts.list_custom

Parallel Computation

The Civis Platform manages a pool of cloud computing resources. You can access these resources with the tools in the civis.parallel and civis.futures modules.

Joblib backend

If you can divide your work into multiple independent chunks, each of which takes at least several minutes to run, you can reduce the time your job takes to finish by running each chunk simultaneously in Civis Platform. The Civis joblib backend is a software tool which makes it easier to run many jobs simultaneously.

Things to keep in mind when deciding if the Civis joblib backend is the right tool for your code:

  • Each function call which is parallelized with the Civis joblib backend will run in a different Civis Platform script. Creating a new script comes with some overhead. It will take between a few seconds and a few minutes for each script to start, depending on whether Civis Platform needs to provision additional resources. If you expect that each function call will complete quickly, instead consider either running them in serial or using extra processes in the same Civis Platform script.

  • Because function calls run in different scripts, function inputs and outputs must be uploaded to Civis Platform from their origin script and downloaded into their destination. If your functions take very large inputs and/or produce very large outputs, moving the data around will cause additional overhead. Consider either using a different tool or refactoring your code so that the function to be parallelized is no longer moving around large amounts of data.

  • Some open-source libraries, such as scikit-learn, use joblib to do computations in parallel. If you’re working with such a library, the Civis joblib backend provides an easy way to run these parallel computations in different Civis Platform scripts.

Joblib

joblib is an open source Python library which facilitates parallel processing in Python. Joblib uses Python’s multiprocessing library to run functions in parallel, but it also allows users to define their own “back end” for parallel computation. The Civis Python API client takes advantage of this to let you easily run your own code in parallel through Civis Platform.

The make_backend_factory(), infer_backend_factory(), and make_backend_template_factory() functions allow you to define a “civis” parallel computation backend which will transparently distribute computation in cloud resources managed by the Civis Platform.

See the joblib user guide for examples of using joblib to do parallel computation. Note that the descriptions of “memmapping” aren’t relevant to using Civis Platform as a backend, since your jobs will potentially run on different computers and can’t share memory. Using the Civis joblib backend to run jobs in parallel in the cloud looks the same as running jobs in parallel on your local computer, except that you first need to set up the “civis” backend.

How to use

Begin by defining the backend. The Civis joblib backend creates and runs Container Scripts, and the make_backend_factory() function accepts several arguments which will be passed to post_containers(). For example, you could pass a repo_http_uri or repo_ref to clone a repository from GitHub into the container which will run your function. Use the docker_image_name and docker_image_tag to select a custom Docker image for your job. You can provide a setup_cmd to run setup in bash before your function executes in Python. The default setup_cmd will run python setup.py install in the base directory of any repo_http_uri which you include in your backend setup. Make sure that the environment you define for your Civis backend includes all of the code which your parallel function will call.

The make_backend_factory() function will return a backend factory which should be given to the joblib.register_parallel_backend() function. For example:

>>> from joblib import register_parallel_backend
>>> from civis.parallel import make_backend_factory
>>> be_factory = make_backend_factory()
>>> register_parallel_backend('civis', be_factory)

Direct joblib to use a custom backend by entering a joblib.parallel_backend() context:

>>> from joblib import parallel_backend
>>> with parallel_backend('civis'):
...     # Do joblib parallel computation here.

You can find more about custom joblib backends in the joblib documentation.

Note that joblib.Parallel takes both a n_jobs and pre_dispatch parameter. The Civis joblib backend doesn’t queue submitted jobs itself, so it will run pre_dispatch jobs at once.

Note

The default value of pre_dispatch is "2*n_jobs", which will run a maximum of 2 * n_jobs jobs at once on Civis Platform. Set pre_dispatch="n_jobs" in your joblib.Parallel call to run at most n_jobs jobs.

The Civis joblib backend uses cloudpickle to transport code and data from the parent environment to the Civis Platform. This means that you may parallelize dynamically-defined functions and classes, including lambda functions.

The joblib backend will automatically add environment variables called “CIVIS_PARENT_JOB_ID” and “CIVIS_PARENT_RUN_ID”, holding the values of the job and run IDs of the Civis Platform job in which you’re running the joblib backend (if any). Your functions could use these to communicate with the parent job or to recognize that they’re in a process which has been created by another Civis Platform job. However, where possible you should let the joblib backend itself transport the return value of the function it’s running back to the parent.

Infer backend parameters

If you’re writing code which will run inside a Civis Container Script, then the infer_backend_factory() function returns a backend factory with environment parameters pre-populated by inspecting the state of your container script at run time. Use infer_backend_factory() anywhere you would use make_backend_factory(), and you don’t need to specify a Docker image or GitHub repository.

Templated Scripts

The make_backend_template_factory() is intended for developers who are writing code which may be run by users who don’t have permissions to create new container scripts with the necessary environment.

Instead of defining and creating new container scripts with make_backend_factory(), you can use make_backend_template_factory() to launch custom scripts from a templated script. To use the template factory, your backing container script must have the Civis Python client installed, and its run command must finish by calling civis_joblib_worker with no arguments. The template must accept the parameter “JOBLIB_FUNC_FILE_ID”. The Civis joblib backend will use this parameter to transport your remote work.

Examples

Parallel computation using the default joblib backend (this uses processes on your local computer):

>>> def expensive_calculation(num1, num2):
...     return 2 * num1 + num2
>>> from joblib import delayed, Parallel
>>> parallel = Parallel(n_jobs=5)
>>> args = [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1), (6, 1)]
>>> print(parallel(delayed(expensive_calculation)(*a) for a in args))
[1, 3, 5, 7, 9, 11, 13]

You can do the the same parallel computation using the Civis backend by creating and registering a backend factory and entering a with parallel_backend('civis') context. The code below will start seven different jobs in Civis Platform (with up to five running at once). Each job will call the function expensive_calculation with a different set of arguments from the list args.:

>>> def expensive_calculation(num1, num2):
...     return 2 * num1 + num2
>>> from joblib import delayed, Parallel
>>> from joblib import parallel_backend, register_parallel_backend
>>> from civis.parallel import make_backend_factory
>>> register_parallel_backend('civis', make_backend_factory(
...     required_resources={"cpu": 512, "memory": 256}))
>>> args = [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1), (6, 1)]
>>> with parallel_backend('civis'):
...    parallel = Parallel(n_jobs=5, pre_dispatch='n_jobs')
...    print(parallel(delayed(expensive_calculation)(*a) for a in args))
[1, 3, 5, 7, 9, 11, 13]

You can use the Civis joblib backend to parallelize any code which uses joblib internally, such as scikit-learn:

>>> from joblib import parallel_backend, register_parallel_backend
>>> from sklearn.model_selection import GridSearchCV
>>> from sklearn.ensemble import GradientBoostingClassifier
>>> from sklearn.datasets import load_digits
>>> digits = load_digits()
>>> param_grid = {
...     "max_depth": [1, 3, 5, None],
...     "max_features": ["sqrt", "log2", None],
...     "learning_rate": [0.1, 0.01, 0.001]
... }
>>> # Note: n_jobs and pre_dispatch specify the maximum number of
>>> # concurrent jobs.
>>> gs = GridSearchCV(GradientBoostingClassifier(n_estimators=1000,
...                                              random_state=42),
...                   param_grid=param_grid,
...                   n_jobs=5, pre_dispatch="n_jobs")
>>> register_parallel_backend('civis', make_backend_factory(
...     required_resources={"cpu": 512, "memory": 256}))
>>> with parallel_backend('civis'):
...     gs.fit(digits.data, digits.target)
Debugging

Any (non-retried) errors in child jobs will cause the entire parallel call to fail. joblib will transport the first exception from a remote job and raise it in the parent process so that you can debug.

If your remote jobs are failing because of network problems (e.g. occasional 500 errors), you can make your parallel call more likely to succeed by using a max_job_retries value above 0 when creating your backend factory. This will automatically retry a job (potentially more than once) before giving up and keeping an exception.

Logging: The Civis joblib backend uses the standard library logging module, with debug emits for events which might help you diagnose errors. See also the “verbose” argument to joblib.Parallel, which prints information to either stdout or stderr.

Mismatches between your local environment and the environment in the Civis container script jobs are a common source of errors. To run a function in the Civis platform, any modules called by that function must be importable from a Python interpreter running in the container script. For example, if you use joblib.Parallel with numpy.sqrt(), the joblib backend must be set to run your function in a container which has numpy installed. If you see an error such as:

ModuleNotFoundError: No module named 'numpy'

this signifies that the function you’re trying to run doesn’t exist in the remote environment. Select a Docker container with the module installed, or install it in your remote environment by using the repo_http_uri parameter of make_backend_factory() to install it from GitHub.

Object Reference

Parallel computations using the Civis Platform infrastructure

exception civis.parallel.JobSubmissionError[source]
civis.parallel.infer_backend_factory(required_resources=None, params=None, arguments=None, client=None, polling_interval=None, setup_cmd=None, max_submit_retries=0, max_job_retries=0, hidden=True, remote_backend='sequential', **kwargs)[source]

Infer the container environment and return a backend factory.

This function helps you run additional jobs from code which executes inside a Civis container job. The function reads settings for relevant parameters (e.g. the Docker image) of the container it’s running inside of.

Jobs created through this backend will have environment variables “CIVIS_PARENT_JOB_ID” and “CIVIS_PARENT_RUN_ID” with the contents of the “CIVIS_JOB_ID” and “CIVIS_RUN_ID” of the environment which created them. If the code doesn’t have “CIVIS_JOB_ID” and “CIVIS_RUN_ID” environment variables available, the child will not have “CIVIS_PARENT_JOB_ID” and “CIVIS_PARENT_RUN_ID” environment variables.

Note

This function will read the state of the parent container job at the time this function executes. If the user has modified the container job since the run started (e.g. by changing the GitHub branch in the container’s GUI), this function may infer incorrect settings for the child jobs.

Keyword arguments inferred from the existing script’s state are [‘docker_image_name’, ‘docker_image_tag’, ‘repo_http_uri’, ‘repo_ref’, ‘remote_host_credential_id’, ‘git_credential_id’, ‘cancel_timeout’, ‘time_zone’]

Parameters
required_resourcesdict or None, optional

The resources needed by the container. See the container scripts API documentation <https://platform.civisanalytics.com/api#resources-scripts> for details. Resource requirements not specified will default to the requirements of the current job.

paramslist or None, optional

A definition of the parameters this script accepts in the arguments field. See the container scripts API documentation <https://platform.civisanalytics.com/api#resources-scripts> for details.

Parameters of the child jobs will default to the parameters of the current job. Any parameters provided here will override parameters of the same name from the current job.

argumentsdict or None, optional

Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params. See the container scripts API documentation <https://platform.civisanalytics.com/api#resources-scripts> for details.

Arguments will default to the arguments of the current job. Anything provided here will override portions of the current job’s arguments.

clientcivis.APIClient instance or None, optional

An API Client object to use.

polling_intervalint, optional

The polling interval, in seconds, for checking container script status. If you have many jobs, you may want to set this higher (e.g., 300) to avoid rate-limiting <https://platform.civisanalytics.com/api#basics>.

setup_cmdstr, optional

A shell command or sequence of commands for setting up the environment. These will precede the commands used to run functions in joblib. This is primarily for installing dependencies that are not available in the dockerhub repo (e.g., “cd /app && python setup.py install” or “pip install gensim”).

With no GitHub repo input, the setup command will default to a command that does nothing. If a repo_http_uri is provided, the default setup command will attempt to run “python setup.py install”. If this command fails, execution will still continue.

max_submit_retriesint, optional

The maximum number of retries for submitting each job. This is to help avoid a large set of jobs failing because of a single 5xx error. A value higher than zero should only be used for jobs that are idempotent (i.e., jobs whose result and side effects are the same regardless of whether they are run once or many times).

max_job_retriesint, optional

Retry failed jobs this number of times before giving up. Even more than with max_submit_retries, this should only be used for jobs which are idempotent, as the job may have caused side effects (if any) before failing. These retries assist with jobs which may have failed because of network or worker failures.

hidden: bool, optional

The hidden status of the object. Setting this to true hides it from most API endpoints. The object can still be queried directly by ID. Defaults to True.

remote_backendstr or object, optional

The name of a joblib backend or a joblib backend itself. This parameter is the joblib backend to use when executing code within joblib in the container. The default of ‘sequential’ uses the joblib sequential backend in the container. The value ‘civis’ uses an exact copy of the Civis joblib backend that launched the container. Note that with the value ‘civis’, one can potentially use more jobs than specified by n_jobs.

**kwargs:

Additional keyword arguments will be passed directly to post_containers(), potentially overriding the values of those arguments in the parent environment.

Raises
RuntimeError

If this function is not running inside a Civis container job.

civis.parallel.make_backend_factory(docker_image_name='civisanalytics/datascience-python', client=None, polling_interval=None, setup_cmd=None, max_submit_retries=0, max_job_retries=0, hidden=True, remote_backend='sequential', **kwargs)[source]

Create a joblib backend factory that uses Civis Container Scripts

Jobs created through this backend will have environment variables “CIVIS_PARENT_JOB_ID” and “CIVIS_PARENT_RUN_ID” with the contents of the “CIVIS_JOB_ID” and “CIVIS_RUN_ID” of the environment which created them. If the code doesn’t have “CIVIS_JOB_ID” and “CIVIS_RUN_ID” environment variables available, the child will not have “CIVIS_PARENT_JOB_ID” and “CIVIS_PARENT_RUN_ID” environment variables.

Note

The total size of function parameters in Parallel() calls on this backend must be less than 5 GB due to AWS file size limits.

Note

The maximum number of concurrent jobs in the Civis Platform is controlled by both the n_jobs and pre_dispatch parameters of joblib.Parallel. Set pre_dispatch="n_jobs" to have a maximum of n_jobs processes running at once. (The default is pre_dispatch="2*n_jobs".)

Parameters
docker_image_namestr, optional

The image for the container script. You may also wish to specify a docker_image_tag in the keyword arguments.

clientcivis.APIClient instance or None, optional

An API Client object to use.

polling_intervalint, optional

The polling interval, in seconds, for checking container script status. If you have many jobs, you may want to set this higher (e.g., 300) to avoid rate-limiting <https://platform.civisanalytics.com/api#basics>.

setup_cmdstr, optional

A shell command or sequence of commands for setting up the environment. These will precede the commands used to run functions in joblib. This is primarily for installing dependencies that are not available in the dockerhub repo (e.g., “cd /app && python setup.py install” or “pip install gensim”).

With no GitHub repo input, the setup command will default to a command that does nothing. If a repo_http_uri is provided, the default setup command will attempt to run “python setup.py install”. If this command fails, execution will still continue.

max_submit_retriesint, optional

The maximum number of retries for submitting each job. This is to help avoid a large set of jobs failing because of a single 5xx error. A value higher than zero should only be used for jobs that are idempotent (i.e., jobs whose result and side effects are the same regardless of whether they are run once or many times).

max_job_retriesint, optional

Retry failed jobs this number of times before giving up. Even more than with max_submit_retries, this should only be used for jobs which are idempotent, as the job may have caused side effects (if any) before failing. These retries assist with jobs which may have failed because of network or worker failures.

hidden: bool, optional

The hidden status of the object. Setting this to true hides it from most API endpoints. The object can still be queried directly by ID. Defaults to True.

remote_backendstr or object, optional

The name of a joblib backend or a joblib backend itself. This parameter is the joblib backend to use when executing code within joblib in the container. The default of ‘sequential’ uses the joblib sequential backend in the container. The value ‘civis’ uses an exact copy of the Civis joblib backend that launched the container. Note that with the value ‘civis’, one can potentially use more jobs than specified by n_jobs.

**kwargs:

Additional keyword arguments will be passed directly to post_containers().

See also

civis.APIClient.scripts.post_containers

Notes

Joblib’s joblib.parallel.register_parallel_backend() (see example above) expects a callable that returns a joblib.parallel.ParallelBackendBase instance. This function allows the user to specify the Civis container script setting that will be used when that backend creates container scripts to run jobs.

The specified Docker image (optionally, with a GitHub repo and setup command) must have basically the same environment as the one in which this module is used to submit jobs. The worker jobs need to be able to deserialize the jobs they are given, including the data and all the necessary Python objects (e.g., if you pass a Pandas data frame, the image must have Pandas installed). You may use functions and classes dynamically defined in the code (e.g. lambda functions), but if your joblib-parallized function calls code imported from another module, that module must be installed in the remote environment.

Examples

>>> # Without joblib:
>>> from math import sqrt
>>> print([sqrt(i ** 2) for i in range(10)])
[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
>>> # Using the default joblib backend:
>>> from joblib import delayed, Parallel
>>> parallel = Parallel(n_jobs=5)
>>> print(parallel(delayed(sqrt)(i ** 2) for i in range(10)))
[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
>>> # Using the Civis backend:
>>> from joblib import parallel_backend, register_parallel_backend
>>> from civis.parallel import make_backend_factory
>>> register_parallel_backend('civis', make_backend_factory(
...     required_resources={"cpu": 512, "memory": 256}))
>>> with parallel_backend('civis'):
...    parallel = Parallel(n_jobs=5, pre_dispatch='n_jobs')
...    print(parallel(delayed(sqrt)(i ** 2) for i in range(10)))
[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
>>> # Using scikit-learn with the Civis backend:
>>> from sklearn.externals.joblib import     ...     register_parallel_backend as sklearn_register_parallel_backend
>>> from sklearn.externals.joblib import     ...     parallel_backend as sklearn_parallel_backend
>>> from sklearn.model_selection import GridSearchCV
>>> from sklearn.ensemble import GradientBoostingClassifier
>>> from sklearn.datasets import load_digits
>>> digits = load_digits()
>>> param_grid = {
...     "max_depth": [1, 3, 5, None],
...     "max_features": ["sqrt", "log2", None],
...     "learning_rate": [0.1, 0.01, 0.001]
... }
>>> # Note: n_jobs and pre_dispatch specify the maximum number of
>>> # concurrent jobs.
>>> gs = GridSearchCV(GradientBoostingClassifier(n_estimators=1000,
...                                              random_state=42),
...                   param_grid=param_grid,
...                   n_jobs=5, pre_dispatch="n_jobs")
>>> sklearn_register_parallel_backend('civis', make_backend_factory(
...     required_resources={"cpu": 512, "memory": 256}))
>>> with sklearn_parallel_backend('civis'):
...     gs.fit(digits.data, digits.target)
civis.parallel.make_backend_template_factory(from_template_id, arguments=None, client=None, polling_interval=None, max_submit_retries=0, max_job_retries=0, hidden=True)[source]

Create a joblib backend factory that uses Civis Custom Scripts.

If your template has settable parameters “CIVIS_PARENT_JOB_ID” and “CIVIS_PARENT_RUN_ID”, then this executor will fill them with the contents of the “CIVIS_JOB_ID” and “CIVIS_RUN_ID” of the environment which created them. If the code doesn’t have “CIVIS_JOB_ID” and “CIVIS_RUN_ID” environment variables available, the child will not have “CIVIS_PARENT_JOB_ID” and “CIVIS_PARENT_RUN_ID” environment variables.

Parameters
from_template_id: int

Create jobs as Custom Scripts from the given template ID. When using the joblib backend with templates, the template must have a very specific form. Refer to the documentation for details.

argumentsdict or None, optional

Dictionary of name/value pairs to use to run this script. Only settable if this script has defined params. See the container scripts API documentation <https://platform.civisanalytics.com/api#resources-scripts> for details.

clientcivis.APIClient instance or None, optional

An API Client object to use.

polling_intervalint, optional

The polling interval, in seconds, for checking container script status. If you have many jobs, you may want to set this higher (e.g., 300) to avoid rate-limiting <https://platform.civisanalytics.com/api#basics>.

max_submit_retriesint, optional

The maximum number of retries for submitting each job. This is to help avoid a large set of jobs failing because of a single 5xx error. A value higher than zero should only be used for jobs that are idempotent (i.e., jobs whose result and side effects are the same regardless of whether they are run once or many times).

max_job_retriesint, optional

Retry failed jobs this number of times before giving up. Even more than with max_submit_retries, this should only be used for jobs which are idempotent, as the job may have caused side effects (if any) before failing. These retries assist with jobs which may have failed because of network or worker failures.

hidden: bool, optional

The hidden status of the object. Setting this to true hides it from most API endpoints. The object can still be queried directly by ID. Defaults to True.

API Client

APIClient is a class for handling requests to the Civis API. An instantiated APIClient contains a set of resources (listed below) where each resource is an object with methods. By convention, an instantiated APIClient object is named client and API requests are made with the following syntax:

client = civis.APIClient()
response = client.resource.method(params)

The methods on APIClient are created dynamically at runtime by parsing an collections.OrderedDict representation of the Civis API specification. The methods are generated based on the path and HTTP method used with each endpoint. For example, GET /workflows/1 can be accessed with client.workflows.get(1). GET endpoints that don’t end in a parameter use a list method instead. Below are examples of endpoints and how they map to API Client methods:

Endpoint

API Client Method

GET /workflows

client.workflows.list()

GET /workflows/1

client.workflows.get(1)

GET /workflows/1/executions

client.workflows.list_executions(1)

PATCH /workflows/1

client.workflows.patch(1, ...)

POST /workflows/1/executions

client.workflows.post_executions(1)

GET /workflows/1/executions/2

client.workflows.get_executions(1, 2)

Note that Python’s built-in help function can be used to see lists of available endpoints for a resource (e.g., help(client.workflows)) or to get documentation for a specific endpoint function (e.g., help(client.workflows.list)). The ? operator in IPython (e.g., ?client.workflows) and the shift-tab hotkey in a Jupyter notebook also cause documentation to be displayed.

By default, the Civis API specification specification is downloaded from the /endpoints endpoint the first time APIClient is instantiated (and cached in memory for the remainder of the program’s run). In some circumstances, it may be useful to use a local cache of the API specification rather than downloading the spec. This can be done by passing the specification to the client through the parameter local_api_spec as either the collections.OrderedDict or a filename where the specification has been saved.

api_key = os.environ['CIVIS_API_KEY']
spec = civis.resources.get_api_spec(api_key)

# From OrderedDict
client = civis.APIClient(local_api_spec=spec)

# From file
with open('local_api_spec.json', 'w') as f:
    json.dump(spec, f)
client = civis.APIClient(local_api_spec='local_api_spec.json')
class civis.APIClient(api_key=None, return_type='snake', retry_total=6, api_version='1.0', resources='all', local_api_spec=None)[source]

The Civis API client.

Parameters
api_keystr, optional

Your API key obtained from the Civis Platform. If not given, the client will use the CIVIS_API_KEY environment variable.

return_typestr, optional

The following types are implemented:

retry_totalDEPRECATED int, optional

A number indicating the maximum number of retries for 429, 502, 503, or 504 errors. This parameter no longer has any effect since v1.15.0, as retries are automatically handled. This parameter will be removed at version 2.0.0.

api_versionstring, optional

The version of endpoints to call. May instantiate multiple client objects with different versions. Currently only “1.0” is supported.

resourcesstring, optional

When set to “base”, only the default endpoints will be exposed in the client object. Set to “all” to include all endpoints available for a given user, including those that may be in development and subject to breaking changes at a later date. This will be removed in a future version of the API client.

local_api_speccollections.OrderedDict or string, optional

The methods on this class are dynamically built from the Civis API specification, which can be retrieved from the /endpoints endpoint. When local_api_spec is None, the default, this specification is downloaded the first time APIClient is instantiated. Alternatively, a local cache of the specification may be passed as either an OrderedDict or a filename which points to a json file.

Attributes
admin

An instance of the Admin endpoint

aliases

An instance of the Aliases endpoint

announcements

An instance of the Announcements endpoint

clusters

An instance of the Clusters endpoint

credentials

An instance of the Credentials endpoint

databases

An instance of the Databases endpoint

endpoints

An instance of the Endpoints endpoint

enhancements

An instance of the Enhancements endpoint

exports

An instance of the Exports endpoint

files

An instance of the Files endpoint

git_repos

An instance of the Git_Repos endpoint

groups

An instance of the Groups endpoint

imports

An instance of the Imports endpoint

jobs

An instance of the Jobs endpoint

json_values

An instance of the Json_Values endpoint

match_targets

An instance of the Match_Targets endpoint

media

An instance of the Media endpoint

models

An instance of the Models endpoint

notebooks

An instance of the Notebooks endpoint

notifications

An instance of the Notifications endpoint

ontology

An instance of the Ontology endpoint

permission_sets

An instance of the Permission_Sets endpoint

predictions

An instance of the Predictions endpoint

projects

An instance of the Projects endpoint

queries

An instance of the Queries endpoint

remote_hosts

An instance of the Remote_Hosts endpoint

reports

An instance of the Reports endpoint

roles

An instance of the Roles endpoint

saml_service_providers

An instance of the Saml_Service_Providers endpoint

scripts

An instance of the Scripts endpoint

search

An instance of the Search endpoint

services

An instance of the Services endpoint

storage_hosts

An instance of the Storage_Hosts endpoint

table_tags

An instance of the Table_Tags endpoint

tables

An instance of the Tables endpoint

templates

An instance of the Templates endpoint

users

An instance of the Users endpoint

workflows

An instance of the Workflows endpoint

Methods

get_aws_credential_id(cred_name[, owner])

Find an AWS credential ID.

get_database_credential_id(username, ...)

Return the credential ID for a given username in a given database.

get_database_id(database)

Return the database ID for a given database name.

get_storage_host_id(storage_host)

Return the storage host ID for a given storage host name.

get_table_id(table, database)

Return the table ID for a given database and table name.

property default_credential

The current user’s default credential.

get_aws_credential_id(cred_name, owner=None)

Find an AWS credential ID.

Parameters
cred_namestr or int

If an integer ID is given, this passes through directly. If a str is given, return the ID corresponding to the AWS credential with that name.

ownerstr, optional

Return the credential with this owner. If not provided, search for credentials under your username to disambiguate multiple credentials with the same name. Note that this function cannot return credentials which are not associated with an owner.

Returns
aws_credential_idint

The ID number of the AWS credentials.

Raises
ValueError

If the AWS credential can’t be found.

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.get_aws_credential_id('jsmith')
1234
>>> client.get_aws_credential_id(1111)
1111
>>> client.get_aws_credential_id('shared-cred',
...                              owner='research-group')
99
get_database_credential_id(username, database_name)

Return the credential ID for a given username in a given database.

Parameters
usernamestr or int

If an integer ID is given, this passes through directly. If a str is given, return the ID corresponding to the database credential with that username.

database_namestr or int

Return the ID of the database credential with username username for this database name or ID.

Returns
database_credential_idint

The ID of the database credentials.

Raises
ValueError

If the credential can’t be found.

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.get_database_credential_id('jsmith', 'redshift-general')
1234
>>> client.get_database_credential_id(1111, 'redshift-general')
1111
get_database_id(database)

Return the database ID for a given database name.

Parameters
databasestr or int

If an integer ID is given, passes through. If a str is given the database ID corresponding to that database name is returned.

Returns
database_idint

The ID of the database.

Raises
ValueError

If the database can’t be found.

get_storage_host_id(storage_host)

Return the storage host ID for a given storage host name.

Parameters
storage_hoststr or int

If an integer ID is given, passes through. If a str is given the storage host ID corresponding to that storage host is returned.

Returns
storage_host_idint

The ID of the storage host.

Raises
ValueError

If the storage host can’t be found.

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.get_storage_host_id('test host')
1234
>>> client.get_storage_host_id(1111)
1111
get_table_id(table, database)

Return the table ID for a given database and table name.

Parameters
tablestr

The name of the table in format schema.tablename. Either schema or tablename, or both, can be double-quoted to correctly parse special characters (such as ‘.’).

databasestr or int

The name or ID of the database.

Returns
table_idint

The ID of the table.

Raises
ValueError

If a table match can’t be found.

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.get_table_id('foo.bar', 'redshift-general')
123
>>> client.get_table_id('"schema.has.periods".bar', 'redshift-general')
456
property username

The current user’s username.

API Responses

Response Types
class civis.response.Response(json_data, snake_case=True, headers=None)[source]

Custom Civis response object.

Notes

The main features of this class are that it maps camelCase to snake_case at the top level of the json object and attaches keys as attributes. Nested object keys are not changed.

Attributes
json_datadict | None

This is json_data as it is originally returned to the user without the key names being changed. See Notes. None is used if the original response returned a 204 No Content response.

headersdict

This is the header for the API call without changing the key names.

calls_remainingint

Number of API calls remaining before rate limit is reached.

rate_limitint

Total number of calls per API rate limit period.

Methods

clear()

copy()

fromkeys(iterable[, value])

Create a new dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

items()

keys()

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised

popitem()

2-tuple; but raise KeyError if D is empty.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()

class civis.response.PaginatedResponse(path, initial_params, endpoint)[source]

A response object which is an iterator

Parameters
pathstr

Make GET requests to this path.

initial_paramsdict

Query params that should be passed along with each request. Note that if initial_params contains the keys page_num or limit, they will be ignored. The given dict is not modified.

endpointcivis.base.Endpoint

An endpoint used to make API requests.

Notes

This response is returned automatically by endpoints which support pagination when the iterator kwarg is specified.

Examples

>>> client = civis.APIClient()
>>> queries = client.queries.list(iterator=True)
>>> for query in queries:
...    print(query['id'])
class civis.futures.CivisFuture(poller, poller_args, polling_interval=None, api_key=None, client=None, poll_on_creation=True)[source]

A class for tracking future results.

This is a subclass of concurrent.futures.Future from the Python standard library. See: https://docs.python.org/3/library/concurrent.futures.html

Parameters
pollerfunc

A function which returns an object that has a state attribute.

poller_argstuple

The arguments with which to call the poller function.

polling_intervalint or float, optional

The number of seconds between API requests to check whether a result is ready.

api_keyDEPRECATED str, optional

Your Civis API key. If not given, the CIVIS_API_KEY environment variable will be used.

clientcivis.APIClient, optional
poll_on_creationbool, optional

If True (the default), it will poll upon calling result() the first time. If False, it will wait the number of seconds specified in polling_interval from object creation before polling.

Examples

This example is provided as a function at query_civis().

>>> client = civis.APIClient()
>>> database_id = client.get_database_id("my_database")
>>> cred_id = client.default_credential
>>> sql = "SELECT 1"
>>> preview_rows = 10
>>> response = client.queries.post(database_id, sql, preview_rows,
>>>                                credential=cred_id)
>>>
>>> poller = client.queries.get_runs
>>> poller_args = response.id, response.last_run_id
>>> polling_interval = 10
>>> future = CivisFuture(poller, poller_args, polling_interval)
>>> future.job_id == response.id
True
>>> future.run_id == response.last_run_id
True
Attributes
job_idint

First element of the tuple given to poller_args

run_idint or None

Second element of the tuple given to poller_args (None if the poller function does not require a run ID)

Methods

add_done_callback(fn)

Attaches a callable that will be called when the future finishes.

cancel()

Not currently implemented.

cancelled()

Return True if the future was cancelled.

done()

Return True of the future was cancelled or finished executing.

exception([timeout])

Return the exception raised by the call that the future represents.

failed()

Return True if the Civis job failed.

outputs()

Block on job completion and return a list of run outputs.

result([timeout])

Return the result of the call that the future represents.

running()

Return True if the future is currently executing.

set_exception(exception)

Sets the result of the future as being the given exception.

set_result(result)

Sets the return value of work associated with the future.

set_running_or_notify_cancel()

Mark the future as running or process any cancel notifications.

succeeded()

Return True if the job completed in Civis with no error.

cleanup

outputs()[source]

Block on job completion and return a list of run outputs.

The method will only return run outputs for successful jobs. Failed jobs will raise an exception.

Returns
list[dict]

List of run outputs from a successfully completed job.

Raises
civis.base.CivisJobFailure

If the job fails.

Helper Functions
civis.find(object_list, filter_func=None, **kwargs)[source]

Filter civis.response.Response objects.

Parameters
object_listiterable

An iterable of arbitrary objects, particularly those with attributes that can be targeted by the filters in kwargs. A major use case is an iterable of civis.response.Response objects.

filter_funccallable, optional

A one-argument function. If specified, kwargs are ignored. An object from the input iterable is kept in the returned list if and only if bool(filter_func(object)) is True.

**kwargs

Key-value pairs for more fine-grained filtering; they cannot be used in conjunction with filter_func. All keys must be strings. For an object from the input iterable to be included in the returned list, all the key`s must be attributes of `object, plus any one of the following conditions for a given key:

  • value is a one-argument function and bool(value(getattr(object, key))) is True

  • value is True

  • getattr(object, key) is equal to value

Returns
list

See also

civis.find_one

Examples

>>> import civis
>>> client = civis.APIClient()
>>> # creds is a list of civis.response.Response objects
>>> creds = client.credentials.list()
>>> # target_creds contains civis.response.Response objects
>>> # with the attribute 'name' == 'username'
>>> target_creds = find(creds, name='username')
civis.find_one(object_list, filter_func=None, **kwargs)[source]

Return one satisfying civis.response.Response object.

The arguments are the same as those for civis.find(). If more than one object satisfies the filtering criteria, the first one is returned. If no satisfying objects are found, None is returned.

Returns
object or None

See also

civis.find

API Resources

Admin
class Admin(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.admin.list_announcements(...)

Methods

delete_announcements(id)

Delete an announcement

get_announcements(id)

Get a particular announcement

list_announcements(*[, limit, page_num, ...])

List announcements

list_organizations(*[, status, org_type])

List organizations

patch_announcements(id, *[, subject, body, ...])

Edit an announcement

patch_themes(id, *[, name, ...])

Edit a theme

post_announcements(subject, body, *[, ...])

Post an announcement

post_themes(name, settings_json, *[, ...])

Create a theme

delete_announcements(id)

Delete an announcement

Parameters
idinteger

The ID of this announcement

Returns
None

Response code 204: success

get_announcements(id)

Get a particular announcement

Parameters
idinteger

The ID of this announcement

Returns
civis.response.Response
  • idinteger

    The ID of this announcement

  • subjectstring

    The subject of this announcement.

  • bodystring

    The body of this announcement.

  • released_atstring/date-time

    The date and time this announcement was released.

  • created_at : string/date-time

  • updated_at : string/date-time

list_announcements(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List announcements

Parameters
limitinteger, optional

Number of results to return. Defaults to 10. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to released_at. Must be one of: released_at.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of this announcement

  • subjectstring

    The subject of this announcement.

  • bodystring

    The body of this announcement.

  • released_atstring/date-time

    The date and time this announcement was released.

  • created_at : string/date-time

  • updated_at : string/date-time

list_organizations(*, status='DEFAULT', org_type='DEFAULT')

List organizations

Parameters
statusarray, optional

The status of the organization (active/trial/inactive).

org_typearray, optional

The organization type (platform/ads/survey_vendor/other).

Returns
civis.response.Response
  • idinteger

    The ID of this organization.

  • namestring

    The name of this organization.

  • slugstring

    The slug of this organization.

  • account_manager_idinteger

    The user ID of the Account Manager.

  • cs_specialist_idinteger

    The user ID of the Client Success Specialist.

  • statusstring

    The status of the organization (active/trial/inactive).

  • org_typestring

    The organization type (platform/ads/survey_vendor/other).

  • custom_brandingstring

    The custom branding settings.

  • contract_sizeinteger

    The monthly contract size.

  • max_analyst_usersinteger

    The max number of full platform users for the org.

  • max_report_usersinteger

    The max number of report-only platform users for the org.

  • verticalstring

    The business vertical that the organization belongs to.

  • cs_metadatastring

    Additional metadata about the organization in JSON format.

  • remove_footer_in_emailsboolean

    If true, emails sent by platform will not include Civis text.

  • salesforce_account_idstring

    The SalesForce Account ID for this organization.

  • tableau_site_idstring

    The Tableau Site ID for this organization.

  • fedramp_enabledboolean

    Flag denoting whether this organization is FedRAMP compliant.

  • created_by_idinteger

    The ID of the user who created this organization

  • last_updated_by_idinteger

    The ID of the user who last updated this organization

  • advanced_settingsdict::
    • dedicated_dj_pool_enabledboolean

      If true, the Organization has a dedicated delayed jobs pool. Defaults to false.

  • tableau_refresh_historylist

    The number of tableau refreshes used this month.

patch_announcements(id, *, subject='DEFAULT', body='DEFAULT', released_at='DEFAULT')

Edit an announcement

Parameters
idinteger

The ID of this announcement

subjectstring, optional

The subject of this announcement.

bodystring, optional

The body of this announcement.

released_atstring/date-time, optional

The date and time this announcement was released.

Returns
civis.response.Response
  • idinteger

    The ID of this announcement

  • subjectstring

    The subject of this announcement.

  • bodystring

    The body of this announcement.

  • released_atstring/date-time

    The date and time this announcement was released.

  • created_at : string/date-time

  • updated_at : string/date-time

patch_themes(id, *, name='DEFAULT', organization_ids='DEFAULT', settings_json='DEFAULT', logo_file_id='DEFAULT')

Edit a theme

Parameters
idinteger

The ID of this theme.

namestring, optional

The name of this theme.

organization_idslist, optional

List of organization ID’s allowed to see this theme.

settings_jsonstring, optional

The JSON-encoded theme configuration.

logo_file_idstring, optional

The ID of the logo image file.

Returns
civis.response.Response
  • idinteger

    The ID of this theme.

  • namestring

    The name of this theme.

  • organization_idslist

    List of organization ID’s allowed to use this theme.

  • settingsstring

    The theme configuration object.

  • logo_filedict::
    • idinteger

      The ID of the logo image file.

    • download_urlstring

      The URL of the logo image file.

  • created_at : string/date-time

  • updated_at : string/date-time

post_announcements(subject, body, *, released_at='DEFAULT')

Post an announcement

Parameters
subjectstring

The subject of this announcement.

bodystring

The body of this announcement.

released_atstring/date-time, optional

The date and time this announcement was released.

Returns
civis.response.Response
  • idinteger

    The ID of this announcement

  • subjectstring

    The subject of this announcement.

  • bodystring

    The body of this announcement.

  • released_atstring/date-time

    The date and time this announcement was released.

  • created_at : string/date-time

  • updated_at : string/date-time

post_themes(name, settings_json, *, organization_ids='DEFAULT', logo_file_id='DEFAULT')

Create a theme

Parameters
namestring

The name of this theme.

settings_jsonstring

The JSON-encoded theme configuration.

organization_idslist, optional

List of organization ID’s allowed to see this theme.

logo_file_idstring, optional

The ID of the logo image file.

Returns
civis.response.Response
  • idinteger

    The ID of this theme.

  • namestring

    The name of this theme.

  • organization_idslist

    List of organization ID’s allowed to use this theme.

  • settingsstring

    The theme configuration object.

  • logo_filedict::
    • idinteger

      The ID of the logo image file.

    • download_urlstring

      The URL of the logo image file.

  • created_at : string/date-time

  • updated_at : string/date-time

Aliases
class Aliases(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.aliases.list_shares(...)

Methods

delete(id)

Delete an alias

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get an Alias

get_object_type(object_type, alias)

Get details about an alias within an FCO type

list(*[, object_type, limit, page_num, ...])

List Aliases

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, object_id, object_type, ...])

Update some attributes of this Alias

post(object_id, object_type, alias, *[, ...])

Create an Alias

put(id, object_id, object_type, alias, *[, ...])

Replace all attributes of this Alias

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete(id)

Delete an alias

Parameters
idinteger

The id of the Alias object.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get an Alias

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The id of the Alias object.

  • object_idinteger

    The id of the object

  • object_typestring

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstring

    The alias of the object

  • user_idinteger

    The id of the user who created the alias

  • display_namestring

    The display name of the Alias object. Defaults to object name if not provided.

get_object_type(object_type, alias)

Get details about an alias within an FCO type

Parameters
object_typestring

The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

aliasstring

The alias of the object

Returns
civis.response.Response
  • idinteger

    The id of the Alias object.

  • object_idinteger

    The id of the object

  • object_typestring

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstring

    The alias of the object

  • user_idinteger

    The id of the user who created the alias

  • display_namestring

    The display name of the Alias object. Defaults to object name if not provided.

list(*, object_type='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Aliases

Parameters
object_typestring, optional

Filter results by object type. Pass multiple object types with a comma- separatedlist. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id, object_type.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The id of the Alias object.

  • object_idinteger

    The id of the object

  • object_typestring

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstring

    The alias of the object

  • user_idinteger

    The id of the user who created the alias

  • display_namestring

    The display name of the Alias object. Defaults to object name if not provided.

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id, *, object_id='DEFAULT', object_type='DEFAULT', alias='DEFAULT', display_name='DEFAULT')

Update some attributes of this Alias

Parameters
idinteger

The id of the Alias object.

object_idinteger, optional

The id of the object

object_typestring, optional

The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

aliasstring, optional

The alias of the object

display_namestring, optional

The display name of the Alias object. Defaults to object name if not provided.

Returns
civis.response.Response
  • idinteger

    The id of the Alias object.

  • object_idinteger

    The id of the object

  • object_typestring

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstring

    The alias of the object

  • user_idinteger

    The id of the user who created the alias

  • display_namestring

    The display name of the Alias object. Defaults to object name if not provided.

post(object_id, object_type, alias, *, display_name='DEFAULT')

Create an Alias

Parameters
object_idinteger

The id of the object

object_typestring

The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

aliasstring

The alias of the object

display_namestring, optional

The display name of the Alias object. Defaults to object name if not provided.

Returns
civis.response.Response
  • idinteger

    The id of the Alias object.

  • object_idinteger

    The id of the object

  • object_typestring

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstring

    The alias of the object

  • user_idinteger

    The id of the user who created the alias

  • display_namestring

    The display name of the Alias object. Defaults to object name if not provided.

put(id, object_id, object_type, alias, *, display_name='DEFAULT')

Replace all attributes of this Alias

Parameters
idinteger

The id of the Alias object.

object_idinteger

The id of the object

object_typestring

The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

aliasstring

The alias of the object

display_namestring, optional

The display name of the Alias object. Defaults to object name if not provided.

Returns
civis.response.Response
  • idinteger

    The id of the Alias object.

  • object_idinteger

    The id of the object

  • object_typestring

    The type of the object. Valid types include: cass_ncoa, container_script, geocode, python_script, r_script, salesforce_export, javascript_script, sql_script, project, notebook, workflow, template_script, template_report, service, report, tableau and service_report.

  • aliasstring

    The alias of the object

  • user_idinteger

    The id of the user who created the alias

  • display_namestring

    The display name of the Alias object. Defaults to object name if not provided.

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Announcements
class Announcements(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.announcements.list(...)

Methods

list(*[, limit, page_num, order, order_dir, ...])

List announcements

list(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List announcements

Parameters
limitinteger, optional

Number of results to return. Defaults to 10. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to released_at. Must be one of: released_at.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of this announcement

  • subjectstring

    The subject of this announcement.

  • bodystring

    The body of this announcement.

  • released_atstring/date-time

    The date and time this announcement was released.

  • created_at : string/date-time

  • updated_at : string/date-time

Clusters
class Clusters(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.clusters.list_kubernetes(...)

Methods

delete_kubernetes_partitions(id, ...)

Delete a Cluster Partition

get_kubernetes(id, *[, include_usage_stats])

Describe a Kubernetes Cluster

get_kubernetes_instance_configs(...[, ...])

Describe an Instance Config

get_kubernetes_partitions(id, ...[, ...])

Describe a Cluster Partition

list_kubernetes(*[, organization_slug, ...])

List Kubernetes Clusters

list_kubernetes_deployment_stats(id)

Get stats about deployments associated with a Kubernetes Cluster

list_kubernetes_deployments(id, *[, ...])

List the deployments associated with a Kubernetes Cluster

list_kubernetes_instance_configs_active_workloads(id, *)

List active workloads in an Instance Config

list_kubernetes_instance_configs_historical_graphs(...)

Get graphs of historical resource usage in an Instance Config

list_kubernetes_instance_configs_user_statistics(...)

Get statistics about the current users of an Instance Config

list_kubernetes_partitions(id, *[, ...])

List Cluster Partitions for given cluster

patch_kubernetes(id, *[, raw_cluster_slug, ...])

Update a Kubernetes Cluster

patch_kubernetes_partitions(id, ...[, ...])

Update a Cluster Partition

post_kubernetes(*[, organization_id, ...])

Create a Kubernetes Cluster

post_kubernetes_partitions(id, ...)

Create a Cluster Partition for given cluster

delete_kubernetes_partitions(id, cluster_partition_id)

Delete a Cluster Partition

Parameters
idinteger

The ID of the cluster which this partition belongs to.

cluster_partition_idinteger

The ID of this cluster partition.

Returns
None

Response code 204: success

get_kubernetes(id, *, include_usage_stats='DEFAULT')

Describe a Kubernetes Cluster

Parameters
idinteger
include_usage_statsboolean, optional

When true, usage stats are returned in instance config objects. Defaults to false.

Returns
civis.response.Response
  • idinteger

    The ID of this cluster.

  • organization_idstring

    The id of this cluster’s organization.

  • organization_namestring

    The name of this cluster’s organization.

  • organization_slugstring

    The slug of this cluster’s organization.

  • raw_cluster_slugstring

    The slug of this cluster’s raw configuration.

  • custom_partitionsboolean

    Whether this cluster has a custom partition configuration.

  • cluster_partitionslist::

    List of cluster partitions associated with this cluster. - cluster_partition_id : integer

    The ID of this cluster partition.

    • namestring

      The name of the cluster partition.

    • labelslist

      Labels associated with this partition.

    • instance_configslist::

      The instances configured for this cluster partition. - instance_config_id : integer

      The ID of this InstanceConfig.

      • instance_typestring

        An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

      • min_instancesinteger

        The minimum number of instances of that type in this cluster.

      • max_instancesinteger

        The maximum number of instances of that type in this cluster.

      • instance_max_memoryinteger

        The amount of memory (RAM) available to a single instance of that type in megabytes.

      • instance_max_cpuinteger

        The number of processor shares available to a single instance of that type in millicores.

      • instance_max_diskinteger

        The amount of disk available to a single instance of that type in gigabytes.

      • usage_statsdict::
        • pending_memory_requestedinteger

          The sum of memory requests (in MB) for pending deployments in this instance config.

        • pending_cpu_requestedinteger

          The sum of cpu requests (in millicores) for pending deployments in this instance config.

        • running_memory_requestedinteger

          The sum of memory requests (in MB) for running deployments in this instance config.

        • running_cpu_requestedinteger

          The sum of cpu requests (in millicores) for running deployments in this instance config.

        • pending_deploymentsinteger

          The number of pending deployments in this instance config.

        • running_deploymentsinteger

          The number of running deployments in this instance config.

    • default_instance_config_idinteger

      The id of the InstanceConfig that is the default for this partition.

  • is_nat_enabledboolean

    Whether this cluster needs a NAT gateway or not.

  • hoursnumber/float

    The number of hours used this month for this cluster.

get_kubernetes_instance_configs(instance_config_id, *, include_usage_stats='DEFAULT')

Describe an Instance Config

Parameters
instance_config_idinteger

The ID of this instance config.

include_usage_statsboolean, optional

When true, usage stats are returned in instance config objects. Defaults to false.

Returns
civis.response.Response
  • instance_config_idinteger

    The ID of this InstanceConfig.

  • instance_typestring

    An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

  • min_instancesinteger

    The minimum number of instances of that type in this cluster.

  • max_instancesinteger

    The maximum number of instances of that type in this cluster.

  • instance_max_memoryinteger

    The amount of memory (RAM) available to a single instance of that type in megabytes.

  • instance_max_cpuinteger

    The number of processor shares available to a single instance of that type in millicores.

  • instance_max_diskinteger

    The amount of disk available to a single instance of that type in gigabytes.

  • usage_statsdict::
    • pending_memory_requestedinteger

      The sum of memory requests (in MB) for pending deployments in this instance config.

    • pending_cpu_requestedinteger

      The sum of cpu requests (in millicores) for pending deployments in this instance config.

    • running_memory_requestedinteger

      The sum of memory requests (in MB) for running deployments in this instance config.

    • running_cpu_requestedinteger

      The sum of cpu requests (in millicores) for running deployments in this instance config.

    • pending_deploymentsinteger

      The number of pending deployments in this instance config.

    • running_deploymentsinteger

      The number of running deployments in this instance config.

  • cluster_partition_idinteger

    The ID of this InstanceConfig’s cluster partition

  • cluster_partition_namestring

    The name of this InstanceConfig’s cluster partition

get_kubernetes_partitions(id, cluster_partition_id, *, include_usage_stats='DEFAULT')

Describe a Cluster Partition

Parameters
idinteger

The ID of the cluster which this partition belongs to.

cluster_partition_idinteger

The ID of this cluster partition.

include_usage_statsboolean, optional

When true, usage stats are returned in instance config objects. Defaults to false.

Returns
civis.response.Response
  • cluster_partition_idinteger

    The ID of this cluster partition.

  • namestring

    The name of the cluster partition.

  • labelslist

    Labels associated with this partition.

  • instance_configslist::

    The instances configured for this cluster partition. - instance_config_id : integer

    The ID of this InstanceConfig.

    • instance_typestring

      An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

    • min_instancesinteger

      The minimum number of instances of that type in this cluster.

    • max_instancesinteger

      The maximum number of instances of that type in this cluster.

    • instance_max_memoryinteger

      The amount of memory (RAM) available to a single instance of that type in megabytes.

    • instance_max_cpuinteger

      The number of processor shares available to a single instance of that type in millicores.

    • instance_max_diskinteger

      The amount of disk available to a single instance of that type in gigabytes.

    • usage_statsdict::
      • pending_memory_requestedinteger

        The sum of memory requests (in MB) for pending deployments in this instance config.

      • pending_cpu_requestedinteger

        The sum of cpu requests (in millicores) for pending deployments in this instance config.

      • running_memory_requestedinteger

        The sum of memory requests (in MB) for running deployments in this instance config.

      • running_cpu_requestedinteger

        The sum of cpu requests (in millicores) for running deployments in this instance config.

      • pending_deploymentsinteger

        The number of pending deployments in this instance config.

      • running_deploymentsinteger

        The number of running deployments in this instance config.

  • default_instance_config_idinteger

    The id of the InstanceConfig that is the default for this partition.

list_kubernetes(*, organization_slug='DEFAULT', raw_cluster_slug='DEFAULT', exclude_inactive_orgs='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Kubernetes Clusters

Parameters
organization_slugstring, optional

The slug of this cluster’s organization.

raw_cluster_slugstring, optional

The slug of this cluster’s raw configuration.

exclude_inactive_orgsboolean, optional

When true, excludes KubeClusters associated with inactive orgs. Defaults to false.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of this cluster.

  • organization_idstring

    The id of this cluster’s organization.

  • organization_namestring

    The name of this cluster’s organization.

  • organization_slugstring

    The slug of this cluster’s organization.

  • raw_cluster_slugstring

    The slug of this cluster’s raw configuration.

  • custom_partitionsboolean

    Whether this cluster has a custom partition configuration.

  • cluster_partitionslist::

    List of cluster partitions associated with this cluster. - cluster_partition_id : integer

    The ID of this cluster partition.

    • namestring

      The name of the cluster partition.

    • labelslist

      Labels associated with this partition.

    • instance_configslist::

      The instances configured for this cluster partition. - instance_config_id : integer

      The ID of this InstanceConfig.

      • instance_typestring

        An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

      • min_instancesinteger

        The minimum number of instances of that type in this cluster.

      • max_instancesinteger

        The maximum number of instances of that type in this cluster.

      • instance_max_memoryinteger

        The amount of memory (RAM) available to a single instance of that type in megabytes.

      • instance_max_cpuinteger

        The number of processor shares available to a single instance of that type in millicores.

      • instance_max_diskinteger

        The amount of disk available to a single instance of that type in gigabytes.

      • usage_statsdict::
        • pending_memory_requestedinteger

          The sum of memory requests (in MB) for pending deployments in this instance config.

        • pending_cpu_requestedinteger

          The sum of cpu requests (in millicores) for pending deployments in this instance config.

        • running_memory_requestedinteger

          The sum of memory requests (in MB) for running deployments in this instance config.

        • running_cpu_requestedinteger

          The sum of cpu requests (in millicores) for running deployments in this instance config.

        • pending_deploymentsinteger

          The number of pending deployments in this instance config.

        • running_deploymentsinteger

          The number of running deployments in this instance config.

    • default_instance_config_idinteger

      The id of the InstanceConfig that is the default for this partition.

  • is_nat_enabledboolean

    Whether this cluster needs a NAT gateway or not.

list_kubernetes_deployment_stats(id)

Get stats about deployments associated with a Kubernetes Cluster

Parameters
idinteger

The ID of this cluster.

Returns
civis.response.Response
  • base_typestring

    The base type of this deployment

  • statestring

    State of the deployment

  • countinteger

    Number of deployments of base type and state

  • total_cpuinteger

    Total amount of CPU in millicores for deployments of base type and state

  • total_memoryinteger

    Total amount of Memory in megabytes for deployments of base type and state

list_kubernetes_deployments(id, *, base_type='DEFAULT', state='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the deployments associated with a Kubernetes Cluster

Parameters
idinteger

The id of the cluster.

base_typestring, optional

If specified, return deployments of these base types. It accepts a comma- separated list, possible values are ‘Notebook’, ‘Service’, ‘Run’.

statestring, optional

If specified, return deployments in these states. It accepts a comma- separated list, possible values are pending, running, terminated, sleeping

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The id of this deployment.

  • namestring

    The name of the deployment.

  • base_idinteger

    The id of the base object associated with the deployment.

  • base_typestring

    The base type of this deployment.

  • statestring

    The state of the deployment.

  • cpuinteger

    The CPU in millicores required by the deployment.

  • memoryinteger

    The memory in MB required by the deployment.

  • disk_spaceinteger

    The disk space in GB required by the deployment.

  • instance_typestring

    The EC2 instance type requested for the deployment.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • max_memory_usagenumber/float

    If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

  • max_cpu_usagenumber/float

    If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

  • created_at : string/time

  • updated_at : string/time

list_kubernetes_instance_configs_active_workloads(id, *, state='DEFAULT')

List active workloads in an Instance Config

Parameters
idinteger

The id of the instance config.

statestring, optional

If specified, return workloads in these states. It accepts a comma- separated list, possible values are pending, running

Returns
civis.response.Response
  • idinteger

    The id of this deployment.

  • base_typestring

    The base type of this deployment.

  • base_idinteger

    The id of the base object associated with this deployment.

  • base_object_namestring

    The name of the base object associated with this deployment. Null if you do not have permission to read the object.

  • job_typestring

    If the base object is a job run you have permission to read, the type of the job. One of “python_script”, “r_script”, “container_script”, or “custom_script”.

  • job_idinteger

    If the base object is a job run you have permission to read, the id of the job.

  • job_cancel_requested_atstring/time

    If the base object is a job run you have permission to read, and it was requested to be cancelled, the timestamp of that request.

  • statestring

    The state of this deployment.

  • cpuinteger

    The CPU in millicores requested by this deployment.

  • memoryinteger

    The memory in MB requested by this deployment.

  • disk_spaceinteger

    The disk space in GB requested by this deployment.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_atstring/time

    The timestamp of when the deployment began.

  • cancellableboolean

    True if you have permission to cancel this deployment.

list_kubernetes_instance_configs_historical_graphs(instance_config_id, *, timeframe='DEFAULT')

Get graphs of historical resource usage in an Instance Config

Parameters
instance_config_idinteger

The ID of this instance config.

timeframestring, optional

The span of time that the graphs cover. Must be one of 1_day, 1_week.

Returns
civis.response.Response
  • cpu_graph_urlstring

    URL for the graph of historical CPU usage in this instance config.

  • mem_graph_urlstring

    URL for the graph of historical memory usage in this instance config.

list_kubernetes_instance_configs_user_statistics(instance_config_id, *, order='DEFAULT', order_dir='DEFAULT')

Get statistics about the current users of an Instance Config

Parameters
instance_config_idinteger

The ID of this instance config.

orderstring, optional

The field on which to order the result set. Defaults to running_deployments. Must be one of pending_memory_requested, pending_cpu_requested, running_memory_requested, running_cpu_requested, pending_deployments, running_deployments.

order_dirstring, optional

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

Returns
civis.response.Response
  • user_idstring

    The owning user’s ID

  • user_namestring

    The owning user’s name

  • pending_deploymentsinteger

    The number of deployments belonging to the owning user in “pending” state

  • pending_memory_requestedinteger

    The sum of memory requests (in MB) for deployments belonging to the owning user in “pending” state

  • pending_cpu_requestedinteger

    The sum of CPU requests (in millicores) for deployments belonging to the owning user in “pending” state

  • running_deploymentsinteger

    The number of deployments belonging to the owning user in “running” state

  • running_memory_requestedinteger

    The sum of memory requests (in MB) for deployments belonging to the owning user in “running” state

  • running_cpu_requestedinteger

    The sum of CPU requests (in millicores) for deployments belonging to the owning user in “running” state

list_kubernetes_partitions(id, *, include_usage_stats='DEFAULT')

List Cluster Partitions for given cluster

Parameters
idinteger
include_usage_statsboolean, optional

When true, usage stats are returned in instance config objects. Defaults to false.

Returns
civis.response.Response
  • cluster_partition_idinteger

    The ID of this cluster partition.

  • namestring

    The name of the cluster partition.

  • labelslist

    Labels associated with this partition.

  • instance_configslist::

    The instances configured for this cluster partition. - instance_config_id : integer

    The ID of this InstanceConfig.

    • instance_typestring

      An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

    • min_instancesinteger

      The minimum number of instances of that type in this cluster.

    • max_instancesinteger

      The maximum number of instances of that type in this cluster.

    • instance_max_memoryinteger

      The amount of memory (RAM) available to a single instance of that type in megabytes.

    • instance_max_cpuinteger

      The number of processor shares available to a single instance of that type in millicores.

    • instance_max_diskinteger

      The amount of disk available to a single instance of that type in gigabytes.

    • usage_statsdict::
      • pending_memory_requestedinteger

        The sum of memory requests (in MB) for pending deployments in this instance config.

      • pending_cpu_requestedinteger

        The sum of cpu requests (in millicores) for pending deployments in this instance config.

      • running_memory_requestedinteger

        The sum of memory requests (in MB) for running deployments in this instance config.

      • running_cpu_requestedinteger

        The sum of cpu requests (in millicores) for running deployments in this instance config.

      • pending_deploymentsinteger

        The number of pending deployments in this instance config.

      • running_deploymentsinteger

        The number of running deployments in this instance config.

  • default_instance_config_idinteger

    The id of the InstanceConfig that is the default for this partition.

patch_kubernetes(id, *, raw_cluster_slug='DEFAULT', is_nat_enabled='DEFAULT')

Update a Kubernetes Cluster

Parameters
idinteger

The ID of this cluster.

raw_cluster_slugstring, optional

The slug of this cluster’s raw configuration.

is_nat_enabledboolean, optional

Whether this cluster needs a NAT gateway or not.

Returns
civis.response.Response
  • idinteger

    The ID of this cluster.

  • organization_idstring

    The id of this cluster’s organization.

  • organization_namestring

    The name of this cluster’s organization.

  • organization_slugstring

    The slug of this cluster’s organization.

  • raw_cluster_slugstring

    The slug of this cluster’s raw configuration.

  • custom_partitionsboolean

    Whether this cluster has a custom partition configuration.

  • cluster_partitionslist::

    List of cluster partitions associated with this cluster. - cluster_partition_id : integer

    The ID of this cluster partition.

    • namestring

      The name of the cluster partition.

    • labelslist

      Labels associated with this partition.

    • instance_configslist::

      The instances configured for this cluster partition. - instance_config_id : integer

      The ID of this InstanceConfig.

      • instance_typestring

        An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

      • min_instancesinteger

        The minimum number of instances of that type in this cluster.

      • max_instancesinteger

        The maximum number of instances of that type in this cluster.

      • instance_max_memoryinteger

        The amount of memory (RAM) available to a single instance of that type in megabytes.

      • instance_max_cpuinteger

        The number of processor shares available to a single instance of that type in millicores.

      • instance_max_diskinteger

        The amount of disk available to a single instance of that type in gigabytes.

      • usage_statsdict::
        • pending_memory_requestedinteger

          The sum of memory requests (in MB) for pending deployments in this instance config.

        • pending_cpu_requestedinteger

          The sum of cpu requests (in millicores) for pending deployments in this instance config.

        • running_memory_requestedinteger

          The sum of memory requests (in MB) for running deployments in this instance config.

        • running_cpu_requestedinteger

          The sum of cpu requests (in millicores) for running deployments in this instance config.

        • pending_deploymentsinteger

          The number of pending deployments in this instance config.

        • running_deploymentsinteger

          The number of running deployments in this instance config.

    • default_instance_config_idinteger

      The id of the InstanceConfig that is the default for this partition.

  • is_nat_enabledboolean

    Whether this cluster needs a NAT gateway or not.

  • hoursnumber/float

    The number of hours used this month for this cluster.

patch_kubernetes_partitions(id, cluster_partition_id, *, instance_configs='DEFAULT', name='DEFAULT', labels='DEFAULT')

Update a Cluster Partition

Parameters
idinteger

The ID of the cluster which this partition belongs to.

cluster_partition_idinteger

The ID of this cluster partition.

instance_configslist, optional::

The instances configured for this cluster partition. - instance_type : string

An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

  • min_instancesinteger

    The minimum number of instances of that type in this cluster.

  • max_instancesinteger

    The maximum number of instances of that type in this cluster.

namestring, optional

The name of the cluster partition.

labelslist, optional

Labels associated with this partition.

Returns
civis.response.Response
  • cluster_partition_idinteger

    The ID of this cluster partition.

  • namestring

    The name of the cluster partition.

  • labelslist

    Labels associated with this partition.

  • instance_configslist::

    The instances configured for this cluster partition. - instance_config_id : integer

    The ID of this InstanceConfig.

    • instance_typestring

      An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

    • min_instancesinteger

      The minimum number of instances of that type in this cluster.

    • max_instancesinteger

      The maximum number of instances of that type in this cluster.

    • instance_max_memoryinteger

      The amount of memory (RAM) available to a single instance of that type in megabytes.

    • instance_max_cpuinteger

      The number of processor shares available to a single instance of that type in millicores.

    • instance_max_diskinteger

      The amount of disk available to a single instance of that type in gigabytes.

    • usage_statsdict::
      • pending_memory_requestedinteger

        The sum of memory requests (in MB) for pending deployments in this instance config.

      • pending_cpu_requestedinteger

        The sum of cpu requests (in millicores) for pending deployments in this instance config.

      • running_memory_requestedinteger

        The sum of memory requests (in MB) for running deployments in this instance config.

      • running_cpu_requestedinteger

        The sum of cpu requests (in millicores) for running deployments in this instance config.

      • pending_deploymentsinteger

        The number of pending deployments in this instance config.

      • running_deploymentsinteger

        The number of running deployments in this instance config.

  • default_instance_config_idinteger

    The id of the InstanceConfig that is the default for this partition.

post_kubernetes(*, organization_id='DEFAULT', organization_slug='DEFAULT', raw_cluster_slug='DEFAULT', is_nat_enabled='DEFAULT')

Create a Kubernetes Cluster

Parameters
organization_idstring, optional

The id of this cluster’s organization.

organization_slugstring, optional

The slug of this cluster’s organization.

raw_cluster_slugstring, optional

The slug of this cluster’s raw configuration.

is_nat_enabledboolean, optional

Whether this cluster needs a NAT gateway or not.

Returns
civis.response.Response
  • idinteger

    The ID of this cluster.

  • organization_idstring

    The id of this cluster’s organization.

  • organization_namestring

    The name of this cluster’s organization.

  • organization_slugstring

    The slug of this cluster’s organization.

  • raw_cluster_slugstring

    The slug of this cluster’s raw configuration.

  • custom_partitionsboolean

    Whether this cluster has a custom partition configuration.

  • cluster_partitionslist::

    List of cluster partitions associated with this cluster. - cluster_partition_id : integer

    The ID of this cluster partition.

    • namestring

      The name of the cluster partition.

    • labelslist

      Labels associated with this partition.

    • instance_configslist::

      The instances configured for this cluster partition. - instance_config_id : integer

      The ID of this InstanceConfig.

      • instance_typestring

        An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

      • min_instancesinteger

        The minimum number of instances of that type in this cluster.

      • max_instancesinteger

        The maximum number of instances of that type in this cluster.

      • instance_max_memoryinteger

        The amount of memory (RAM) available to a single instance of that type in megabytes.

      • instance_max_cpuinteger

        The number of processor shares available to a single instance of that type in millicores.

      • instance_max_diskinteger

        The amount of disk available to a single instance of that type in gigabytes.

      • usage_statsdict::
        • pending_memory_requestedinteger

          The sum of memory requests (in MB) for pending deployments in this instance config.

        • pending_cpu_requestedinteger

          The sum of cpu requests (in millicores) for pending deployments in this instance config.

        • running_memory_requestedinteger

          The sum of memory requests (in MB) for running deployments in this instance config.

        • running_cpu_requestedinteger

          The sum of cpu requests (in millicores) for running deployments in this instance config.

        • pending_deploymentsinteger

          The number of pending deployments in this instance config.

        • running_deploymentsinteger

          The number of running deployments in this instance config.

    • default_instance_config_idinteger

      The id of the InstanceConfig that is the default for this partition.

  • is_nat_enabledboolean

    Whether this cluster needs a NAT gateway or not.

  • hoursnumber/float

    The number of hours used this month for this cluster.

post_kubernetes_partitions(id, instance_configs, name, labels)

Create a Cluster Partition for given cluster

Parameters
idinteger

The ID of the cluster which this partition belongs to.

instance_configslist::

The instances configured for this cluster partition. - instance_type : string

An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

  • min_instancesinteger

    The minimum number of instances of that type in this cluster.

  • max_instancesinteger

    The maximum number of instances of that type in this cluster.

namestring

The name of the cluster partition.

labelslist

Labels associated with this partition.

Returns
civis.response.Response
  • cluster_partition_idinteger

    The ID of this cluster partition.

  • namestring

    The name of the cluster partition.

  • labelslist

    Labels associated with this partition.

  • instance_configslist::

    The instances configured for this cluster partition. - instance_config_id : integer

    The ID of this InstanceConfig.

    • instance_typestring

      An EC2 instance type. Possible values include t2.large, m4.xlarge, m4.2xlarge, m4.4xlarge, m5.12xlarge, c5.18xlarge, and p2.xlarge.

    • min_instancesinteger

      The minimum number of instances of that type in this cluster.

    • max_instancesinteger

      The maximum number of instances of that type in this cluster.

    • instance_max_memoryinteger

      The amount of memory (RAM) available to a single instance of that type in megabytes.

    • instance_max_cpuinteger

      The number of processor shares available to a single instance of that type in millicores.

    • instance_max_diskinteger

      The amount of disk available to a single instance of that type in gigabytes.

    • usage_statsdict::
      • pending_memory_requestedinteger

        The sum of memory requests (in MB) for pending deployments in this instance config.

      • pending_cpu_requestedinteger

        The sum of cpu requests (in millicores) for pending deployments in this instance config.

      • running_memory_requestedinteger

        The sum of memory requests (in MB) for running deployments in this instance config.

      • running_cpu_requestedinteger

        The sum of cpu requests (in millicores) for running deployments in this instance config.

      • pending_deploymentsinteger

        The number of pending deployments in this instance config.

      • running_deploymentsinteger

        The number of running deployments in this instance config.

  • default_instance_config_idinteger

    The id of the InstanceConfig that is the default for this partition.

Credentials
class Credentials(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.credentials.list_types(...)

Methods

delete(id)

Delete a credential

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get a credential

list(*[, type, remote_host_id, default, ...])

List credentials

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_shares(id)

List users and groups permissioned on this object

list_types()

Get list of Credential Types

patch(id, *[, name, type, description, ...])

Update some attributes of a credential

post(type, username, password, *[, name, ...])

Create a credential

post_authenticate(url, remote_host_type, ...)

Authenticate against a remote host

post_temporary(id, *[, duration])

Generate a temporary credential for accessing S3

put(id, type, username, password, *[, name, ...])

Update an existing credential

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete(id)

Delete a credential

Parameters
idinteger

The ID of the credential.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get a credential

Parameters
idinteger

The ID of the credential.

Returns
civis.response.Response
  • idinteger

    The ID of the credential.

  • namestring

    The name identifying the credential

  • typestring

    The credential’s type.

  • usernamestring

    The username for the credential.

  • descriptionstring

    A long description of the credential.

  • ownerstring

    The username of the user who this credential belongs to. Using user.username is preferred.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host associated with this credential.

  • remote_host_namestring

    The name of the remote host associated with this credential.

  • statestring

    The U.S. state for the credential. Only for VAN credentials.

  • created_atstring/time

    The creation time for this credential.

  • updated_atstring/time

    The last modification time for this credential.

  • defaultboolean

    Whether or not the credential is a default. Only for Database credentials.

list(*, type='DEFAULT', remote_host_id='DEFAULT', default='DEFAULT', system_credentials='DEFAULT', users='DEFAULT', name='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List credentials

Parameters
typestring, optional

The type (or types) of credentials to return. One or more of: Amazon Web Services S3, Bitbucket, CASS/NCOA PAF, Certificate, Civis Platform, Custom, Database, Google, Github, Salesforce User, Salesforce Client, and TableauUser. Specify multiple values as a comma-separated list (e.g., “A,B”).

remote_host_idinteger, optional

The ID of the remote host associated with the credentials to return.

defaultboolean, optional

If true, will return a list with a single credential which is the current user’s default credential.

system_credentialsboolean, optional

If true, will only return system credentials. System credentials can only be created and viewed by Civis Admins.

usersstring, optional

A comma-separated list of user ids. If specified, returns set of credentials owned by the users that requesting user has at least read access on.

namestring, optional

If specified, will be used to filter the credentials returned. Will search across name and will return any full name containing the search string.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the credential.

  • namestring

    The name identifying the credential

  • typestring

    The credential’s type.

  • usernamestring

    The username for the credential.

  • descriptionstring

    A long description of the credential.

  • ownerstring

    The username of the user who this credential belongs to. Using user.username is preferred.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host associated with this credential.

  • remote_host_namestring

    The name of the remote host associated with this credential.

  • statestring

    The U.S. state for the credential. Only for VAN credentials.

  • created_atstring/time

    The creation time for this credential.

  • updated_atstring/time

    The last modification time for this credential.

  • defaultboolean

    Whether or not the credential is a default. Only for Database credentials.

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_types()

Get list of Credential Types

Returns
civis.response.Response
  • typeslist

    list of acceptable credential types

patch(id, *, name='DEFAULT', type='DEFAULT', description='DEFAULT', username='DEFAULT', password='DEFAULT', remote_host_id='DEFAULT', user_id='DEFAULT', state='DEFAULT', system_credential='DEFAULT', default='DEFAULT')

Update some attributes of a credential

Parameters
idinteger

The ID of the credential.

namestring, optional

The name identifying the credential.

typestring, optional

The type of credential. Note: only these credentials can be created or edited via this API [“Amazon Web Services S3”, “CASS/NCOA PAF”, “Certificate”, “Civis Platform”, “Custom”, “Database”, “Google”, “Salesforce User”, “Salesforce Client”, “TableauUser”]

descriptionstring, optional

A long description of the credential.

usernamestring, optional

The username for the credential.

passwordstring, optional

The password for the credential.

remote_host_idinteger, optional

The ID of the remote host associated with the credential.

user_idinteger, optional

The ID of the user the credential is created for. Note: This attribute is only accepted if you are a Civis Admin User.

statestring, optional

The U.S. state for the credential. Only for VAN credentials.

system_credentialboolean, optional

Boolean flag that sets a credential to be a system credential. System credentials can only be created by Civis Admins and will create a credential owned by the Civis Robot user.

defaultboolean, optional

Whether or not the credential is a default. Only for Database credentials.

Returns
civis.response.Response
  • idinteger

    The ID of the credential.

  • namestring

    The name identifying the credential

  • typestring

    The credential’s type.

  • usernamestring

    The username for the credential.

  • descriptionstring

    A long description of the credential.

  • ownerstring

    The username of the user who this credential belongs to. Using user.username is preferred.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host associated with this credential.

  • remote_host_namestring

    The name of the remote host associated with this credential.

  • statestring

    The U.S. state for the credential. Only for VAN credentials.

  • created_atstring/time

    The creation time for this credential.

  • updated_atstring/time

    The last modification time for this credential.

  • defaultboolean

    Whether or not the credential is a default. Only for Database credentials.

post(type, username, password, *, name='DEFAULT', description='DEFAULT', remote_host_id='DEFAULT', user_id='DEFAULT', state='DEFAULT', system_credential='DEFAULT', default='DEFAULT')

Create a credential

Parameters
typestring

The type of credential. Note: only these credentials can be created or edited via this API [“Amazon Web Services S3”, “CASS/NCOA PAF”, “Certificate”, “Civis Platform”, “Custom”, “Database”, “Google”, “Salesforce User”, “Salesforce Client”, “TableauUser”]

usernamestring

The username for the credential.

passwordstring

The password for the credential.

namestring, optional

The name identifying the credential.

descriptionstring, optional

A long description of the credential.

remote_host_idinteger, optional

The ID of the remote host associated with the credential.

user_idinteger, optional

The ID of the user the credential is created for. Note: This attribute is only accepted if you are a Civis Admin User.

statestring, optional

The U.S. state for the credential. Only for VAN credentials.

system_credentialboolean, optional

Boolean flag that sets a credential to be a system credential. System credentials can only be created by Civis Admins and will create a credential owned by the Civis Robot user.

defaultboolean, optional

Whether or not the credential is a default. Only for Database credentials.

Returns
civis.response.Response
  • idinteger

    The ID of the credential.

  • namestring

    The name identifying the credential

  • typestring

    The credential’s type.

  • usernamestring

    The username for the credential.

  • descriptionstring

    A long description of the credential.

  • ownerstring

    The username of the user who this credential belongs to. Using user.username is preferred.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host associated with this credential.

  • remote_host_namestring

    The name of the remote host associated with this credential.

  • statestring

    The U.S. state for the credential. Only for VAN credentials.

  • created_atstring/time

    The creation time for this credential.

  • updated_atstring/time

    The last modification time for this credential.

  • defaultboolean

    Whether or not the credential is a default. Only for Database credentials.

post_authenticate(url, remote_host_type, username, password)

Authenticate against a remote host

Parameters
urlstring

The URL to your host.

remote_host_typestring

The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce

usernamestring

The username for the credential.

passwordstring

The password for the credential.

Returns
civis.response.Response
  • idinteger

    The ID of the credential.

  • namestring

    The name identifying the credential

  • typestring

    The credential’s type.

  • usernamestring

    The username for the credential.

  • descriptionstring

    A long description of the credential.

  • ownerstring

    The username of the user who this credential belongs to. Using user.username is preferred.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host associated with this credential.

  • remote_host_namestring

    The name of the remote host associated with this credential.

  • statestring

    The U.S. state for the credential. Only for VAN credentials.

  • created_atstring/time

    The creation time for this credential.

  • updated_atstring/time

    The last modification time for this credential.

  • defaultboolean

    Whether or not the credential is a default. Only for Database credentials.

post_temporary(id, *, duration='DEFAULT')

Generate a temporary credential for accessing S3

Parameters
idinteger

The ID of the credential.

durationinteger, optional

The number of seconds the temporary credential should be valid. Defaults to 15 minutes. Must not be less than 15 minutes or greater than 36 hours.

Returns
civis.response.Response
  • access_keystring

    The identifier of the credential.

  • secret_access_keystring

    The secret part of the credential.

  • session_tokenstring

    The session token identifier.

put(id, type, username, password, *, name='DEFAULT', description='DEFAULT', remote_host_id='DEFAULT', user_id='DEFAULT', state='DEFAULT', system_credential='DEFAULT', default='DEFAULT')

Update an existing credential

Parameters
idinteger

The ID of the credential.

typestring

The type of credential. Note: only these credentials can be created or edited via this API [“Amazon Web Services S3”, “CASS/NCOA PAF”, “Certificate”, “Civis Platform”, “Custom”, “Database”, “Google”, “Salesforce User”, “Salesforce Client”, “TableauUser”]

usernamestring

The username for the credential.

passwordstring

The password for the credential.

namestring, optional

The name identifying the credential.

descriptionstring, optional

A long description of the credential.

remote_host_idinteger, optional

The ID of the remote host associated with the credential.

user_idinteger, optional

The ID of the user the credential is created for. Note: This attribute is only accepted if you are a Civis Admin User.

statestring, optional

The U.S. state for the credential. Only for VAN credentials.

system_credentialboolean, optional

Boolean flag that sets a credential to be a system credential. System credentials can only be created by Civis Admins and will create a credential owned by the Civis Robot user.

defaultboolean, optional

Whether or not the credential is a default. Only for Database credentials.

Returns
civis.response.Response
  • idinteger

    The ID of the credential.

  • namestring

    The name identifying the credential

  • typestring

    The credential’s type.

  • usernamestring

    The username for the credential.

  • descriptionstring

    A long description of the credential.

  • ownerstring

    The username of the user who this credential belongs to. Using user.username is preferred.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host associated with this credential.

  • remote_host_namestring

    The name of the remote host associated with this credential.

  • statestring

    The U.S. state for the credential. Only for VAN credentials.

  • created_atstring/time

    The creation time for this credential.

  • updated_atstring/time

    The last modification time for this credential.

  • defaultboolean

    Whether or not the credential is a default. Only for Database credentials.

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Databases
class Databases(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.databases.list(...)

Methods

get(id)

Show database information

get_whitelist_ips(id, whitelisted_ip_id)

View details about a whitelisted IP

list()

List databases

list_advanced_settings(id)

Get the advanced settings for this database

list_schemas(id, *[, name, credential_id])

List schemas in this database

list_whitelist_ips(id)

List whitelisted IPs for the specified database

patch_advanced_settings(id, *[, ...])

Update the advanced settings for this database

post_schemas_scan(id, schema, *[, ...])

Creates and enqueues a schema scanner job

put_advanced_settings(id, export_caching_enabled)

Edit the advanced settings for this database

get(id)

Show database information

Parameters
idinteger

The ID for the database.

Returns
civis.response.Response
  • idinteger

    The ID for the database.

  • namestring

    The name of the database.

  • adapterstring

    The type of the database.

get_whitelist_ips(id, whitelisted_ip_id)

View details about a whitelisted IP

Parameters
idinteger

The ID of the database this rule is applied to.

whitelisted_ip_idinteger

The ID of this whitelisted IP address.

Returns
civis.response.Response
  • idinteger

    The ID of this whitelisted IP address.

  • remote_host_idinteger

    The ID of the database this rule is applied to.

  • security_group_idstring

    The ID of the security group this rule is applied to.

  • subnet_maskstring

    The subnet mask that is allowed by this rule.

  • authorized_bystring

    The user who authorized this rule.

  • is_activeboolean

    True if the rule is applied, false if it has been revoked.

  • created_atstring/time

    The time this rule was created.

  • updated_atstring/time

    The time this rule was last updated.

list()

List databases

Returns
civis.response.Response
  • idinteger

    The ID for the database.

  • namestring

    The name of the database.

  • adapterstring

    The type of the database.

list_advanced_settings(id)

Get the advanced settings for this database

Parameters
idinteger

The ID of the database this advanced settings object belongs to.

Returns
civis.response.Response
  • export_caching_enabledboolean

    Whether or not caching is enabled for export jobs run on this database server.

list_schemas(id, *, name='DEFAULT', credential_id='DEFAULT')

List schemas in this database

Parameters
idinteger

The ID of the database.

namestring, optional

If specified, will be used to filter the schemas returned. Substring matching is supported (e.g., “name=schema” will return both “schema1” and “schema2”).

credential_idinteger, optional

If provided, schemas will be filtered based on the given credential.

Returns
civis.response.Response
  • schemastring

    The name of a schema.

list_whitelist_ips(id)

List whitelisted IPs for the specified database

Parameters
idinteger

The ID for the database.

Returns
civis.response.Response
  • idinteger

    The ID of this whitelisted IP address.

  • remote_host_idinteger

    The ID of the database this rule is applied to.

  • security_group_idstring

    The ID of the security group this rule is applied to.

  • subnet_maskstring

    The subnet mask that is allowed by this rule.

  • created_atstring/time

    The time this rule was created.

  • updated_atstring/time

    The time this rule was last updated.

patch_advanced_settings(id, *, export_caching_enabled='DEFAULT')

Update the advanced settings for this database

Parameters
idinteger

The ID of the database this advanced settings object belongs to.

export_caching_enabledboolean, optional

Whether or not caching is enabled for export jobs run on this database server.

Returns
civis.response.Response
  • export_caching_enabledboolean

    Whether or not caching is enabled for export jobs run on this database server.

post_schemas_scan(id, schema, *, stats_priority='DEFAULT')

Creates and enqueues a schema scanner job

Parameters
idinteger

The ID of the database.

schemastring

The name of the schema.

stats_prioritystring, optional

When to sync table statistics for every table in the schema. Valid options are the following. Option: ‘flag’ means to flag stats for the next scheduled run of a full table scan on the database. Option: ‘block’ means to block this job on stats syncing. Option: ‘queue’ means to queue a separate job for syncing stats and do not block this job on the queued job. Defaults to ‘flag’

Returns
civis.response.Response
  • job_idinteger

    The ID of the job created.

  • run_idinteger

    The ID of the run created.

put_advanced_settings(id, export_caching_enabled)

Edit the advanced settings for this database

Parameters
idinteger

The ID of the database this advanced settings object belongs to.

export_caching_enabledboolean

Whether or not caching is enabled for export jobs run on this database server.

Returns
civis.response.Response
  • export_caching_enabledboolean

    Whether or not caching is enabled for export jobs run on this database server.

Endpoints
class Endpoints(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.endpoints.list(...)

Methods

list()

List API endpoints

list()

List API endpoints

Returns
None

Response code 200: success

Enhancements
class Enhancements(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.enhancements.post_civis_data_match(...)

Methods

delete_cass_ncoa_projects(id, project_id)

Remove a CASS/NCOA Enhancement from a project

delete_cass_ncoa_runs(id, run_id)

Cancel a run

delete_cass_ncoa_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_cass_ncoa_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_civis_data_match_projects(id, project_id)

Remove a Civis Data Match Enhancement from a project

delete_civis_data_match_runs(id, run_id)

Cancel a run

delete_civis_data_match_shares_groups(id, ...)

Revoke the permissions a group has on this object

delete_civis_data_match_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_geocode_projects(id, project_id)

Remove a Geocode Enhancement from a project

delete_geocode_runs(id, run_id)

Cancel a run

delete_geocode_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_geocode_shares_users(id, user_id)

Revoke the permissions a user has on this object

get_cass_ncoa(id)

Get a CASS/NCOA Enhancement

get_cass_ncoa_runs(id, run_id)

Check status of a run

get_civis_data_match(id)

Get a Civis Data Match Enhancement

get_civis_data_match_runs(id, run_id)

Check status of a run

get_geocode(id)

Get a Geocode Enhancement

get_geocode_runs(id, run_id)

Check status of a run

list(*[, type, author, status, archived, ...])

List Enhancements

list_cass_ncoa_dependencies(id, *[, user_id])

List dependent objects for this object

list_cass_ncoa_projects(id, *[, hidden])

List the projects a CASS/NCOA Enhancement belongs to

list_cass_ncoa_runs(id, *[, limit, ...])

List runs for the given cass_ncoa

list_cass_ncoa_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_cass_ncoa_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

list_cass_ncoa_shares(id)

List users and groups permissioned on this object

list_civis_data_match_dependencies(id, *[, ...])

List dependent objects for this object

list_civis_data_match_projects(id, *[, hidden])

List the projects a Civis Data Match Enhancement belongs to

list_civis_data_match_runs(id, *[, limit, ...])

List runs for the given civis_data_match

list_civis_data_match_runs_logs(id, run_id, *)

Get the logs for a run

list_civis_data_match_runs_outputs(id, run_id, *)

List the outputs for a run

list_civis_data_match_shares(id)

List users and groups permissioned on this object

list_field_mapping()

List the fields in a field mapping for Civis Data Match, Data Unification, and Table Deduplication jobs

list_geocode_dependencies(id, *[, user_id])

List dependent objects for this object

list_geocode_projects(id, *[, hidden])

List the projects a Geocode Enhancement belongs to

list_geocode_runs(id, *[, limit, page_num, ...])

List runs for the given geocode

list_geocode_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_geocode_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

list_geocode_shares(id)

List users and groups permissioned on this object

list_types()

List available enhancement types

patch_cass_ncoa(id, *[, name, schedule, ...])

Update some attributes of this CASS/NCOA Enhancement

patch_civis_data_match(id, *[, name, ...])

Update some attributes of this Civis Data Match Enhancement

patch_geocode(id, *[, name, schedule, ...])

Update some attributes of this Geocode Enhancement

post_cass_ncoa(name, source, *[, schedule, ...])

Create a CASS/NCOA Enhancement

post_cass_ncoa_cancel(id)

Cancel a run

post_cass_ncoa_runs(id)

Start a run

post_civis_data_match(name, ...[, schedule, ...])

Create a Civis Data Match Enhancement

post_civis_data_match_cancel(id)

Cancel a run

post_civis_data_match_clone(id, *[, ...])

Clone this Civis Data Match Enhancement

post_civis_data_match_runs(id)

Start a run

post_geocode(name, remote_host_id, ...[, ...])

Create a Geocode Enhancement

post_geocode_cancel(id)

Cancel a run

post_geocode_runs(id)

Start a run

put_cass_ncoa(id, name, source, *[, ...])

Replace all attributes of this CASS/NCOA Enhancement

put_cass_ncoa_archive(id, status)

Update the archive status of this object

put_cass_ncoa_projects(id, project_id)

Add a CASS/NCOA Enhancement to a project

put_cass_ncoa_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_cass_ncoa_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_cass_ncoa_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_civis_data_match(id, name, ...[, ...])

Replace all attributes of this Civis Data Match Enhancement

put_civis_data_match_archive(id, status)

Update the archive status of this object

put_civis_data_match_projects(id, project_id)

Add a Civis Data Match Enhancement to a project

put_civis_data_match_shares_groups(id, ...)

Set the permissions groups has on this object

put_civis_data_match_shares_users(id, ...[, ...])

Set the permissions users have on this object

put_civis_data_match_transfer(id, user_id, ...)

Transfer ownership of this object to another user

put_geocode(id, name, remote_host_id, ...[, ...])

Replace all attributes of this Geocode Enhancement

put_geocode_archive(id, status)

Update the archive status of this object

put_geocode_projects(id, project_id)

Add a Geocode Enhancement to a project

put_geocode_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_geocode_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_geocode_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

delete_cass_ncoa_projects(id, project_id)

Remove a CASS/NCOA Enhancement from a project

Parameters
idinteger

The ID of the CASS/NCOA Enhancement.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_cass_ncoa_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the cass_ncoa.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_cass_ncoa_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_cass_ncoa_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_civis_data_match_projects(id, project_id)

Remove a Civis Data Match Enhancement from a project

Parameters
idinteger

The ID of the Civis Data Match Enhancement.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_civis_data_match_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the civis_data_match.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_civis_data_match_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_civis_data_match_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_geocode_projects(id, project_id)

Remove a Geocode Enhancement from a project

Parameters
idinteger

The ID of the Geocode Enhancement.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_geocode_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the geocode.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_geocode_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_geocode_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get_cass_ncoa(id)

Get a CASS/NCOA Enhancement

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • sourcedict::
    • database_tabledict::
      • schemastring

        The schema name of the source table.

      • tablestring

        The name of the source table.

      • remote_host_idinteger

        The ID of the database host for the table.

      • credential_idinteger

        The id of the credentials to be used when performing the enhancement.

      • multipart_keylist

        The source table primary key.

  • destinationdict::
    • database_tabledict::
      • schemastring

        The schema name for the output data.

      • tablestring

        The table name for the output data.

  • column_mappingdict::
    • address1string

      The first address line.

    • address2string

      The second address line.

    • citystring

      The city of an address.

    • statestring

      The state of an address.

    • zipstring

      The zip code of an address.

    • namestring

      The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name

    • companystring

      The name of the company located at this address.

  • use_default_column_mappingboolean

    Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided.

  • perform_ncoaboolean

    Whether to update addresses for records matching the National Change of Address (NCOA) database.

  • ncoa_credential_idinteger

    Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

  • output_levelstring

    The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

get_cass_ncoa_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the cass_ncoa.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • cass_ncoa_idinteger

    The ID of the cass_ncoa.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

get_civis_data_match(id)

Get a Civis Data Match Enhancement

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • input_field_mappingdict

    The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

  • input_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • match_target_idinteger

    The ID of the Civis Data match target. See /match_targets for IDs.

  • output_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • max_matchesinteger

    The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

  • thresholdnumber/float

    The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

  • archivedboolean

    Whether the Civis Data Match Job has been archived.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

get_civis_data_match_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the civis_data_match.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • civis_data_match_idinteger

    The ID of the civis_data_match.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

get_geocode(id)

Get a Geocode Enhancement

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host.

  • credential_idinteger

    The ID of the remote host credential.

  • source_schema_and_tablestring

    The source database schema and table.

  • multipart_keylist

    The source table primary key.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • target_schemastring

    The output table schema.

  • target_tablestring

    The output table name.

  • countrystring

    The country of the addresses to be geocoded; either ‘us’ or ‘ca’.

  • providerstring

    The geocoding provider; one of postgis, nominatim, and geocoder_ca.

  • output_addressboolean

    Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

get_geocode_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the geocode.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • geocode_idinteger

    The ID of the geocode.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list(*, type='DEFAULT', author='DEFAULT', status='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Enhancements

Parameters
typestring, optional

If specified, return items of these types.

authorstring, optional

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

statusstring, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • archivedstring

    The archival status of the requested item(s).

list_cass_ncoa_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_cass_ncoa_projects(id, *, hidden='DEFAULT')

List the projects a CASS/NCOA Enhancement belongs to

Parameters
idinteger

The ID of the CASS/NCOA Enhancement.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_cass_ncoa_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given cass_ncoa

Parameters
idinteger

The ID of the cass_ncoa.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • cass_ncoa_idinteger

    The ID of the cass_ncoa.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list_cass_ncoa_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the cass_ncoa.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_cass_ncoa_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the job.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_cass_ncoa_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_civis_data_match_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_civis_data_match_projects(id, *, hidden='DEFAULT')

List the projects a Civis Data Match Enhancement belongs to

Parameters
idinteger

The ID of the Civis Data Match Enhancement.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_civis_data_match_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given civis_data_match

Parameters
idinteger

The ID of the civis_data_match.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • civis_data_match_idinteger

    The ID of the civis_data_match.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list_civis_data_match_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the civis_data_match.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_civis_data_match_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the job.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_civis_data_match_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_field_mapping()

List the fields in a field mapping for Civis Data Match, Data Unification, and Table Deduplication jobs

Returns
civis.response.Response
  • fieldstring

    The name of the field.

  • descriptionstring

    The description of the field.

list_geocode_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_geocode_projects(id, *, hidden='DEFAULT')

List the projects a Geocode Enhancement belongs to

Parameters
idinteger

The ID of the Geocode Enhancement.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_geocode_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given geocode

Parameters
idinteger

The ID of the geocode.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • geocode_idinteger

    The ID of the geocode.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list_geocode_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the geocode.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_geocode_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the job.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_geocode_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_types()

List available enhancement types

Returns
civis.response.Response
  • namestring

    The name of the type.

patch_cass_ncoa(id, *, name='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', source='DEFAULT', destination='DEFAULT', column_mapping='DEFAULT', use_default_column_mapping='DEFAULT', perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT', limiting_sql='DEFAULT')

Update some attributes of this CASS/NCOA Enhancement

Parameters
idinteger

The ID for the enhancement.

namestring, optional

The name of the enhancement job.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

sourcedict, optional::
  • database_tabledict::
    • schemastring

      The schema name of the source table.

    • tablestring

      The name of the source table.

    • remote_host_idinteger

      The ID of the database host for the table.

    • credential_idinteger

      The id of the credentials to be used when performing the enhancement.

    • multipart_keylist

      The source table primary key.

destinationdict, optional::
  • database_tabledict::
    • schemastring

      The schema name for the output data.

    • tablestring

      The table name for the output data.

column_mappingdict, optional::
  • address1string

    The first address line.

  • address2string

    The second address line.

  • citystring

    The city of an address.

  • statestring

    The state of an address.

  • zipstring

    The zip code of an address.

  • namestring

    The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name

  • companystring

    The name of the company located at this address.

use_default_column_mappingboolean, optional

Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided.

perform_ncoaboolean, optional

Whether to update addresses for records matching the National Change of Address (NCOA) database.

ncoa_credential_idinteger, optional

Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

output_levelstring, optional

The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

limiting_sqlstring, optional

The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • sourcedict::
    • database_tabledict::
      • schemastring

        The schema name of the source table.

      • tablestring

        The name of the source table.

      • remote_host_idinteger

        The ID of the database host for the table.

      • credential_idinteger

        The id of the credentials to be used when performing the enhancement.

      • multipart_keylist

        The source table primary key.

  • destinationdict::
    • database_tabledict::
      • schemastring

        The schema name for the output data.

      • tablestring

        The table name for the output data.

  • column_mappingdict::
    • address1string

      The first address line.

    • address2string

      The second address line.

    • citystring

      The city of an address.

    • statestring

      The state of an address.

    • zipstring

      The zip code of an address.

    • namestring

      The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name

    • companystring

      The name of the company located at this address.

  • use_default_column_mappingboolean

    Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided.

  • perform_ncoaboolean

    Whether to update addresses for records matching the National Change of Address (NCOA) database.

  • ncoa_credential_idinteger

    Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

  • output_levelstring

    The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

patch_civis_data_match(id, *, name='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', input_field_mapping='DEFAULT', input_table='DEFAULT', match_target_id='DEFAULT', output_table='DEFAULT', max_matches='DEFAULT', threshold='DEFAULT', archived='DEFAULT')

Update some attributes of this Civis Data Match Enhancement

Parameters
idinteger

The ID for the enhancement.

namestring, optional

The name of the enhancement job.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

input_field_mappingdict, optional

The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

input_tabledict, optional::
  • database_namestring

    The Redshift database name for the table.

  • schemastring

    The schema name for the table.

  • tablestring

    The table name.

match_target_idinteger, optional

The ID of the Civis Data match target. See /match_targets for IDs.

output_tabledict, optional::
  • database_namestring

    The Redshift database name for the table.

  • schemastring

    The schema name for the table.

  • tablestring

    The table name.

max_matchesinteger, optional

The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

thresholdnumber/float, optional

The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

archivedboolean, optional

Whether the Civis Data Match Job has been archived.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • input_field_mappingdict

    The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

  • input_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • match_target_idinteger

    The ID of the Civis Data match target. See /match_targets for IDs.

  • output_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • max_matchesinteger

    The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

  • thresholdnumber/float

    The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

  • archivedboolean

    Whether the Civis Data Match Job has been archived.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

patch_geocode(id, *, name='DEFAULT', schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', source_schema_and_table='DEFAULT', multipart_key='DEFAULT', limiting_sql='DEFAULT', target_schema='DEFAULT', target_table='DEFAULT', country='DEFAULT', provider='DEFAULT', output_address='DEFAULT')

Update some attributes of this Geocode Enhancement

Parameters
idinteger

The ID for the enhancement.

namestring, optional

The name of the enhancement job.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

remote_host_idinteger, optional

The ID of the remote host.

credential_idinteger, optional

The ID of the remote host credential.

source_schema_and_tablestring, optional

The source database schema and table.

multipart_keylist, optional

The source table primary key.

limiting_sqlstring, optional

The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

target_schemastring, optional

The output table schema.

target_tablestring, optional

The output table name.

countrystring, optional

The country of the addresses to be geocoded; either ‘us’ or ‘ca’.

providerstring, optional

The geocoding provider; one of postgis, nominatim, and geocoder_ca.

output_addressboolean, optional

Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host.

  • credential_idinteger

    The ID of the remote host credential.

  • source_schema_and_tablestring

    The source database schema and table.

  • multipart_keylist

    The source table primary key.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • target_schemastring

    The output table schema.

  • target_tablestring

    The output table name.

  • countrystring

    The country of the addresses to be geocoded; either ‘us’ or ‘ca’.

  • providerstring

    The geocoding provider; one of postgis, nominatim, and geocoder_ca.

  • output_addressboolean

    Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

post_cass_ncoa(name, source, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', destination='DEFAULT', column_mapping='DEFAULT', use_default_column_mapping='DEFAULT', perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT', limiting_sql='DEFAULT')

Create a CASS/NCOA Enhancement

Parameters
namestring

The name of the enhancement job.

sourcedict::
  • database_tabledict::
    • schemastring

      The schema name of the source table.

    • tablestring

      The name of the source table.

    • remote_host_idinteger

      The ID of the database host for the table.

    • credential_idinteger

      The id of the credentials to be used when performing the enhancement.

    • multipart_keylist

      The source table primary key.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

destinationdict, optional::
  • database_tabledict::
    • schemastring

      The schema name for the output data.

    • tablestring

      The table name for the output data.

column_mappingdict, optional::
  • address1string

    The first address line.

  • address2string

    The second address line.

  • citystring

    The city of an address.

  • statestring

    The state of an address.

  • zipstring

    The zip code of an address.

  • namestring

    The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name

  • companystring

    The name of the company located at this address.

use_default_column_mappingboolean, optional

Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided.

perform_ncoaboolean, optional

Whether to update addresses for records matching the National Change of Address (NCOA) database.

ncoa_credential_idinteger, optional

Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

output_levelstring, optional

The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

limiting_sqlstring, optional

The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • sourcedict::
    • database_tabledict::
      • schemastring

        The schema name of the source table.

      • tablestring

        The name of the source table.

      • remote_host_idinteger

        The ID of the database host for the table.

      • credential_idinteger

        The id of the credentials to be used when performing the enhancement.

      • multipart_keylist

        The source table primary key.

  • destinationdict::
    • database_tabledict::
      • schemastring

        The schema name for the output data.

      • tablestring

        The table name for the output data.

  • column_mappingdict::
    • address1string

      The first address line.

    • address2string

      The second address line.

    • citystring

      The city of an address.

    • statestring

      The state of an address.

    • zipstring

      The zip code of an address.

    • namestring

      The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name

    • companystring

      The name of the company located at this address.

  • use_default_column_mappingboolean

    Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided.

  • perform_ncoaboolean

    Whether to update addresses for records matching the National Change of Address (NCOA) database.

  • ncoa_credential_idinteger

    Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

  • output_levelstring

    The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

post_cass_ncoa_cancel(id)

Cancel a run

Parameters
idinteger

The ID of the job.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • statestring

    The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

post_cass_ncoa_runs(id)

Start a run

Parameters
idinteger

The ID of the cass_ncoa.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • cass_ncoa_idinteger

    The ID of the cass_ncoa.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

post_civis_data_match(name, input_field_mapping, input_table, match_target_id, output_table, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', max_matches='DEFAULT', threshold='DEFAULT', archived='DEFAULT')

Create a Civis Data Match Enhancement

Parameters
namestring

The name of the enhancement job.

input_field_mappingdict

The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

input_tabledict::
  • database_namestring

    The Redshift database name for the table.

  • schemastring

    The schema name for the table.

  • tablestring

    The table name.

match_target_idinteger

The ID of the Civis Data match target. See /match_targets for IDs.

output_tabledict::
  • database_namestring

    The Redshift database name for the table.

  • schemastring

    The schema name for the table.

  • tablestring

    The table name.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

max_matchesinteger, optional

The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

thresholdnumber/float, optional

The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

archivedboolean, optional

Whether the Civis Data Match Job has been archived.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • input_field_mappingdict

    The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

  • input_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • match_target_idinteger

    The ID of the Civis Data match target. See /match_targets for IDs.

  • output_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • max_matchesinteger

    The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

  • thresholdnumber/float

    The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

  • archivedboolean

    Whether the Civis Data Match Job has been archived.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

post_civis_data_match_cancel(id)

Cancel a run

Parameters
idinteger

The ID of the job.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • statestring

    The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

post_civis_data_match_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')

Clone this Civis Data Match Enhancement

Parameters
idinteger

The ID for the enhancement.

clone_scheduleboolean, optional

If true, also copy the schedule to the new enhancement.

clone_triggersboolean, optional

If true, also copy the triggers to the new enhancement.

clone_notificationsboolean, optional

If true, also copy the notifications to the new enhancement.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • input_field_mappingdict

    The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

  • input_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • match_target_idinteger

    The ID of the Civis Data match target. See /match_targets for IDs.

  • output_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • max_matchesinteger

    The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

  • thresholdnumber/float

    The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

  • archivedboolean

    Whether the Civis Data Match Job has been archived.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

post_civis_data_match_runs(id)

Start a run

Parameters
idinteger

The ID of the civis_data_match.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • civis_data_match_idinteger

    The ID of the civis_data_match.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

post_geocode(name, remote_host_id, credential_id, source_schema_and_table, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', multipart_key='DEFAULT', limiting_sql='DEFAULT', target_schema='DEFAULT', target_table='DEFAULT', country='DEFAULT', provider='DEFAULT', output_address='DEFAULT')

Create a Geocode Enhancement

Parameters
namestring

The name of the enhancement job.

remote_host_idinteger

The ID of the remote host.

credential_idinteger

The ID of the remote host credential.

source_schema_and_tablestring

The source database schema and table.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

multipart_keylist, optional

The source table primary key.

limiting_sqlstring, optional

The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

target_schemastring, optional

The output table schema.

target_tablestring, optional

The output table name.

countrystring, optional

The country of the addresses to be geocoded; either ‘us’ or ‘ca’.

providerstring, optional

The geocoding provider; one of postgis, nominatim, and geocoder_ca.

output_addressboolean, optional

Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host.

  • credential_idinteger

    The ID of the remote host credential.

  • source_schema_and_tablestring

    The source database schema and table.

  • multipart_keylist

    The source table primary key.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • target_schemastring

    The output table schema.

  • target_tablestring

    The output table name.

  • countrystring

    The country of the addresses to be geocoded; either ‘us’ or ‘ca’.

  • providerstring

    The geocoding provider; one of postgis, nominatim, and geocoder_ca.

  • output_addressboolean

    Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

post_geocode_cancel(id)

Cancel a run

Parameters
idinteger

The ID of the job.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • statestring

    The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

post_geocode_runs(id)

Start a run

Parameters
idinteger

The ID of the geocode.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • geocode_idinteger

    The ID of the geocode.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

put_cass_ncoa(id, name, source, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', destination='DEFAULT', column_mapping='DEFAULT', use_default_column_mapping='DEFAULT', perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT', limiting_sql='DEFAULT')

Replace all attributes of this CASS/NCOA Enhancement

Parameters
idinteger

The ID for the enhancement.

namestring

The name of the enhancement job.

sourcedict::
  • database_tabledict::
    • schemastring

      The schema name of the source table.

    • tablestring

      The name of the source table.

    • remote_host_idinteger

      The ID of the database host for the table.

    • credential_idinteger

      The id of the credentials to be used when performing the enhancement.

    • multipart_keylist

      The source table primary key.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

destinationdict, optional::
  • database_tabledict::
    • schemastring

      The schema name for the output data.

    • tablestring

      The table name for the output data.

column_mappingdict, optional::
  • address1string

    The first address line.

  • address2string

    The second address line.

  • citystring

    The city of an address.

  • statestring

    The state of an address.

  • zipstring

    The zip code of an address.

  • namestring

    The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name

  • companystring

    The name of the company located at this address.

use_default_column_mappingboolean, optional

Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided.

perform_ncoaboolean, optional

Whether to update addresses for records matching the National Change of Address (NCOA) database.

ncoa_credential_idinteger, optional

Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

output_levelstring, optional

The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

limiting_sqlstring, optional

The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • sourcedict::
    • database_tabledict::
      • schemastring

        The schema name of the source table.

      • tablestring

        The name of the source table.

      • remote_host_idinteger

        The ID of the database host for the table.

      • credential_idinteger

        The id of the credentials to be used when performing the enhancement.

      • multipart_keylist

        The source table primary key.

  • destinationdict::
    • database_tabledict::
      • schemastring

        The schema name for the output data.

      • tablestring

        The table name for the output data.

  • column_mappingdict::
    • address1string

      The first address line.

    • address2string

      The second address line.

    • citystring

      The city of an address.

    • statestring

      The state of an address.

    • zipstring

      The zip code of an address.

    • namestring

      The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name

    • companystring

      The name of the company located at this address.

  • use_default_column_mappingboolean

    Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided.

  • perform_ncoaboolean

    Whether to update addresses for records matching the National Change of Address (NCOA) database.

  • ncoa_credential_idinteger

    Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

  • output_levelstring

    The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_cass_ncoa_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • sourcedict::
    • database_tabledict::
      • schemastring

        The schema name of the source table.

      • tablestring

        The name of the source table.

      • remote_host_idinteger

        The ID of the database host for the table.

      • credential_idinteger

        The id of the credentials to be used when performing the enhancement.

      • multipart_keylist

        The source table primary key.

  • destinationdict::
    • database_tabledict::
      • schemastring

        The schema name for the output data.

      • tablestring

        The table name for the output data.

  • column_mappingdict::
    • address1string

      The first address line.

    • address2string

      The second address line.

    • citystring

      The city of an address.

    • statestring

      The state of an address.

    • zipstring

      The zip code of an address.

    • namestring

      The full name of the resident at this address. If needed, separate multiple columns with +, e.g. first_name+last_name

    • companystring

      The name of the company located at this address.

  • use_default_column_mappingboolean

    Defaults to true, where the existing column mapping on the input table will be used. If false, a custom column mapping must be provided.

  • perform_ncoaboolean

    Whether to update addresses for records matching the National Change of Address (NCOA) database.

  • ncoa_credential_idinteger

    Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

  • output_levelstring

    The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_cass_ncoa_projects(id, project_id)

Add a CASS/NCOA Enhancement to a project

Parameters
idinteger

The ID of the CASS/NCOA Enhancement.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_cass_ncoa_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_cass_ncoa_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_cass_ncoa_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_civis_data_match(id, name, input_field_mapping, input_table, match_target_id, output_table, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', max_matches='DEFAULT', threshold='DEFAULT', archived='DEFAULT')

Replace all attributes of this Civis Data Match Enhancement

Parameters
idinteger

The ID for the enhancement.

namestring

The name of the enhancement job.

input_field_mappingdict

The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

input_tabledict::
  • database_namestring

    The Redshift database name for the table.

  • schemastring

    The schema name for the table.

  • tablestring

    The table name.

match_target_idinteger

The ID of the Civis Data match target. See /match_targets for IDs.

output_tabledict::
  • database_namestring

    The Redshift database name for the table.

  • schemastring

    The schema name for the table.

  • tablestring

    The table name.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

max_matchesinteger, optional

The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

thresholdnumber/float, optional

The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

archivedboolean, optional

Whether the Civis Data Match Job has been archived.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • input_field_mappingdict

    The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

  • input_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • match_target_idinteger

    The ID of the Civis Data match target. See /match_targets for IDs.

  • output_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • max_matchesinteger

    The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

  • thresholdnumber/float

    The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

  • archivedboolean

    Whether the Civis Data Match Job has been archived.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

put_civis_data_match_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • input_field_mappingdict

    The field (i.e., column) mapping for the input table. See https://api.civisanalytics.com/enhancements/field-mapping for a list of valid field types and descriptions. Each field type should be mapped to a string specifying a column name in the input table. For field types that support multiple values (e.g., the “phone” field), a list of column names can be provided (e.g., {“phone”: [“home_phone”, “mobile_phone”], …}).

  • input_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • match_target_idinteger

    The ID of the Civis Data match target. See /match_targets for IDs.

  • output_tabledict::
    • database_namestring

      The Redshift database name for the table.

    • schemastring

      The schema name for the table.

    • tablestring

      The table name.

  • max_matchesinteger

    The maximum number of matches per record in the input table to return. Must be between 0 and 10. 0 returns all matches.

  • thresholdnumber/float

    The score threshold (between 0 and 1). Matches below this threshold will not be returned. The default value is 0.5.

  • archivedboolean

    Whether the Civis Data Match Job has been archived.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

put_civis_data_match_projects(id, project_id)

Add a Civis Data Match Enhancement to a project

Parameters
idinteger

The ID of the Civis Data Match Enhancement.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_civis_data_match_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_civis_data_match_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_civis_data_match_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_geocode(id, name, remote_host_id, credential_id, source_schema_and_table, *, schedule='DEFAULT', parent_id='DEFAULT', notifications='DEFAULT', multipart_key='DEFAULT', limiting_sql='DEFAULT', target_schema='DEFAULT', target_table='DEFAULT', country='DEFAULT', provider='DEFAULT', output_address='DEFAULT')

Replace all attributes of this Geocode Enhancement

Parameters
idinteger

The ID for the enhancement.

namestring

The name of the enhancement job.

remote_host_idinteger

The ID of the remote host.

credential_idinteger

The ID of the remote host credential.

source_schema_and_tablestring

The source database schema and table.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

parent_idinteger, optional

Parent ID that triggers this enhancement.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

multipart_keylist, optional

The source table primary key.

limiting_sqlstring, optional

The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

target_schemastring, optional

The output table schema.

target_tablestring, optional

The output table name.

countrystring, optional

The country of the addresses to be geocoded; either ‘us’ or ‘ca’.

providerstring, optional

The geocoding provider; one of postgis, nominatim, and geocoder_ca.

output_addressboolean, optional

Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host.

  • credential_idinteger

    The ID of the remote host credential.

  • source_schema_and_tablestring

    The source database schema and table.

  • multipart_keylist

    The source table primary key.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • target_schemastring

    The output table schema.

  • target_tablestring

    The output table name.

  • countrystring

    The country of the addresses to be geocoded; either ‘us’ or ‘ca’.

  • providerstring

    The geocoding provider; one of postgis, nominatim, and geocoder_ca.

  • output_addressboolean

    Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_geocode_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the enhancement.

  • namestring

    The name of the enhancement job.

  • typestring

    The type of the enhancement (e.g CASS-NCOA)

  • created_atstring/time

    The time this enhancement was created.

  • updated_atstring/time

    The time the enhancement was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the enhancement’s last run

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    Parent ID that triggers this enhancement.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • remote_host_idinteger

    The ID of the remote host.

  • credential_idinteger

    The ID of the remote host credential.

  • source_schema_and_tablestring

    The source database schema and table.

  • multipart_keylist

    The source table primary key.

  • limiting_sqlstring

    The limiting SQL for the source table. “WHERE” should be omitted (e.g. state=’IL’).

  • target_schemastring

    The output table schema.

  • target_tablestring

    The output table name.

  • countrystring

    The country of the addresses to be geocoded; either ‘us’ or ‘ca’.

  • providerstring

    The geocoding provider; one of postgis, nominatim, and geocoder_ca.

  • output_addressboolean

    Whether to output the parsed address. Only guaranteed for the ‘postgis’ provider.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_geocode_projects(id, project_id)

Add a Geocode Enhancement to a project

Parameters
idinteger

The ID of the Geocode Enhancement.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_geocode_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_geocode_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_geocode_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Exports
class Exports(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.exports.list(...)

Methods

delete_files_csv_runs(id, run_id)

Cancel a run

get_files_csv(id)

Get a CSV Export

get_files_csv_runs(id, run_id)

Check status of a run

list(*[, type, status, author, hidden, ...])

List

list_files_csv_runs(id, *[, limit, ...])

List runs for the given csv_export

list_files_csv_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_files_csv_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

patch_files_csv(id, *[, name, source, ...])

Update some attributes of this CSV Export

post_files_csv(source, destination, *[, ...])

Create a CSV Export

post_files_csv_runs(id)

Start a run

put_files_csv(id, source, destination, *[, ...])

Replace all attributes of this CSV Export

put_files_csv_archive(id, status)

Update the archive status of this object

delete_files_csv_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the csv_export.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

get_files_csv(id)

Get a CSV Export

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID of this Csv Export job.

  • namestring

    The name of this Csv Export job.

  • sourcedict::
    • sqlstring

      The SQL query for this Csv Export job

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

  • destinationdict::
    • filename_prefixstring

      The prefix of the name of the file returned to the user.

    • storage_pathdict::
      • file_pathstring

        The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”

      • storage_host_idinteger

        The ID of the destination storage host.

      • credential_idinteger

        The ID of the credentials for the destination storage host.

      • existing_filesstring

        Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.

  • include_headerboolean

    A boolean value indicating whether or not the header should be included. Defaults to true.

  • compressionstring

    The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.

  • column_delimiterstring

    The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • hiddenboolean

    A boolean value indicating whether or not this request should be hidden. Defaults to false.

  • force_multifileboolean

    Whether or not the csv should be split into multiple files. Default: false

  • max_file_sizeinteger

    The max file size, in MB, created files will be. Only available when force_multifile is true.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

get_files_csv_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the csv_export.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • id : integer

  • state : string

  • created_atstring/time

    The time that the run was queued.

  • started_atstring/time

    The time that the run started.

  • finished_atstring/time

    The time that the run completed.

  • errorstring

    The error message for this run, if present.

  • output_cached_onstring/time

    The time that the output was originally exported, if a cache entry was used by the run.

list(*, type='DEFAULT', status='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List

Parameters
typestring, optional

If specified, return exports of these types. It accepts a comma-separated list, possible values are ‘database’ and ‘gdoc’.

statusstring, optional

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

authorstring, optional

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

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for this export.

  • namestring

    The name of this export.

  • typestring

    The type of export.

  • created_atstring/time

    The creation time for this export.

  • updated_atstring/time

    The last modification time for this export.

  • state : string

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

list_files_csv_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given csv_export

Parameters
idinteger

The ID of the csv_export.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • id : integer

  • state : string

  • created_atstring/time

    The time that the run was queued.

  • started_atstring/time

    The time that the run started.

  • finished_atstring/time

    The time that the run completed.

  • errorstring

    The error message for this run, if present.

list_files_csv_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the csv_export.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_files_csv_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the csv_export.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

patch_files_csv(id, *, name='DEFAULT', source='DEFAULT', destination='DEFAULT', include_header='DEFAULT', compression='DEFAULT', column_delimiter='DEFAULT', hidden='DEFAULT', force_multifile='DEFAULT', max_file_size='DEFAULT')

Update some attributes of this CSV Export

Parameters
idinteger

The ID of this Csv Export job.

namestring, optional

The name of this Csv Export job.

sourcedict, optional::
  • sqlstring

    The SQL query for this Csv Export job

  • remote_host_idinteger

    The ID of the destination database host.

  • credential_idinteger

    The ID of the credentials for the destination database.

destinationdict, optional::
  • filename_prefixstring

    The prefix of the name of the file returned to the user.

  • storage_pathdict::
    • file_pathstring

      The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”

    • storage_host_idinteger

      The ID of the destination storage host.

    • credential_idinteger

      The ID of the credentials for the destination storage host.

    • existing_filesstring

      Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.

include_headerboolean, optional

A boolean value indicating whether or not the header should be included. Defaults to true.

compressionstring, optional

The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.

column_delimiterstring, optional

The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

hiddenboolean, optional

A boolean value indicating whether or not this request should be hidden. Defaults to false.

force_multifileboolean, optional

Whether or not the csv should be split into multiple files. Default: false

max_file_sizeinteger, optional

The max file size, in MB, created files will be. Only available when force_multifile is true.

Returns
civis.response.Response
  • idinteger

    The ID of this Csv Export job.

  • namestring

    The name of this Csv Export job.

  • sourcedict::
    • sqlstring

      The SQL query for this Csv Export job

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

  • destinationdict::
    • filename_prefixstring

      The prefix of the name of the file returned to the user.

    • storage_pathdict::
      • file_pathstring

        The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”

      • storage_host_idinteger

        The ID of the destination storage host.

      • credential_idinteger

        The ID of the credentials for the destination storage host.

      • existing_filesstring

        Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.

  • include_headerboolean

    A boolean value indicating whether or not the header should be included. Defaults to true.

  • compressionstring

    The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.

  • column_delimiterstring

    The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • hiddenboolean

    A boolean value indicating whether or not this request should be hidden. Defaults to false.

  • force_multifileboolean

    Whether or not the csv should be split into multiple files. Default: false

  • max_file_sizeinteger

    The max file size, in MB, created files will be. Only available when force_multifile is true.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

post_files_csv(source, destination, *, name='DEFAULT', include_header='DEFAULT', compression='DEFAULT', column_delimiter='DEFAULT', hidden='DEFAULT', force_multifile='DEFAULT', max_file_size='DEFAULT')

Create a CSV Export

Parameters
sourcedict::
  • sqlstring

    The SQL query for this Csv Export job

  • remote_host_idinteger

    The ID of the destination database host.

  • credential_idinteger

    The ID of the credentials for the destination database.

destinationdict::
  • filename_prefixstring

    The prefix of the name of the file returned to the user.

  • storage_pathdict::
    • file_pathstring

      The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”

    • storage_host_idinteger

      The ID of the destination storage host.

    • credential_idinteger

      The ID of the credentials for the destination storage host.

    • existing_filesstring

      Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.

namestring, optional

The name of this Csv Export job.

include_headerboolean, optional

A boolean value indicating whether or not the header should be included. Defaults to true.

compressionstring, optional

The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.

column_delimiterstring, optional

The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

hiddenboolean, optional

A boolean value indicating whether or not this request should be hidden. Defaults to false.

force_multifileboolean, optional

Whether or not the csv should be split into multiple files. Default: false

max_file_sizeinteger, optional

The max file size, in MB, created files will be. Only available when force_multifile is true.

Returns
civis.response.Response
  • idinteger

    The ID of this Csv Export job.

  • namestring

    The name of this Csv Export job.

  • sourcedict::
    • sqlstring

      The SQL query for this Csv Export job

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

  • destinationdict::
    • filename_prefixstring

      The prefix of the name of the file returned to the user.

    • storage_pathdict::
      • file_pathstring

        The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”

      • storage_host_idinteger

        The ID of the destination storage host.

      • credential_idinteger

        The ID of the credentials for the destination storage host.

      • existing_filesstring

        Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.

  • include_headerboolean

    A boolean value indicating whether or not the header should be included. Defaults to true.

  • compressionstring

    The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.

  • column_delimiterstring

    The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • hiddenboolean

    A boolean value indicating whether or not this request should be hidden. Defaults to false.

  • force_multifileboolean

    Whether or not the csv should be split into multiple files. Default: false

  • max_file_sizeinteger

    The max file size, in MB, created files will be. Only available when force_multifile is true.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

post_files_csv_runs(id)

Start a run

Parameters
idinteger

The ID of the csv_export.

Returns
civis.response.Response
  • id : integer

  • state : string

  • created_atstring/time

    The time that the run was queued.

  • started_atstring/time

    The time that the run started.

  • finished_atstring/time

    The time that the run completed.

  • errorstring

    The error message for this run, if present.

  • output_cached_onstring/time

    The time that the output was originally exported, if a cache entry was used by the run.

put_files_csv(id, source, destination, *, name='DEFAULT', include_header='DEFAULT', compression='DEFAULT', column_delimiter='DEFAULT', hidden='DEFAULT', force_multifile='DEFAULT', max_file_size='DEFAULT')

Replace all attributes of this CSV Export

Parameters
idinteger

The ID of this Csv Export job.

sourcedict::
  • sqlstring

    The SQL query for this Csv Export job

  • remote_host_idinteger

    The ID of the destination database host.

  • credential_idinteger

    The ID of the credentials for the destination database.

destinationdict::
  • filename_prefixstring

    The prefix of the name of the file returned to the user.

  • storage_pathdict::
    • file_pathstring

      The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”

    • storage_host_idinteger

      The ID of the destination storage host.

    • credential_idinteger

      The ID of the credentials for the destination storage host.

    • existing_filesstring

      Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.

namestring, optional

The name of this Csv Export job.

include_headerboolean, optional

A boolean value indicating whether or not the header should be included. Defaults to true.

compressionstring, optional

The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.

column_delimiterstring, optional

The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

hiddenboolean, optional

A boolean value indicating whether or not this request should be hidden. Defaults to false.

force_multifileboolean, optional

Whether or not the csv should be split into multiple files. Default: false

max_file_sizeinteger, optional

The max file size, in MB, created files will be. Only available when force_multifile is true.

Returns
civis.response.Response
  • idinteger

    The ID of this Csv Export job.

  • namestring

    The name of this Csv Export job.

  • sourcedict::
    • sqlstring

      The SQL query for this Csv Export job

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

  • destinationdict::
    • filename_prefixstring

      The prefix of the name of the file returned to the user.

    • storage_pathdict::
      • file_pathstring

        The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”

      • storage_host_idinteger

        The ID of the destination storage host.

      • credential_idinteger

        The ID of the credentials for the destination storage host.

      • existing_filesstring

        Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.

  • include_headerboolean

    A boolean value indicating whether or not the header should be included. Defaults to true.

  • compressionstring

    The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.

  • column_delimiterstring

    The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • hiddenboolean

    A boolean value indicating whether or not this request should be hidden. Defaults to false.

  • force_multifileboolean

    Whether or not the csv should be split into multiple files. Default: false

  • max_file_sizeinteger

    The max file size, in MB, created files will be. Only available when force_multifile is true.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_files_csv_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID of this Csv Export job.

  • namestring

    The name of this Csv Export job.

  • sourcedict::
    • sqlstring

      The SQL query for this Csv Export job

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

  • destinationdict::
    • filename_prefixstring

      The prefix of the name of the file returned to the user.

    • storage_pathdict::
      • file_pathstring

        The path within the bucket where the exported file will be saved. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”

      • storage_host_idinteger

        The ID of the destination storage host.

      • credential_idinteger

        The ID of the credentials for the destination storage host.

      • existing_filesstring

        Notifies the job of what to do in the case that the exported file already exists at the provided path.One of: fail, append, overwrite. Default: fail. If “append” is specified,the new file will always be added to the provided path. If “overwrite” is specifiedall existing files at the provided path will be deleted and the new file will be added.By default, or if “fail” is specified, the export will fail if a file exists at the provided path.

  • include_headerboolean

    A boolean value indicating whether or not the header should be included. Defaults to true.

  • compressionstring

    The compression of the output file. Valid arguments are “gzip” and “none”. Defaults to “gzip”.

  • column_delimiterstring

    The column delimiter for the output file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • hiddenboolean

    A boolean value indicating whether or not this request should be hidden. Defaults to false.

  • force_multifileboolean

    Whether or not the csv should be split into multiple files. Default: false

  • max_file_sizeinteger

    The max file size, in MB, created files will be. Only available when force_multifile is true.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

Files
class Files(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.files.list_projects(...)

Methods

delete_projects(id, project_id)

Remove a File from a project

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id, *[, link_expires_at, inline])

Get details about a file

get_preprocess_csv(id)

Get a Preprocess CSV

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_projects(id, *[, hidden])

List the projects a File belongs to

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, name, expires_at])

Update details about a file

patch_preprocess_csv(id, *[, file_id, ...])

Update some attributes of this Preprocess CSV

post(name, *[, expires_at])

Initiate an upload of a file into the platform

post_multipart(name, num_parts, *[, expires_at])

Initiate a multipart upload

post_multipart_complete(id)

Complete a multipart upload

post_preprocess_csv(file_id, *[, in_place, ...])

Create a Preprocess CSV

put(id, name, expires_at)

Update details about a file

put_preprocess_csv(id, file_id, *[, ...])

Replace all attributes of this Preprocess CSV

put_preprocess_csv_archive(id, status)

Update the archive status of this object

put_projects(id, project_id)

Add a File to a project

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_projects(id, project_id)

Remove a File from a project

Parameters
idinteger

The ID of the File.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id, *, link_expires_at='DEFAULT', inline='DEFAULT')

Get details about a file

Parameters
idinteger

The ID of the file.

link_expires_atstring, optional

The date and time the download link will expire. Must be a time between now and 36 hours from now. Defaults to 30 minutes from now.

inlineboolean, optional

If true, will return a url that can be displayed inline in HTML

Returns
civis.response.Response
  • idinteger

    The ID of the file.

  • namestring

    The file name.

  • created_atstring/date-time

    The date and time the file was created.

  • file_sizeinteger

    The file size.

  • expires_atstring/date-time

    The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • download_urlstring

    A JSON string containing information about the URL of the file.

  • file_urlstring

    The URL that may be used to download the file.

  • detected_infodict::
    • include_headerboolean

      A boolean value indicating whether or not the first row of the file is a header row.

    • column_delimiterstring

      The column delimiter for the file. One of “comma”, “tab”, or “pipe”.

    • compressionstring

      The type of compression of the file. One of “gzip”, or “none”.

    • table_columnslist::

      An array of hashes corresponding to the columns in the file. Each hash should have keys for column “name” and “sql_type” - name : string

      The column name.

      • sql_typestring

        The SQL type of the column.

get_preprocess_csv(id)

Get a Preprocess CSV

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID of the job created.

  • file_idinteger

    The ID of the file.

  • in_placeboolean

    If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.

  • detect_table_columnsboolean

    If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.

  • force_character_set_conversionboolean

    If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).

  • include_headerboolean

    A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.

  • column_delimiterstring

    The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.

  • hiddenboolean

    The hidden status of the item.

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_projects(id, *, hidden='DEFAULT')

List the projects a File belongs to

Parameters
idinteger

The ID of the File.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id, *, name='DEFAULT', expires_at='DEFAULT')

Update details about a file

Parameters
idinteger

The ID of the file.

namestring, optional

The file name. The extension must match the previous extension.

expires_atstring/date-time, optional

The date and time the file will expire.

Returns
civis.response.Response
  • idinteger

    The ID of the file.

  • namestring

    The file name.

  • created_atstring/date-time

    The date and time the file was created.

  • file_sizeinteger

    The file size.

  • expires_atstring/date-time

    The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • download_urlstring

    A JSON string containing information about the URL of the file.

  • file_urlstring

    The URL that may be used to download the file.

  • detected_infodict::
    • include_headerboolean

      A boolean value indicating whether or not the first row of the file is a header row.

    • column_delimiterstring

      The column delimiter for the file. One of “comma”, “tab”, or “pipe”.

    • compressionstring

      The type of compression of the file. One of “gzip”, or “none”.

    • table_columnslist::

      An array of hashes corresponding to the columns in the file. Each hash should have keys for column “name” and “sql_type” - name : string

      The column name.

      • sql_typestring

        The SQL type of the column.

patch_preprocess_csv(id, *, file_id='DEFAULT', in_place='DEFAULT', detect_table_columns='DEFAULT', force_character_set_conversion='DEFAULT', include_header='DEFAULT', column_delimiter='DEFAULT')

Update some attributes of this Preprocess CSV

Parameters
idinteger

The ID of the job created.

file_idinteger, optional

The ID of the file.

in_placeboolean, optional

If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.

detect_table_columnsboolean, optional

If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.

force_character_set_conversionboolean, optional

If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).

include_headerboolean, optional

A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.

column_delimiterstring, optional

The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.

Returns
civis.response.Response
  • idinteger

    The ID of the job created.

  • file_idinteger

    The ID of the file.

  • in_placeboolean

    If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.

  • detect_table_columnsboolean

    If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.

  • force_character_set_conversionboolean

    If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).

  • include_headerboolean

    A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.

  • column_delimiterstring

    The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.

  • hiddenboolean

    The hidden status of the item.

post(name, *, expires_at='DEFAULT')

Initiate an upload of a file into the platform

Parameters
namestring

The file name.

expires_atstring/date-time, optional

The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

Returns
civis.response.Response
  • idinteger

    The ID of the file.

  • namestring

    The file name.

  • created_atstring/date-time

    The date and time the file was created.

  • file_sizeinteger

    The file size.

  • expires_atstring/date-time

    The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

  • upload_urlstring

    The URL that may be used to upload a file. To use the upload URL, initiate a POST request to the given URL with the file you wish to import as the “file” form field.

  • upload_fieldsdict

    A hash containing the form fields to be included with the POST request.

post_multipart(name, num_parts, *, expires_at='DEFAULT')

Initiate a multipart upload

Parameters
namestring

The file name.

num_partsinteger

The number of parts in which the file will be uploaded. This parameter determines the number of presigned URLs that are returned.

expires_atstring/date-time, optional

The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

Returns
civis.response.Response
  • idinteger

    The ID of the file.

  • namestring

    The file name.

  • created_atstring/date-time

    The date and time the file was created.

  • file_sizeinteger

    The file size.

  • expires_atstring/date-time

    The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

  • upload_urlslist

    An array of URLs that may be used to upload file parts. Use separate PUT requests to complete the part uploads. Links expire after 12 hours.

post_multipart_complete(id)

Complete a multipart upload

Parameters
idinteger

The ID of the file.

Returns
None

Response code 204: success

post_preprocess_csv(file_id, *, in_place='DEFAULT', detect_table_columns='DEFAULT', force_character_set_conversion='DEFAULT', include_header='DEFAULT', column_delimiter='DEFAULT', hidden='DEFAULT')

Create a Preprocess CSV

Parameters
file_idinteger

The ID of the file.

in_placeboolean, optional

If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.

detect_table_columnsboolean, optional

If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.

force_character_set_conversionboolean, optional

If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).

include_headerboolean, optional

A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.

column_delimiterstring, optional

The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID of the job created.

  • file_idinteger

    The ID of the file.

  • in_placeboolean

    If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.

  • detect_table_columnsboolean

    If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.

  • force_character_set_conversionboolean

    If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).

  • include_headerboolean

    A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.

  • column_delimiterstring

    The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.

  • hiddenboolean

    The hidden status of the item.

put(id, name, expires_at)

Update details about a file

Parameters
idinteger

The ID of the file.

namestring

The file name. The extension must match the previous extension.

expires_atstring/date-time

The date and time the file will expire.

Returns
civis.response.Response
  • idinteger

    The ID of the file.

  • namestring

    The file name.

  • created_atstring/date-time

    The date and time the file was created.

  • file_sizeinteger

    The file size.

  • expires_atstring/date-time

    The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • download_urlstring

    A JSON string containing information about the URL of the file.

  • file_urlstring

    The URL that may be used to download the file.

  • detected_infodict::
    • include_headerboolean

      A boolean value indicating whether or not the first row of the file is a header row.

    • column_delimiterstring

      The column delimiter for the file. One of “comma”, “tab”, or “pipe”.

    • compressionstring

      The type of compression of the file. One of “gzip”, or “none”.

    • table_columnslist::

      An array of hashes corresponding to the columns in the file. Each hash should have keys for column “name” and “sql_type” - name : string

      The column name.

      • sql_typestring

        The SQL type of the column.

put_preprocess_csv(id, file_id, *, in_place='DEFAULT', detect_table_columns='DEFAULT', force_character_set_conversion='DEFAULT', include_header='DEFAULT', column_delimiter='DEFAULT')

Replace all attributes of this Preprocess CSV

Parameters
idinteger

The ID of the job created.

file_idinteger

The ID of the file.

in_placeboolean, optional

If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.

detect_table_columnsboolean, optional

If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.

force_character_set_conversionboolean, optional

If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).

include_headerboolean, optional

A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.

column_delimiterstring, optional

The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.

Returns
civis.response.Response
  • idinteger

    The ID of the job created.

  • file_idinteger

    The ID of the file.

  • in_placeboolean

    If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.

  • detect_table_columnsboolean

    If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.

  • force_character_set_conversionboolean

    If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).

  • include_headerboolean

    A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.

  • column_delimiterstring

    The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.

  • hiddenboolean

    The hidden status of the item.

put_preprocess_csv_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID of the job created.

  • file_idinteger

    The ID of the file.

  • in_placeboolean

    If true, the file is cleaned in place. If false, a new file ID is created. Defaults to true.

  • detect_table_columnsboolean

    If true, detect the table columns in the file including the sql types. If false, skip table column detection.Defaults to false.

  • force_character_set_conversionboolean

    If true, the file will always be converted to UTF-8 and any character that cannot be converted will be discarded. If false, the character set conversion will only run if the detected character set is not compatible with UTF-8 (e.g., UTF-8, ASCII).

  • include_headerboolean

    A boolean value indicating whether or not the first row of the file is a header row. If not provided, will attempt to auto-detect whether a header row is present.

  • column_delimiterstring

    The column delimiter for the file. One of “comma”, “tab”, or “pipe”. If not provided, the column delimiter will be auto-detected.

  • hiddenboolean

    The hidden status of the item.

put_projects(id, project_id)

Add a File to a project

Parameters
idinteger

The ID of the File.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Git_Repos
class Git_Repos(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.git_repos.list(...)

Methods

delete(id)

Remove the bookmark on a git repository

get(id)

Get a bookmarked git repository

list(*[, limit, page_num, order, order_dir, ...])

List bookmarked git repositories

list_refs(id)

Get all branches and tags of a bookmarked git repository

post(repo_url)

Bookmark a git repository

delete(id)

Remove the bookmark on a git repository

Parameters
idinteger

The ID for this git repository.

Returns
None

Response code 204: success

get(id)

Get a bookmarked git repository

Parameters
idinteger

The ID for this git repository.

Returns
civis.response.Response
  • idinteger

    The ID for this git repository.

  • repo_urlstring

    The URL for this git repository.

  • created_at : string/time

  • updated_at : string/time

list(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List bookmarked git repositories

Parameters
limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for this git repository.

  • repo_urlstring

    The URL for this git repository.

  • created_at : string/time

  • updated_at : string/time

list_refs(id)

Get all branches and tags of a bookmarked git repository

Parameters
idinteger

The ID for this git repository.

Returns
civis.response.Response
  • brancheslist

    List of branch names of this git repository.

  • tagslist

    List of tag names of this git repository.

post(repo_url)

Bookmark a git repository

Parameters
repo_urlstring

The URL for this git repository.

Returns
civis.response.Response
  • idinteger

    The ID for this git repository.

  • repo_urlstring

    The URL for this git repository.

  • created_at : string/time

  • updated_at : string/time

Groups
class Groups(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.groups.list(...)

Methods

delete_members(id, user_id)

Remove a user from a group

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get a Group

list(*[, query, permission, ...])

List Groups

list_child_groups(id)

Get child groups of this group

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, name, description, slug, ...])

Update some attributes of this Group

post(name, *[, description, slug, ...])

Create a Group

put(id, name, *[, description, slug, ...])

Replace all attributes of this Group

put_members(id, user_id)

Add a user to a group

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

delete_members(id, user_id)

Remove a user from a group

Parameters
idinteger

The ID of the group.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get a Group

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID of this group.

  • namestring

    This group’s name.

  • created_atstring/time

    The date and time when this group was created.

  • updated_atstring/time

    The date and time when this group was last updated.

  • descriptionstring

    The description of the group.

  • slugstring

    The slug for this group.

  • organization_idinteger

    The ID of the organization this group belongs to.

  • organization_namestring

    The name of the organization this group belongs to.

  • member_countinteger

    The number of active members in this group.

  • total_member_countinteger

    The total number of members in this group.

  • must_agree_to_eulaboolean

    Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.

  • default_otp_required_for_loginboolean

    The two factor authentication requirement for this group.

  • role_idslist

    An array of ids of all the roles this group has.

  • default_time_zonestring

    The default time zone of this group.

  • default_jobs_labelstring

    The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_notebooks_labelstring

    The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_services_labelstring

    The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • last_updated_by_idinteger

    The ID of the user who last updated this group.

  • created_by_idinteger

    The ID of the user who created this group.

  • memberslist::

    The members of this group. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

    • emailstring

      This user’s email address.

    • primary_group_idinteger

      The ID of the primary group of this user.

    • activeboolean

      The account status of this user.

list(*, query='DEFAULT', permission='DEFAULT', include_members='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Groups

Parameters
querystring, optional

If specified, it will filter the groups returned. Infix matching is supported (e.g., “query=group” will return “group” and “group of people” and “my group” and “my group of people”).

permissionstring, optional

A permissions string, one of “read”, “write”, or “manage”. Lists only groups for which the current user has that permission.

include_membersboolean, optional

Show members of the group.

limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of this group.

  • namestring

    This group’s name.

  • created_atstring/time

    The date and time when this group was created.

  • updated_atstring/time

    The date and time when this group was last updated.

  • slugstring

    The slug for this group.

  • organization_idinteger

    The ID of the organization this group belongs to.

  • organization_namestring

    The name of the organization this group belongs to.

  • member_countinteger

    The number of active members in this group.

  • total_member_countinteger

    The total number of members in this group.

  • last_updated_by_idinteger

    The ID of the user who last updated this group.

  • created_by_idinteger

    The ID of the user who created this group.

  • memberslist::

    The members of this group. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

list_child_groups(id)

Get child groups of this group

Parameters
idinteger

The ID of this group.

Returns
civis.response.Response
  • manageablelist::
    • id : integer

    • name : string

  • writeablelist::
    • id : integer

    • name : string

  • readablelist::
    • id : integer

    • name : string

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id, *, name='DEFAULT', description='DEFAULT', slug='DEFAULT', organization_id='DEFAULT', must_agree_to_eula='DEFAULT', default_otp_required_for_login='DEFAULT', role_ids='DEFAULT', default_time_zone='DEFAULT', default_jobs_label='DEFAULT', default_notebooks_label='DEFAULT', default_services_label='DEFAULT')

Update some attributes of this Group

Parameters
idinteger

The ID of this group.

namestring, optional

This group’s name.

descriptionstring, optional

The description of the group.

slugstring, optional

The slug for this group.

organization_idinteger, optional

The ID of the organization this group belongs to.

must_agree_to_eulaboolean, optional

Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.

default_otp_required_for_loginboolean, optional

The two factor authentication requirement for this group.

role_idslist, optional

An array of ids of all the roles this group has.

default_time_zonestring, optional

The default time zone of this group.

default_jobs_labelstring, optional

The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

default_notebooks_labelstring, optional

The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

default_services_labelstring, optional

The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

Returns
civis.response.Response
  • idinteger

    The ID of this group.

  • namestring

    This group’s name.

  • created_atstring/time

    The date and time when this group was created.

  • updated_atstring/time

    The date and time when this group was last updated.

  • descriptionstring

    The description of the group.

  • slugstring

    The slug for this group.

  • organization_idinteger

    The ID of the organization this group belongs to.

  • organization_namestring

    The name of the organization this group belongs to.

  • member_countinteger

    The number of active members in this group.

  • total_member_countinteger

    The total number of members in this group.

  • must_agree_to_eulaboolean

    Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.

  • default_otp_required_for_loginboolean

    The two factor authentication requirement for this group.

  • role_idslist

    An array of ids of all the roles this group has.

  • default_time_zonestring

    The default time zone of this group.

  • default_jobs_labelstring

    The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_notebooks_labelstring

    The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_services_labelstring

    The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • last_updated_by_idinteger

    The ID of the user who last updated this group.

  • created_by_idinteger

    The ID of the user who created this group.

  • memberslist::

    The members of this group. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

    • emailstring

      This user’s email address.

    • primary_group_idinteger

      The ID of the primary group of this user.

    • activeboolean

      The account status of this user.

post(name, *, description='DEFAULT', slug='DEFAULT', organization_id='DEFAULT', must_agree_to_eula='DEFAULT', default_otp_required_for_login='DEFAULT', role_ids='DEFAULT', default_time_zone='DEFAULT', default_jobs_label='DEFAULT', default_notebooks_label='DEFAULT', default_services_label='DEFAULT')

Create a Group

Parameters
namestring

This group’s name.

descriptionstring, optional

The description of the group.

slugstring, optional

The slug for this group.

organization_idinteger, optional

The ID of the organization this group belongs to.

must_agree_to_eulaboolean, optional

Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.

default_otp_required_for_loginboolean, optional

The two factor authentication requirement for this group.

role_idslist, optional

An array of ids of all the roles this group has.

default_time_zonestring, optional

The default time zone of this group.

default_jobs_labelstring, optional

The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

default_notebooks_labelstring, optional

The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

default_services_labelstring, optional

The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

Returns
civis.response.Response
  • idinteger

    The ID of this group.

  • namestring

    This group’s name.

  • created_atstring/time

    The date and time when this group was created.

  • updated_atstring/time

    The date and time when this group was last updated.

  • descriptionstring

    The description of the group.

  • slugstring

    The slug for this group.

  • organization_idinteger

    The ID of the organization this group belongs to.

  • organization_namestring

    The name of the organization this group belongs to.

  • member_countinteger

    The number of active members in this group.

  • total_member_countinteger

    The total number of members in this group.

  • must_agree_to_eulaboolean

    Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.

  • default_otp_required_for_loginboolean

    The two factor authentication requirement for this group.

  • role_idslist

    An array of ids of all the roles this group has.

  • default_time_zonestring

    The default time zone of this group.

  • default_jobs_labelstring

    The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_notebooks_labelstring

    The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_services_labelstring

    The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • last_updated_by_idinteger

    The ID of the user who last updated this group.

  • created_by_idinteger

    The ID of the user who created this group.

  • memberslist::

    The members of this group. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

    • emailstring

      This user’s email address.

    • primary_group_idinteger

      The ID of the primary group of this user.

    • activeboolean

      The account status of this user.

put(id, name, *, description='DEFAULT', slug='DEFAULT', organization_id='DEFAULT', must_agree_to_eula='DEFAULT', default_otp_required_for_login='DEFAULT', role_ids='DEFAULT', default_time_zone='DEFAULT', default_jobs_label='DEFAULT', default_notebooks_label='DEFAULT', default_services_label='DEFAULT')

Replace all attributes of this Group

Parameters
idinteger

The ID of this group.

namestring

This group’s name.

descriptionstring, optional

The description of the group.

slugstring, optional

The slug for this group.

organization_idinteger, optional

The ID of the organization this group belongs to.

must_agree_to_eulaboolean, optional

Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.

default_otp_required_for_loginboolean, optional

The two factor authentication requirement for this group.

role_idslist, optional

An array of ids of all the roles this group has.

default_time_zonestring, optional

The default time zone of this group.

default_jobs_labelstring, optional

The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

default_notebooks_labelstring, optional

The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

default_services_labelstring, optional

The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

Returns
civis.response.Response
  • idinteger

    The ID of this group.

  • namestring

    This group’s name.

  • created_atstring/time

    The date and time when this group was created.

  • updated_atstring/time

    The date and time when this group was last updated.

  • descriptionstring

    The description of the group.

  • slugstring

    The slug for this group.

  • organization_idinteger

    The ID of the organization this group belongs to.

  • organization_namestring

    The name of the organization this group belongs to.

  • member_countinteger

    The number of active members in this group.

  • total_member_countinteger

    The total number of members in this group.

  • must_agree_to_eulaboolean

    Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.

  • default_otp_required_for_loginboolean

    The two factor authentication requirement for this group.

  • role_idslist

    An array of ids of all the roles this group has.

  • default_time_zonestring

    The default time zone of this group.

  • default_jobs_labelstring

    The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_notebooks_labelstring

    The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_services_labelstring

    The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • last_updated_by_idinteger

    The ID of the user who last updated this group.

  • created_by_idinteger

    The ID of the user who created this group.

  • memberslist::

    The members of this group. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

    • emailstring

      This user’s email address.

    • primary_group_idinteger

      The ID of the primary group of this user.

    • activeboolean

      The account status of this user.

put_members(id, user_id)

Add a user to a group

Parameters
idinteger

The ID of the group.

user_idinteger

The ID of the user.

Returns
civis.response.Response
  • idinteger

    The ID of this group.

  • namestring

    This group’s name.

  • created_atstring/time

    The date and time when this group was created.

  • updated_atstring/time

    The date and time when this group was last updated.

  • descriptionstring

    The description of the group.

  • slugstring

    The slug for this group.

  • organization_idinteger

    The ID of the organization this group belongs to.

  • organization_namestring

    The name of the organization this group belongs to.

  • member_countinteger

    The number of active members in this group.

  • total_member_countinteger

    The total number of members in this group.

  • must_agree_to_eulaboolean

    Whether or not members of this group must sign the EULA. Deprecated: all users must agree to the EULA, regardless of this attribute.

  • default_otp_required_for_loginboolean

    The two factor authentication requirement for this group.

  • role_idslist

    An array of ids of all the roles this group has.

  • default_time_zonestring

    The default time zone of this group.

  • default_jobs_labelstring

    The default partition label for jobs of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_notebooks_labelstring

    The default partition label for notebooks of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • default_services_labelstring

    The default partition label for services of this group. Only available if custom_partitions feature flag is set. Do not use this attribute as it may break in the future.

  • last_updated_by_idinteger

    The ID of the user who last updated this group.

  • created_by_idinteger

    The ID of the user who created this group.

  • memberslist::

    The members of this group. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

    • emailstring

      This user’s email address.

    • primary_group_idinteger

      The ID of the primary group of this user.

    • activeboolean

      The account status of this user.

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

Imports
class Imports(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.imports.list_shares(...)

Methods

delete_files_csv_runs(id, run_id)

Cancel a run

delete_files_runs(id, run_id)

Cancel a run

delete_projects(id, project_id)

Remove an Import from a project

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get details about an import

get_batches(id)

Get details about a batch import

get_files_csv(id)

Get a CSV Import

get_files_csv_runs(id, run_id)

Check status of a run

get_files_runs(id, run_id)

Check status of a run

list(*[, type, destination, source, status, ...])

List Imports

list_batches(*[, hidden, limit, page_num, ...])

List batch imports

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_files_csv_runs(id, *[, limit, ...])

List runs for the given csv_import

list_files_csv_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_files_runs(id, *[, limit, page_num, ...])

List runs for the given import

list_files_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_projects(id, *[, hidden])

List the projects an Import belongs to

list_runs(id)

Get the run history of this import

list_runs_logs(id, run_id, *[, last_id, limit])

Get the logs for a run

list_shares(id)

List users and groups permissioned on this object

patch_files_csv(id, *[, name, source, ...])

Update some attributes of this CSV Import

post(name, sync_type, is_outbound, *[, ...])

Create a new import configuration

post_batches(file_ids, schema, table, ...[, ...])

Upload multiple files to Civis

post_cancel(id)

Cancel a run

post_files(schema, name, remote_host_id, ...)

Initate an import of a tabular file into the platform

post_files_csv(source, destination, ...[, ...])

Create a CSV Import

post_files_csv_runs(id)

Start a run

post_files_runs(id)

Start a run

post_runs(id)

Run an import

post_syncs(id, source, destination, *[, ...])

Create a sync

put(id, name, sync_type, is_outbound, *[, ...])

Update an import

put_archive(id, status)

Update the archive status of this object

put_files_csv(id, source, destination, ...)

Replace all attributes of this CSV Import

put_files_csv_archive(id, status)

Update the archive status of this object

put_projects(id, project_id)

Add an Import to a project

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_syncs(id, sync_id, source, destination, *)

Update a sync

put_syncs_archive(id, sync_id, *[, status])

Update the archive status of this sync

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_files_csv_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the csv_import.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_files_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the import.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_projects(id, project_id)

Remove an Import from a project

Parameters
idinteger

The ID of the Import.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get details about an import

Parameters
idinteger

The ID for the import.

Returns
civis.response.Response
  • namestring

    The name of the import.

  • sync_typestring

    The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.

  • sourcedict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • destinationdict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • parent_idinteger

    Parent id to trigger this import from

  • idinteger

    The ID for the import.

  • is_outbound : boolean

  • job_typestring

    The job type of this import.

  • syncslist::

    List of syncs. - id : integer - source : dict:

    - id : integer
        The ID of the table or file, if available.
    - path : string
        The path of the dataset to sync from; for a database source,
        schema.tablename. If you are doing a Google Sheet export, this
        can be blank. This is a legacy parameter, it is recommended you
        use one of the following: databaseTable, file, googleWorksheet,
        salesforce
    - database_table : dict::
        - schema : string
            The database schema name.
        - table : string
            The database table name.
        - use_without_schema : boolean
            This attribute is no longer available; defaults to false
            but cannot be used.
    - file : dict::
        - id : integer
            The file id.
    - google_worksheet : dict::
        - spreadsheet : string
            The spreadsheet document name.
        - spreadsheet_id : string
            The spreadsheet document id.
        - worksheet : string
            The worksheet tab name.
        - worksheet_id : integer
            The worksheet tab id.
    - salesforce : dict::
        - object_name : string
            The Salesforce object name.
    
    • destinationdict::
      • pathstring

        The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

      • database_tabledict::
        • schemastring

          The database schema name.

        • tablestring

          The database table name.

        • use_without_schemaboolean

          This attribute is no longer available; defaults to false but cannot be used.

      • google_worksheetdict::
        • spreadsheetstring

          The spreadsheet document name.

        • spreadsheet_idstring

          The spreadsheet document id.

        • worksheetstring

          The worksheet tab name.

        • worksheet_idinteger

          The worksheet tab id.

    • advanced_optionsdict::
      • max_errors : integer

      • existing_table_rows : string

      • diststyle : string

      • distkey : string

      • sortkey1 : string

      • sortkey2 : string

      • column_delimiter : string

      • column_overridesdict

        Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

      • escapedboolean

        If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

      • identity_column : string

      • row_chunk_size : integer

      • wipe_destination_table : boolean

      • truncate_long_lines : boolean

      • invalid_char_replacement : string

      • verify_table_row_counts : boolean

      • partition_column_namestring

        This parameter is deprecated

      • partition_schema_namestring

        This parameter is deprecated

      • partition_table_namestring

        This parameter is deprecated

      • partition_table_partition_column_min_namestring

        This parameter is deprecated

      • partition_table_partition_column_max_namestring

        This parameter is deprecated

      • last_modified_column : string

      • mysql_catalog_matches_schemaboolean

        This attribute is no longer available; defaults to true but cannot be used.

      • chunking_methodstring

        This parameter is deprecated

      • first_row_is_header : boolean

      • export_actionstring

        The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

      • sql_querystring

        If you are doing a Google Sheet export, this is your SQL query.

      • contact_lists : string

      • soql_query : string

      • include_deleted_records : boolean

  • state : string

  • created_at : string/date-time

  • updated_at : string/date-time

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this import.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

get_batches(id)

Get details about a batch import

Parameters
idinteger

The ID for the import.

Returns
civis.response.Response
  • idinteger

    The ID for the import.

  • schemastring

    The destination schema name. This schema must already exist in Redshift.

  • tablestring

    The destination table name, without the schema prefix. This table must already exist in Redshift.

  • remote_host_idinteger

    The ID of the destination database host.

  • statestring

    The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error returned by the run, if any.

  • hiddenboolean

    The hidden status of the item.

get_files_csv(id)

Get a CSV Import

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the import.

  • namestring

    The name of the import.

  • sourcedict::
    • file_idslist

      The file ID(s) to import, if importing Civis file(s).

    • storage_pathdict::
      • storage_host_idinteger

        The ID of the source storage host.

      • credential_idinteger

        The ID of the credentials for the source storage host.

      • file_pathslist

        The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

  • destinationdict::
    • schemastring

      The destination schema name.

    • tablestring

      The destination table name.

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

    • primary_keyslist

      A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

    • last_modified_keyslist

      A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

  • first_row_is_headerboolean

    A boolean value indicating whether or not the first row of the source file is a header row.

  • column_delimiterstring

    The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • escapedboolean

    A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

  • compressionstring

    The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

  • existing_table_rowsstring

    The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

  • max_errorsinteger

    The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

  • table_columnslist::

    An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string

    The column name.

    • sql_typestring

      The SQL type of the column.

  • loosen_typesboolean

    If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

  • executionstring

    In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

  • redshift_destination_optionsdict::
    • diststylestring

      The diststyle to use for the table. One of “even”, “all”, or “key”.

    • distkeystring

      Distkey for this table in Redshift

    • sortkeyslist

      Sortkeys for this table in Redshift. Please provide a maximum of two.

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

get_files_csv_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the csv_import.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • csv_import_idinteger

    The ID of the csv_import.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

get_files_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the import.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • import_idinteger

    The ID of the import.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list(*, type='DEFAULT', destination='DEFAULT', source='DEFAULT', status='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Imports

Parameters
typestring, optional

If specified, return imports of these types. It accepts a comma-separated list, possible values are ‘AutoImport’, ‘DbSync’, ‘Salesforce’, ‘GdocImport’.

destinationstring, optional

If specified, returns imports with one of these destinations. It accepts a comma-separated list of remote host ids.

sourcestring, optional

If specified, returns imports with one of these sources. It accepts a comma-separated list of remote host ids. ‘DbSync’ must be specified for ‘type’.

statusstring, optional

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

authorstring, optional

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

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • namestring

    The name of the import.

  • sync_typestring

    The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.

  • sourcedict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • destinationdict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • idinteger

    The ID for the import.

  • is_outbound : boolean

  • job_typestring

    The job type of this import.

  • state : string

  • created_at : string/date-time

  • updated_at : string/date-time

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this import.

  • archivedstring

    The archival status of the requested item(s).

list_batches(*, hidden='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List batch imports

Parameters
hiddenboolean, optional

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

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for the import.

  • schemastring

    The destination schema name. This schema must already exist in Redshift.

  • tablestring

    The destination table name, without the schema prefix. This table must already exist in Redshift.

  • remote_host_idinteger

    The ID of the destination database host.

  • statestring

    The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error returned by the run, if any.

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_files_csv_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given csv_import

Parameters
idinteger

The ID of the csv_import.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • csv_import_idinteger

    The ID of the csv_import.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list_files_csv_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the csv_import.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_files_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given import

Parameters
idinteger

The ID of the import.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • import_idinteger

    The ID of the import.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list_files_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the import.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_projects(id, *, hidden='DEFAULT')

List the projects an Import belongs to

Parameters
idinteger

The ID of the Import.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_runs(id)

Get the run history of this import

Parameters
idinteger
Returns
civis.response.Response
  • id : integer

  • state : string

  • created_atstring/time

    The time that the run was queued.

  • started_atstring/time

    The time that the run started.

  • finished_atstring/time

    The time that the run completed.

  • errorstring

    The error message for this run, if present.

list_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the import.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch_files_csv(id, *, name='DEFAULT', source='DEFAULT', destination='DEFAULT', first_row_is_header='DEFAULT', column_delimiter='DEFAULT', escaped='DEFAULT', compression='DEFAULT', existing_table_rows='DEFAULT', max_errors='DEFAULT', table_columns='DEFAULT', loosen_types='DEFAULT', execution='DEFAULT', redshift_destination_options='DEFAULT')

Update some attributes of this CSV Import

Parameters
idinteger

The ID for the import.

namestring, optional

The name of the import.

sourcedict, optional::
  • file_idslist

    The file ID(s) to import, if importing Civis file(s).

  • storage_pathdict::
    • storage_host_idinteger

      The ID of the source storage host.

    • credential_idinteger

      The ID of the credentials for the source storage host.

    • file_pathslist

      The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

destinationdict, optional::
  • schemastring

    The destination schema name.

  • tablestring

    The destination table name.

  • remote_host_idinteger

    The ID of the destination database host.

  • credential_idinteger

    The ID of the credentials for the destination database.

  • primary_keyslist

    A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

  • last_modified_keyslist

    A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

first_row_is_headerboolean, optional

A boolean value indicating whether or not the first row of the source file is a header row.

column_delimiterstring, optional

The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

escapedboolean, optional

A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

compressionstring, optional

The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

existing_table_rowsstring, optional

The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

max_errorsinteger, optional

The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

table_columnslist, optional::

An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string

The column name.

  • sql_typestring

    The SQL type of the column.

loosen_typesboolean, optional

If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

executionstring, optional

In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

redshift_destination_optionsdict, optional::
  • diststylestring

    The diststyle to use for the table. One of “even”, “all”, or “key”.

  • distkeystring

    Distkey for this table in Redshift

  • sortkeyslist

    Sortkeys for this table in Redshift. Please provide a maximum of two.

Returns
civis.response.Response
  • idinteger

    The ID for the import.

  • namestring

    The name of the import.

  • sourcedict::
    • file_idslist

      The file ID(s) to import, if importing Civis file(s).

    • storage_pathdict::
      • storage_host_idinteger

        The ID of the source storage host.

      • credential_idinteger

        The ID of the credentials for the source storage host.

      • file_pathslist

        The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

  • destinationdict::
    • schemastring

      The destination schema name.

    • tablestring

      The destination table name.

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

    • primary_keyslist

      A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

    • last_modified_keyslist

      A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

  • first_row_is_headerboolean

    A boolean value indicating whether or not the first row of the source file is a header row.

  • column_delimiterstring

    The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • escapedboolean

    A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

  • compressionstring

    The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

  • existing_table_rowsstring

    The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

  • max_errorsinteger

    The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

  • table_columnslist::

    An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string

    The column name.

    • sql_typestring

      The SQL type of the column.

  • loosen_typesboolean

    If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

  • executionstring

    In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

  • redshift_destination_optionsdict::
    • diststylestring

      The diststyle to use for the table. One of “even”, “all”, or “key”.

    • distkeystring

      Distkey for this table in Redshift

    • sortkeyslist

      Sortkeys for this table in Redshift. Please provide a maximum of two.

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

post(name, sync_type, is_outbound, *, source='DEFAULT', destination='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', parent_id='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT')

Create a new import configuration

Parameters
namestring

The name of the import.

sync_typestring

The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.

is_outboundboolean
sourcedict, optional::
  • remote_host_id : integer

  • credential_id : integer

  • additional_credentialslist

    Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

destinationdict, optional::
  • remote_host_id : integer

  • credential_id : integer

  • additional_credentialslist

    Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

parent_idinteger, optional

Parent id to trigger this import from

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this import.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • namestring

    The name of the import.

  • sync_typestring

    The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.

  • sourcedict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • destinationdict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • parent_idinteger

    Parent id to trigger this import from

  • idinteger

    The ID for the import.

  • is_outbound : boolean

  • job_typestring

    The job type of this import.

  • syncslist::

    List of syncs. - id : integer - source : dict:

    - id : integer
        The ID of the table or file, if available.
    - path : string
        The path of the dataset to sync from; for a database source,
        schema.tablename. If you are doing a Google Sheet export, this
        can be blank. This is a legacy parameter, it is recommended you
        use one of the following: databaseTable, file, googleWorksheet,
        salesforce
    - database_table : dict::
        - schema : string
            The database schema name.
        - table : string
            The database table name.
        - use_without_schema : boolean
            This attribute is no longer available; defaults to false
            but cannot be used.
    - file : dict::
        - id : integer
            The file id.
    - google_worksheet : dict::
        - spreadsheet : string
            The spreadsheet document name.
        - spreadsheet_id : string
            The spreadsheet document id.
        - worksheet : string
            The worksheet tab name.
        - worksheet_id : integer
            The worksheet tab id.
    - salesforce : dict::
        - object_name : string
            The Salesforce object name.
    
    • destinationdict::
      • pathstring

        The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

      • database_tabledict::
        • schemastring

          The database schema name.

        • tablestring

          The database table name.

        • use_without_schemaboolean

          This attribute is no longer available; defaults to false but cannot be used.

      • google_worksheetdict::
        • spreadsheetstring

          The spreadsheet document name.

        • spreadsheet_idstring

          The spreadsheet document id.

        • worksheetstring

          The worksheet tab name.

        • worksheet_idinteger

          The worksheet tab id.

    • advanced_optionsdict::
      • max_errors : integer

      • existing_table_rows : string

      • diststyle : string

      • distkey : string

      • sortkey1 : string

      • sortkey2 : string

      • column_delimiter : string

      • column_overridesdict

        Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

      • escapedboolean

        If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

      • identity_column : string

      • row_chunk_size : integer

      • wipe_destination_table : boolean

      • truncate_long_lines : boolean

      • invalid_char_replacement : string

      • verify_table_row_counts : boolean

      • partition_column_namestring

        This parameter is deprecated

      • partition_schema_namestring

        This parameter is deprecated

      • partition_table_namestring

        This parameter is deprecated

      • partition_table_partition_column_min_namestring

        This parameter is deprecated

      • partition_table_partition_column_max_namestring

        This parameter is deprecated

      • last_modified_column : string

      • mysql_catalog_matches_schemaboolean

        This attribute is no longer available; defaults to true but cannot be used.

      • chunking_methodstring

        This parameter is deprecated

      • first_row_is_header : boolean

      • export_actionstring

        The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

      • sql_querystring

        If you are doing a Google Sheet export, this is your SQL query.

      • contact_lists : string

      • soql_query : string

      • include_deleted_records : boolean

  • state : string

  • created_at : string/date-time

  • updated_at : string/date-time

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this import.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

post_batches(file_ids, schema, table, remote_host_id, credential_id, *, column_delimiter='DEFAULT', first_row_is_header='DEFAULT', compression='DEFAULT', hidden='DEFAULT')

Upload multiple files to Civis

Parameters
file_idslist

The file IDs for the import.

schemastring

The destination schema name. This schema must already exist in Redshift.

tablestring

The destination table name, without the schema prefix. This table must already exist in Redshift.

remote_host_idinteger

The ID of the destination database host.

credential_idinteger

The ID of the credentials to be used when performing the database import.

column_delimiterstring, optional

The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. If unspecified, defaults to “comma”.

first_row_is_headerboolean, optional

A boolean value indicating whether or not the first row is a header row. If unspecified, defaults to false.

compressionstring, optional

The type of compression. Valid arguments are “gzip”, “zip”, and “none”. If unspecified, defaults to “gzip”.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID for the import.

  • schemastring

    The destination schema name. This schema must already exist in Redshift.

  • tablestring

    The destination table name, without the schema prefix. This table must already exist in Redshift.

  • remote_host_idinteger

    The ID of the destination database host.

  • statestring

    The state of the run; one of “queued”, “running”, “succeeded”, “failed”, or “cancelled”.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error returned by the run, if any.

  • hiddenboolean

    The hidden status of the item.

post_cancel(id)

Cancel a run

Parameters
idinteger

The ID of the job.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • statestring

    The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

post_files(schema, name, remote_host_id, credential_id, *, max_errors='DEFAULT', existing_table_rows='DEFAULT', diststyle='DEFAULT', distkey='DEFAULT', sortkey1='DEFAULT', sortkey2='DEFAULT', column_delimiter='DEFAULT', first_row_is_header='DEFAULT', multipart='DEFAULT', escaped='DEFAULT', hidden='DEFAULT')

Initate an import of a tabular file into the platform

Parameters
schemastring

The schema of the destination table.

namestring

The name of the destination table.

remote_host_idinteger

The id of the destination database host.

credential_idinteger

The id of the credentials to be used when performing the database import.

max_errorsinteger, optional

The maximum number of rows with errors to remove from the import before failing.

existing_table_rowsstring, optional

The behaviour if a table with the requested name already exists. One of “fail”, “truncate”, “append”, or “drop”.Defaults to “fail”.

diststylestring, optional

The diststyle to use for the table. One of “even”, “all”, or “key”.

distkeystring, optional

The column to use as the distkey for the table.

sortkey1string, optional

The column to use as the sort key for the table.

sortkey2string, optional

The second column in a compound sortkey for the table.

column_delimiterstring, optional

The column delimiter of the file. If column_delimiter is null or omitted, it will be auto-detected. Valid arguments are “comma”, “tab”, and “pipe”.

first_row_is_headerboolean, optional

A boolean value indicating whether or not the first row is a header row. If first_row_is_header is null or omitted, it will be auto-detected.

multipartboolean, optional

If true, the upload URI will require a multipart/form-data POST request. Defaults to false.

escapedboolean, optional

If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The id of the import.

  • upload_uristring

    The URI which may be used to upload a tabular file for import. You must use this URI to upload the file you wish imported and then inform the Civis API when your upload is complete using the URI given by the runUri field of this response.

  • run_uristring

    The URI to POST to once the file upload is complete. After uploading the file using the URI given in the uploadUri attribute of the response, POST to this URI to initiate the import of your uploaded file into the platform.

  • upload_fieldsdict

    If multipart was set to true, these fields should be included in the multipart upload.

post_files_csv(source, destination, first_row_is_header, *, name='DEFAULT', column_delimiter='DEFAULT', escaped='DEFAULT', compression='DEFAULT', existing_table_rows='DEFAULT', max_errors='DEFAULT', table_columns='DEFAULT', loosen_types='DEFAULT', execution='DEFAULT', redshift_destination_options='DEFAULT', hidden='DEFAULT')

Create a CSV Import

Parameters
sourcedict::
  • file_idslist

    The file ID(s) to import, if importing Civis file(s).

  • storage_pathdict::
    • storage_host_idinteger

      The ID of the source storage host.

    • credential_idinteger

      The ID of the credentials for the source storage host.

    • file_pathslist

      The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

destinationdict::
  • schemastring

    The destination schema name.

  • tablestring

    The destination table name.

  • remote_host_idinteger

    The ID of the destination database host.

  • credential_idinteger

    The ID of the credentials for the destination database.

  • primary_keyslist

    A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

  • last_modified_keyslist

    A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

first_row_is_headerboolean

A boolean value indicating whether or not the first row of the source file is a header row.

namestring, optional

The name of the import.

column_delimiterstring, optional

The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

escapedboolean, optional

A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

compressionstring, optional

The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

existing_table_rowsstring, optional

The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

max_errorsinteger, optional

The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

table_columnslist, optional::

An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string

The column name.

  • sql_typestring

    The SQL type of the column.

loosen_typesboolean, optional

If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

executionstring, optional

In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

redshift_destination_optionsdict, optional::
  • diststylestring

    The diststyle to use for the table. One of “even”, “all”, or “key”.

  • distkeystring

    Distkey for this table in Redshift

  • sortkeyslist

    Sortkeys for this table in Redshift. Please provide a maximum of two.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID for the import.

  • namestring

    The name of the import.

  • sourcedict::
    • file_idslist

      The file ID(s) to import, if importing Civis file(s).

    • storage_pathdict::
      • storage_host_idinteger

        The ID of the source storage host.

      • credential_idinteger

        The ID of the credentials for the source storage host.

      • file_pathslist

        The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

  • destinationdict::
    • schemastring

      The destination schema name.

    • tablestring

      The destination table name.

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

    • primary_keyslist

      A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

    • last_modified_keyslist

      A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

  • first_row_is_headerboolean

    A boolean value indicating whether or not the first row of the source file is a header row.

  • column_delimiterstring

    The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • escapedboolean

    A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

  • compressionstring

    The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

  • existing_table_rowsstring

    The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

  • max_errorsinteger

    The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

  • table_columnslist::

    An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string

    The column name.

    • sql_typestring

      The SQL type of the column.

  • loosen_typesboolean

    If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

  • executionstring

    In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

  • redshift_destination_optionsdict::
    • diststylestring

      The diststyle to use for the table. One of “even”, “all”, or “key”.

    • distkeystring

      Distkey for this table in Redshift

    • sortkeyslist

      Sortkeys for this table in Redshift. Please provide a maximum of two.

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

post_files_csv_runs(id)

Start a run

Parameters
idinteger

The ID of the csv_import.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • csv_import_idinteger

    The ID of the csv_import.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

post_files_runs(id)

Start a run

Parameters
idinteger

The ID of the import.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • import_idinteger

    The ID of the import.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

post_runs(id)

Run an import

Parameters
idinteger

The ID of the import to run.

Returns
civis.response.Response
  • run_idinteger

    The ID of the new run triggered.

post_syncs(id, source, destination, *, advanced_options='DEFAULT')

Create a sync

Parameters
idinteger
sourcedict::
  • pathstring

    The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce

  • database_tabledict::
    • schemastring

      The database schema name.

    • tablestring

      The database table name.

    • use_without_schemaboolean

      This attribute is no longer available; defaults to false but cannot be used.

  • file : dict

  • google_worksheetdict::
    • spreadsheetstring

      The spreadsheet document name.

    • spreadsheet_idstring

      The spreadsheet document id.

    • worksheetstring

      The worksheet tab name.

    • worksheet_idinteger

      The worksheet tab id.

  • salesforcedict::
    • object_namestring

      The Salesforce object name.

destinationdict::
  • pathstring

    The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

  • database_tabledict::
    • schemastring

      The database schema name.

    • tablestring

      The database table name.

    • use_without_schemaboolean

      This attribute is no longer available; defaults to false but cannot be used.

  • google_worksheetdict::
    • spreadsheetstring

      The spreadsheet document name.

    • spreadsheet_idstring

      The spreadsheet document id.

    • worksheetstring

      The worksheet tab name.

    • worksheet_idinteger

      The worksheet tab id.

advanced_optionsdict, optional::
  • max_errors : integer

  • existing_table_rows : string

  • diststyle : string

  • distkey : string

  • sortkey1 : string

  • sortkey2 : string

  • column_delimiter : string

  • column_overridesdict

    Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

  • escapedboolean

    If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

  • identity_column : string

  • row_chunk_size : integer

  • wipe_destination_table : boolean

  • truncate_long_lines : boolean

  • invalid_char_replacement : string

  • verify_table_row_counts : boolean

  • partition_column_namestring

    This parameter is deprecated

  • partition_schema_namestring

    This parameter is deprecated

  • partition_table_namestring

    This parameter is deprecated

  • partition_table_partition_column_min_namestring

    This parameter is deprecated

  • partition_table_partition_column_max_namestring

    This parameter is deprecated

  • last_modified_column : string

  • mysql_catalog_matches_schemaboolean

    This attribute is no longer available; defaults to true but cannot be used.

  • chunking_methodstring

    This parameter is deprecated

  • first_row_is_header : boolean

  • export_actionstring

    The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

  • sql_querystring

    If you are doing a Google Sheet export, this is your SQL query.

  • contact_lists : string

  • soql_query : string

  • include_deleted_records : boolean

Returns
civis.response.Response
  • id : integer

  • sourcedict::
    • idinteger

      The ID of the table or file, if available.

    • pathstring

      The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce

    • database_tabledict::
      • schemastring

        The database schema name.

      • tablestring

        The database table name.

      • use_without_schemaboolean

        This attribute is no longer available; defaults to false but cannot be used.

    • filedict::
      • idinteger

        The file id.

    • google_worksheetdict::
      • spreadsheetstring

        The spreadsheet document name.

      • spreadsheet_idstring

        The spreadsheet document id.

      • worksheetstring

        The worksheet tab name.

      • worksheet_idinteger

        The worksheet tab id.

    • salesforcedict::
      • object_namestring

        The Salesforce object name.

  • destinationdict::
    • pathstring

      The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

    • database_tabledict::
      • schemastring

        The database schema name.

      • tablestring

        The database table name.

      • use_without_schemaboolean

        This attribute is no longer available; defaults to false but cannot be used.

    • google_worksheetdict::
      • spreadsheetstring

        The spreadsheet document name.

      • spreadsheet_idstring

        The spreadsheet document id.

      • worksheetstring

        The worksheet tab name.

      • worksheet_idinteger

        The worksheet tab id.

  • advanced_optionsdict::
    • max_errors : integer

    • existing_table_rows : string

    • diststyle : string

    • distkey : string

    • sortkey1 : string

    • sortkey2 : string

    • column_delimiter : string

    • column_overridesdict

      Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

    • escapedboolean

      If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

    • identity_column : string

    • row_chunk_size : integer

    • wipe_destination_table : boolean

    • truncate_long_lines : boolean

    • invalid_char_replacement : string

    • verify_table_row_counts : boolean

    • partition_column_namestring

      This parameter is deprecated

    • partition_schema_namestring

      This parameter is deprecated

    • partition_table_namestring

      This parameter is deprecated

    • partition_table_partition_column_min_namestring

      This parameter is deprecated

    • partition_table_partition_column_max_namestring

      This parameter is deprecated

    • last_modified_column : string

    • mysql_catalog_matches_schemaboolean

      This attribute is no longer available; defaults to true but cannot be used.

    • chunking_methodstring

      This parameter is deprecated

    • first_row_is_header : boolean

    • export_actionstring

      The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

    • sql_querystring

      If you are doing a Google Sheet export, this is your SQL query.

    • contact_lists : string

    • soql_query : string

    • include_deleted_records : boolean

put(id, name, sync_type, is_outbound, *, source='DEFAULT', destination='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', parent_id='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT')

Update an import

Parameters
idinteger

The ID for the import.

namestring

The name of the import.

sync_typestring

The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.

is_outboundboolean
sourcedict, optional::
  • remote_host_id : integer

  • credential_id : integer

  • additional_credentialslist

    Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

destinationdict, optional::
  • remote_host_id : integer

  • credential_id : integer

  • additional_credentialslist

    Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

parent_idinteger, optional

Parent id to trigger this import from

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this import.

Returns
civis.response.Response
  • namestring

    The name of the import.

  • sync_typestring

    The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.

  • sourcedict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • destinationdict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • parent_idinteger

    Parent id to trigger this import from

  • idinteger

    The ID for the import.

  • is_outbound : boolean

  • job_typestring

    The job type of this import.

  • syncslist::

    List of syncs. - id : integer - source : dict:

    - id : integer
        The ID of the table or file, if available.
    - path : string
        The path of the dataset to sync from; for a database source,
        schema.tablename. If you are doing a Google Sheet export, this
        can be blank. This is a legacy parameter, it is recommended you
        use one of the following: databaseTable, file, googleWorksheet,
        salesforce
    - database_table : dict::
        - schema : string
            The database schema name.
        - table : string
            The database table name.
        - use_without_schema : boolean
            This attribute is no longer available; defaults to false
            but cannot be used.
    - file : dict::
        - id : integer
            The file id.
    - google_worksheet : dict::
        - spreadsheet : string
            The spreadsheet document name.
        - spreadsheet_id : string
            The spreadsheet document id.
        - worksheet : string
            The worksheet tab name.
        - worksheet_id : integer
            The worksheet tab id.
    - salesforce : dict::
        - object_name : string
            The Salesforce object name.
    
    • destinationdict::
      • pathstring

        The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

      • database_tabledict::
        • schemastring

          The database schema name.

        • tablestring

          The database table name.

        • use_without_schemaboolean

          This attribute is no longer available; defaults to false but cannot be used.

      • google_worksheetdict::
        • spreadsheetstring

          The spreadsheet document name.

        • spreadsheet_idstring

          The spreadsheet document id.

        • worksheetstring

          The worksheet tab name.

        • worksheet_idinteger

          The worksheet tab id.

    • advanced_optionsdict::
      • max_errors : integer

      • existing_table_rows : string

      • diststyle : string

      • distkey : string

      • sortkey1 : string

      • sortkey2 : string

      • column_delimiter : string

      • column_overridesdict

        Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

      • escapedboolean

        If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

      • identity_column : string

      • row_chunk_size : integer

      • wipe_destination_table : boolean

      • truncate_long_lines : boolean

      • invalid_char_replacement : string

      • verify_table_row_counts : boolean

      • partition_column_namestring

        This parameter is deprecated

      • partition_schema_namestring

        This parameter is deprecated

      • partition_table_namestring

        This parameter is deprecated

      • partition_table_partition_column_min_namestring

        This parameter is deprecated

      • partition_table_partition_column_max_namestring

        This parameter is deprecated

      • last_modified_column : string

      • mysql_catalog_matches_schemaboolean

        This attribute is no longer available; defaults to true but cannot be used.

      • chunking_methodstring

        This parameter is deprecated

      • first_row_is_header : boolean

      • export_actionstring

        The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

      • sql_querystring

        If you are doing a Google Sheet export, this is your SQL query.

      • contact_lists : string

      • soql_query : string

      • include_deleted_records : boolean

  • state : string

  • created_at : string/date-time

  • updated_at : string/date-time

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this import.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • namestring

    The name of the import.

  • sync_typestring

    The type of sync to perform; one of Dbsync, AutoImport, GdocImport, GdocExport, and Salesforce.

  • sourcedict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • destinationdict::
    • remote_host_id : integer

    • credential_id : integer

    • additional_credentialslist

      Array that holds additional credentials used for specific imports. For salesforce imports, the first and only element is the client credential id. For DB Syncs, the first element is an SSL private key credential id, and the second element is the corresponding public key credential id.

    • name : string

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • parent_idinteger

    Parent id to trigger this import from

  • idinteger

    The ID for the import.

  • is_outbound : boolean

  • job_typestring

    The job type of this import.

  • syncslist::

    List of syncs. - id : integer - source : dict:

    - id : integer
        The ID of the table or file, if available.
    - path : string
        The path of the dataset to sync from; for a database source,
        schema.tablename. If you are doing a Google Sheet export, this
        can be blank. This is a legacy parameter, it is recommended you
        use one of the following: databaseTable, file, googleWorksheet,
        salesforce
    - database_table : dict::
        - schema : string
            The database schema name.
        - table : string
            The database table name.
        - use_without_schema : boolean
            This attribute is no longer available; defaults to false
            but cannot be used.
    - file : dict::
        - id : integer
            The file id.
    - google_worksheet : dict::
        - spreadsheet : string
            The spreadsheet document name.
        - spreadsheet_id : string
            The spreadsheet document id.
        - worksheet : string
            The worksheet tab name.
        - worksheet_id : integer
            The worksheet tab id.
    - salesforce : dict::
        - object_name : string
            The Salesforce object name.
    
    • destinationdict::
      • pathstring

        The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

      • database_tabledict::
        • schemastring

          The database schema name.

        • tablestring

          The database table name.

        • use_without_schemaboolean

          This attribute is no longer available; defaults to false but cannot be used.

      • google_worksheetdict::
        • spreadsheetstring

          The spreadsheet document name.

        • spreadsheet_idstring

          The spreadsheet document id.

        • worksheetstring

          The worksheet tab name.

        • worksheet_idinteger

          The worksheet tab id.

    • advanced_optionsdict::
      • max_errors : integer

      • existing_table_rows : string

      • diststyle : string

      • distkey : string

      • sortkey1 : string

      • sortkey2 : string

      • column_delimiter : string

      • column_overridesdict

        Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

      • escapedboolean

        If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

      • identity_column : string

      • row_chunk_size : integer

      • wipe_destination_table : boolean

      • truncate_long_lines : boolean

      • invalid_char_replacement : string

      • verify_table_row_counts : boolean

      • partition_column_namestring

        This parameter is deprecated

      • partition_schema_namestring

        This parameter is deprecated

      • partition_table_namestring

        This parameter is deprecated

      • partition_table_partition_column_min_namestring

        This parameter is deprecated

      • partition_table_partition_column_max_namestring

        This parameter is deprecated

      • last_modified_column : string

      • mysql_catalog_matches_schemaboolean

        This attribute is no longer available; defaults to true but cannot be used.

      • chunking_methodstring

        This parameter is deprecated

      • first_row_is_header : boolean

      • export_actionstring

        The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

      • sql_querystring

        If you are doing a Google Sheet export, this is your SQL query.

      • contact_lists : string

      • soql_query : string

      • include_deleted_records : boolean

  • state : string

  • created_at : string/date-time

  • updated_at : string/date-time

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this import.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_files_csv(id, source, destination, first_row_is_header, *, name='DEFAULT', column_delimiter='DEFAULT', escaped='DEFAULT', compression='DEFAULT', existing_table_rows='DEFAULT', max_errors='DEFAULT', table_columns='DEFAULT', loosen_types='DEFAULT', execution='DEFAULT', redshift_destination_options='DEFAULT')

Replace all attributes of this CSV Import

Parameters
idinteger

The ID for the import.

sourcedict::
  • file_idslist

    The file ID(s) to import, if importing Civis file(s).

  • storage_pathdict::
    • storage_host_idinteger

      The ID of the source storage host.

    • credential_idinteger

      The ID of the credentials for the source storage host.

    • file_pathslist

      The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

destinationdict::
  • schemastring

    The destination schema name.

  • tablestring

    The destination table name.

  • remote_host_idinteger

    The ID of the destination database host.

  • credential_idinteger

    The ID of the credentials for the destination database.

  • primary_keyslist

    A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

  • last_modified_keyslist

    A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

first_row_is_headerboolean

A boolean value indicating whether or not the first row of the source file is a header row.

namestring, optional

The name of the import.

column_delimiterstring, optional

The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

escapedboolean, optional

A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

compressionstring, optional

The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

existing_table_rowsstring, optional

The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

max_errorsinteger, optional

The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

table_columnslist, optional::

An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string

The column name.

  • sql_typestring

    The SQL type of the column.

loosen_typesboolean, optional

If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

executionstring, optional

In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

redshift_destination_optionsdict, optional::
  • diststylestring

    The diststyle to use for the table. One of “even”, “all”, or “key”.

  • distkeystring

    Distkey for this table in Redshift

  • sortkeyslist

    Sortkeys for this table in Redshift. Please provide a maximum of two.

Returns
civis.response.Response
  • idinteger

    The ID for the import.

  • namestring

    The name of the import.

  • sourcedict::
    • file_idslist

      The file ID(s) to import, if importing Civis file(s).

    • storage_pathdict::
      • storage_host_idinteger

        The ID of the source storage host.

      • credential_idinteger

        The ID of the credentials for the source storage host.

      • file_pathslist

        The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

  • destinationdict::
    • schemastring

      The destination schema name.

    • tablestring

      The destination table name.

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

    • primary_keyslist

      A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

    • last_modified_keyslist

      A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

  • first_row_is_headerboolean

    A boolean value indicating whether or not the first row of the source file is a header row.

  • column_delimiterstring

    The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • escapedboolean

    A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

  • compressionstring

    The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

  • existing_table_rowsstring

    The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

  • max_errorsinteger

    The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

  • table_columnslist::

    An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string

    The column name.

    • sql_typestring

      The SQL type of the column.

  • loosen_typesboolean

    If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

  • executionstring

    In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

  • redshift_destination_optionsdict::
    • diststylestring

      The diststyle to use for the table. One of “even”, “all”, or “key”.

    • distkeystring

      Distkey for this table in Redshift

    • sortkeyslist

      Sortkeys for this table in Redshift. Please provide a maximum of two.

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_files_csv_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the import.

  • namestring

    The name of the import.

  • sourcedict::
    • file_idslist

      The file ID(s) to import, if importing Civis file(s).

    • storage_pathdict::
      • storage_host_idinteger

        The ID of the source storage host.

      • credential_idinteger

        The ID of the credentials for the source storage host.

      • file_pathslist

        The file or directory path(s) within the bucket from which to import. E.g. the file_path for “s3://mybucket/files/all/” would be “/files/all/”If specifying a directory path, the job will import every file found under that path. All files must have the same column layout and file format (e.g., compression, columnDelimiter, etc.).

  • destinationdict::
    • schemastring

      The destination schema name.

    • tablestring

      The destination table name.

    • remote_host_idinteger

      The ID of the destination database host.

    • credential_idinteger

      The ID of the credentials for the destination database.

    • primary_keyslist

      A list of column(s) which together uniquely identify a row in the destination table.These columns must not contain NULL values. If the import mode is “upsert”, this field is required;see the Civis Helpdesk article on “Advanced CSV Imports via the Civis API” for more information.

    • last_modified_keyslist

      A list of the columns indicating a record has been updated.If the destination table does not exist, and the import mode is “upsert”, this field is required.

  • first_row_is_headerboolean

    A boolean value indicating whether or not the first row of the source file is a header row.

  • column_delimiterstring

    The column delimiter for the file. Valid arguments are “comma”, “tab”, and “pipe”. Defaults to “comma”.

  • escapedboolean

    A boolean value indicating whether or not the source file has quotes escaped with a backslash.Defaults to false.

  • compressionstring

    The type of compression of the source file. Valid arguments are “gzip” and “none”. Defaults to “none”.

  • existing_table_rowsstring

    The behavior if a destination table with the requested name already exists. One of “fail”, “truncate”, “append”, “drop”, or “upsert”.Defaults to “fail”.

  • max_errorsinteger

    The maximum number of rows with errors to ignore before failing. This option is not supported for Postgres databases.

  • table_columnslist::

    An array of hashes corresponding to the columns in the order they appear in the source file. Each hash should have keys for database column “name” and “sqlType”.This parameter is required if the table does not exist, the table is being dropped, or the columns in the source file do not appear in the same order as in the destination table.The “sqlType” key is not required when appending to an existing table. - name : string

    The column name.

    • sql_typestring

      The SQL type of the column.

  • loosen_typesboolean

    If true, SQL types with precisions/lengths will have these values increased to accommodate data growth in future loads. Type loosening only occurs on table creation. Defaults to false.

  • executionstring

    In upsert mode, controls the movement of data in upsert mode. If set to “delayed”, the data will be moved after a brief delay. If set to “immediate”, the data will be moved immediately. In non-upsert modes, controls the speed at which detailed column stats appear in the data catalogue. Defaults to “delayed”, to accommodate concurrent upserts to the same table and speedier non-upsert imports.

  • redshift_destination_optionsdict::
    • diststylestring

      The diststyle to use for the table. One of “even”, “all”, or “key”.

    • distkeystring

      Distkey for this table in Redshift

    • sortkeyslist

      Sortkeys for this table in Redshift. Please provide a maximum of two.

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

put_projects(id, project_id)

Add an Import to a project

Parameters
idinteger

The ID of the Import.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_syncs(id, sync_id, source, destination, *, advanced_options='DEFAULT')

Update a sync

Parameters
idinteger

The ID of the import to fetch.

sync_idinteger

The ID of the sync to fetch.

sourcedict::
  • pathstring

    The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce

  • database_tabledict::
    • schemastring

      The database schema name.

    • tablestring

      The database table name.

    • use_without_schemaboolean

      This attribute is no longer available; defaults to false but cannot be used.

  • file : dict

  • google_worksheetdict::
    • spreadsheetstring

      The spreadsheet document name.

    • spreadsheet_idstring

      The spreadsheet document id.

    • worksheetstring

      The worksheet tab name.

    • worksheet_idinteger

      The worksheet tab id.

  • salesforcedict::
    • object_namestring

      The Salesforce object name.

destinationdict::
  • pathstring

    The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

  • database_tabledict::
    • schemastring

      The database schema name.

    • tablestring

      The database table name.

    • use_without_schemaboolean

      This attribute is no longer available; defaults to false but cannot be used.

  • google_worksheetdict::
    • spreadsheetstring

      The spreadsheet document name.

    • spreadsheet_idstring

      The spreadsheet document id.

    • worksheetstring

      The worksheet tab name.

    • worksheet_idinteger

      The worksheet tab id.

advanced_optionsdict, optional::
  • max_errors : integer

  • existing_table_rows : string

  • diststyle : string

  • distkey : string

  • sortkey1 : string

  • sortkey2 : string

  • column_delimiter : string

  • column_overridesdict

    Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

  • escapedboolean

    If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

  • identity_column : string

  • row_chunk_size : integer

  • wipe_destination_table : boolean

  • truncate_long_lines : boolean

  • invalid_char_replacement : string

  • verify_table_row_counts : boolean

  • partition_column_namestring

    This parameter is deprecated

  • partition_schema_namestring

    This parameter is deprecated

  • partition_table_namestring

    This parameter is deprecated

  • partition_table_partition_column_min_namestring

    This parameter is deprecated

  • partition_table_partition_column_max_namestring

    This parameter is deprecated

  • last_modified_column : string

  • mysql_catalog_matches_schemaboolean

    This attribute is no longer available; defaults to true but cannot be used.

  • chunking_methodstring

    This parameter is deprecated

  • first_row_is_header : boolean

  • export_actionstring

    The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

  • sql_querystring

    If you are doing a Google Sheet export, this is your SQL query.

  • contact_lists : string

  • soql_query : string

  • include_deleted_records : boolean

Returns
civis.response.Response
  • id : integer

  • sourcedict::
    • idinteger

      The ID of the table or file, if available.

    • pathstring

      The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce

    • database_tabledict::
      • schemastring

        The database schema name.

      • tablestring

        The database table name.

      • use_without_schemaboolean

        This attribute is no longer available; defaults to false but cannot be used.

    • filedict::
      • idinteger

        The file id.

    • google_worksheetdict::
      • spreadsheetstring

        The spreadsheet document name.

      • spreadsheet_idstring

        The spreadsheet document id.

      • worksheetstring

        The worksheet tab name.

      • worksheet_idinteger

        The worksheet tab id.

    • salesforcedict::
      • object_namestring

        The Salesforce object name.

  • destinationdict::
    • pathstring

      The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

    • database_tabledict::
      • schemastring

        The database schema name.

      • tablestring

        The database table name.

      • use_without_schemaboolean

        This attribute is no longer available; defaults to false but cannot be used.

    • google_worksheetdict::
      • spreadsheetstring

        The spreadsheet document name.

      • spreadsheet_idstring

        The spreadsheet document id.

      • worksheetstring

        The worksheet tab name.

      • worksheet_idinteger

        The worksheet tab id.

  • advanced_optionsdict::
    • max_errors : integer

    • existing_table_rows : string

    • diststyle : string

    • distkey : string

    • sortkey1 : string

    • sortkey2 : string

    • column_delimiter : string

    • column_overridesdict

      Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

    • escapedboolean

      If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

    • identity_column : string

    • row_chunk_size : integer

    • wipe_destination_table : boolean

    • truncate_long_lines : boolean

    • invalid_char_replacement : string

    • verify_table_row_counts : boolean

    • partition_column_namestring

      This parameter is deprecated

    • partition_schema_namestring

      This parameter is deprecated

    • partition_table_namestring

      This parameter is deprecated

    • partition_table_partition_column_min_namestring

      This parameter is deprecated

    • partition_table_partition_column_max_namestring

      This parameter is deprecated

    • last_modified_column : string

    • mysql_catalog_matches_schemaboolean

      This attribute is no longer available; defaults to true but cannot be used.

    • chunking_methodstring

      This parameter is deprecated

    • first_row_is_header : boolean

    • export_actionstring

      The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

    • sql_querystring

      If you are doing a Google Sheet export, this is your SQL query.

    • contact_lists : string

    • soql_query : string

    • include_deleted_records : boolean

put_syncs_archive(id, sync_id, *, status='DEFAULT')

Update the archive status of this sync

Parameters
idinteger

The ID of the import to fetch.

sync_idinteger

The ID of the sync to fetch.

statusboolean, optional

The desired archived status of the sync.

Returns
civis.response.Response
  • id : integer

  • sourcedict::
    • idinteger

      The ID of the table or file, if available.

    • pathstring

      The path of the dataset to sync from; for a database source, schema.tablename. If you are doing a Google Sheet export, this can be blank. This is a legacy parameter, it is recommended you use one of the following: databaseTable, file, googleWorksheet, salesforce

    • database_tabledict::
      • schemastring

        The database schema name.

      • tablestring

        The database table name.

      • use_without_schemaboolean

        This attribute is no longer available; defaults to false but cannot be used.

    • filedict::
      • idinteger

        The file id.

    • google_worksheetdict::
      • spreadsheetstring

        The spreadsheet document name.

      • spreadsheet_idstring

        The spreadsheet document id.

      • worksheetstring

        The worksheet tab name.

      • worksheet_idinteger

        The worksheet tab id.

    • salesforcedict::
      • object_namestring

        The Salesforce object name.

  • destinationdict::
    • pathstring

      The schema.tablename to sync to. If you are doing a Google Sheet export, this is the spreadsheet and sheet name separated by a period. i.e. if you have a spreadsheet named “MySpreadsheet” and a sheet called “Sheet1” this field would be “MySpreadsheet.Sheet1”. This is a legacy parameter, it is recommended you use one of the following: databaseTable, googleWorksheet

    • database_tabledict::
      • schemastring

        The database schema name.

      • tablestring

        The database table name.

      • use_without_schemaboolean

        This attribute is no longer available; defaults to false but cannot be used.

    • google_worksheetdict::
      • spreadsheetstring

        The spreadsheet document name.

      • spreadsheet_idstring

        The spreadsheet document id.

      • worksheetstring

        The worksheet tab name.

      • worksheet_idinteger

        The worksheet tab id.

  • advanced_optionsdict::
    • max_errors : integer

    • existing_table_rows : string

    • diststyle : string

    • distkey : string

    • sortkey1 : string

    • sortkey2 : string

    • column_delimiter : string

    • column_overridesdict

      Hash used for overriding auto-detected names and types, with keys being the index of the column being overridden.

    • escapedboolean

      If true, escape quotes with a backslash; otherwise, escape quotes by double-quoting. Defaults to false.

    • identity_column : string

    • row_chunk_size : integer

    • wipe_destination_table : boolean

    • truncate_long_lines : boolean

    • invalid_char_replacement : string

    • verify_table_row_counts : boolean

    • partition_column_namestring

      This parameter is deprecated

    • partition_schema_namestring

      This parameter is deprecated

    • partition_table_namestring

      This parameter is deprecated

    • partition_table_partition_column_min_namestring

      This parameter is deprecated

    • partition_table_partition_column_max_namestring

      This parameter is deprecated

    • last_modified_column : string

    • mysql_catalog_matches_schemaboolean

      This attribute is no longer available; defaults to true but cannot be used.

    • chunking_methodstring

      This parameter is deprecated

    • first_row_is_header : boolean

    • export_actionstring

      The kind of export action you want to have the export execute. Set to “newsprsht” if you want a new worksheet inside a new spreadsheet. Set to “newwksht” if you want a new worksheet inside an existing spreadsheet. Set to “updatewksht” if you want to overwrite an existing worksheet inside an existing spreadsheet. Set to “appendwksht” if you want to append to the end of an existing worksheet inside an existing spreadsheet. Default is set to “newsprsht”

    • sql_querystring

      If you are doing a Google Sheet export, this is your SQL query.

    • contact_lists : string

    • soql_query : string

    • include_deleted_records : boolean

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Jobs
class Jobs(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.jobs.list(...)

Methods

delete_projects(id, project_id)

Remove a Job from a project

delete_runs(id, run_id)

Cancel a run

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Show basic job info

get_runs(id, run_id)

Check status of a job

list(*[, state, type, q, permission, ...])

List Jobs

list_children(id)

Show nested tree of children that this job triggers

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_parents(id)

Show chain of parents as a list that this job triggers from

list_projects(id, *[, hidden])

List the projects a Job belongs to

list_runs(id, *[, limit, page_num, order, ...])

List runs for the given job

list_runs_logs(id, run_id, *[, last_id, limit])

Get the logs for a run

list_runs_outputs(id, run_id, *[, limit, ...])

List the outputs for a run

list_shares(id)

List users and groups permissioned on this object

list_workflows(id, *[, archived])

List the workflows a job belongs to

post_runs(id)

Run a job

post_trigger_email(id)

Generate and retrieve trigger email address

put_archive(id, status)

Update the archive status of this object

put_projects(id, project_id)

Add a Job to a project

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_projects(id, project_id)

Remove a Job from a project

Parameters
idinteger

The ID of the Job.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the Job.

run_idinteger

The ID of the Run.

Returns
None

Response code 202: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Show basic job info

Parameters
idinteger

The ID for this job.

Returns
civis.response.Response
  • id : integer

  • name : string

  • type : string

  • from_template_id : integer

  • statestring

    Whether the job is idle, queued, running, cancelled, or failed.

  • created_at : string/date-time

  • updated_at : string/date-time

  • runslist::

    Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time

    The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • success_email_subject : string

  • success_email_body : string

  • running_as_user : string

  • run_by_user : string

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

get_runs(id, run_id)

Check status of a job

Parameters
idinteger

The ID of the Job.

run_idinteger

The ID of the Run.

Returns
civis.response.Response
  • id : integer

  • state : string

  • created_atstring/time

    The time that the run was queued.

  • started_atstring/time

    The time that the run started.

  • finished_atstring/time

    The time that the run completed.

  • errorstring

    The error message for this run, if present.

list(*, state='DEFAULT', type='DEFAULT', q='DEFAULT', permission='DEFAULT', scheduled='DEFAULT', hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Jobs

Parameters
statestring, optional

The job’s state. One or more of queued, running, succeeded, failed, and cancelled. Specify multiple values as a comma-separated list (e.g., “A,B”).

typestring, optional

The job’s type. Specify multiple values as a comma-separated list (e.g., “A,B”).

qstring, optional

Query string to search on the id, name, and job type.

permissionstring, optional

A permissions string, one of “read”, “write”, or “manage”. Lists only jobs for which the current user has that permission.

scheduledboolean, optional

If the item is scheduled.

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

authorstring, optional

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

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • id : integer

  • name : string

  • type : string

  • from_template_id : integer

  • statestring

    Whether the job is idle, queued, running, cancelled, or failed.

  • created_at : string/date-time

  • updated_at : string/date-time

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

list_children(id)

Show nested tree of children that this job triggers

Parameters
idinteger

The ID for this job.

Returns
civis.response.Response
  • id : integer

  • name : string

  • type : string

  • from_template_id : integer

  • state : string

  • created_at : string/date-time

  • updated_at : string/date-time

  • runslist::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • children : list

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_parents(id)

Show chain of parents as a list that this job triggers from

Parameters
idinteger

The ID for this job.

Returns
civis.response.Response
  • id : integer

  • name : string

  • type : string

  • from_template_id : integer

  • statestring

    Whether the job is idle, queued, running, cancelled, or failed.

  • created_at : string/date-time

  • updated_at : string/date-time

  • runslist::

    Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time

    The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • success_email_subject : string

  • success_email_body : string

  • running_as_user : string

  • run_by_user : string

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

list_projects(id, *, hidden='DEFAULT')

List the projects a Job belongs to

Parameters
idinteger

The ID of the Job.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given job

Parameters
idinteger

The ID for this job.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • id : integer

  • state : string

  • created_atstring/time

    The time that the run was queued.

  • started_atstring/time

    The time that the run started.

  • finished_atstring/time

    The time that the run completed.

  • errorstring

    The error message for this run, if present.

list_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the job.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the job.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_workflows(id, *, archived='DEFAULT')

List the workflows a job belongs to

Parameters
idinteger
archivedstring, optional

The archival status of the requested item(s).

Returns
civis.response.Response
  • idinteger

    The ID for this workflow.

  • namestring

    The name of this workflow.

  • descriptionstring

    A description of the workflow.

  • validboolean

    The validity of the workflow definition.

  • file_idstring

    The file id for the s3 file containing the workflow configuration.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • allow_concurrent_executionsboolean

    Whether the workflow can execute when already running.

  • time_zonestring

    The time zone of this workflow.

  • next_execution_atstring/time

    The time of the next scheduled execution.

  • archivedstring

    The archival status of the requested item(s).

  • created_at : string/time

  • updated_at : string/time

post_runs(id)

Run a job

Parameters
idinteger

The ID for this job.

Returns
civis.response.Response
  • id : integer

  • state : string

  • created_atstring/time

    The time that the run was queued.

  • started_atstring/time

    The time that the run started.

  • finished_atstring/time

    The time that the run completed.

  • errorstring

    The error message for this run, if present.

post_trigger_email(id)

Generate and retrieve trigger email address

Parameters
idinteger

The ID for this job.

Returns
civis.response.Response
  • trigger_emailstring

    Email address which may be used to trigger this job to run.

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • id : integer

  • name : string

  • type : string

  • from_template_id : integer

  • statestring

    Whether the job is idle, queued, running, cancelled, or failed.

  • created_at : string/date-time

  • updated_at : string/date-time

  • runslist::

    Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time

    The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • success_email_subject : string

  • success_email_body : string

  • running_as_user : string

  • run_by_user : string

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

put_projects(id, project_id)

Add a Job to a project

Parameters
idinteger

The ID of the Job.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Json_Values
class Json_Values(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.json_values.post(...)

Methods

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get details about a JSON Value

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, name, value_str])

Update some attributes of this JSON Value

post(value_str, *[, name])

Create a JSON Value

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get details about a JSON Value

Parameters
idinteger

The ID of the JSON Value.

Returns
civis.response.Response
  • idinteger

    The ID of the JSON Value.

  • namestring

    The name of the JSON Value.

  • valuestring

    The deserialized JSON value.

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id, *, name='DEFAULT', value_str='DEFAULT')

Update some attributes of this JSON Value

Parameters
idinteger

The ID of the JSON Value.

namestring, optional

The name of the JSON Value.

value_strstring, optional

The JSON value to store. Should be a serialized JSON string. Limited to 1000000 bytes.

Returns
civis.response.Response
  • idinteger

    The ID of the JSON Value.

  • namestring

    The name of the JSON Value.

  • valuestring

    The deserialized JSON value.

post(value_str, *, name='DEFAULT')

Create a JSON Value

Parameters
value_strstring

The JSON value to store. Should be a serialized JSON string. Limited to 1000000 bytes.

namestring, optional

The name of the JSON Value.

Returns
civis.response.Response
  • idinteger

    The ID of the JSON Value.

  • namestring

    The name of the JSON Value.

  • valuestring

    The deserialized JSON value.

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Match_Targets
class Match_Targets(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.match_targets.list_shares(...)

Methods

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Show Match Target info

list()

List match targets

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, name, target_file_name, archived])

Update a match target

post(name, *[, target_file_name, archived])

Create a new match target

put_archive(id, status)

Update the archive status of this object

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Show Match Target info

Parameters
idinteger

The ID of the match target

Returns
civis.response.Response
  • idinteger

    The ID of the match target

  • namestring

    The name of the match target

  • target_file_namestring

    The name of the target file

  • created_at : string/time

  • updated_at : string/time

  • archivedboolean

    Whether the match target has been archived.

list()

List match targets

Returns
civis.response.Response
  • idinteger

    The ID of the match target

  • namestring

    The name of the match target

  • target_file_namestring

    The name of the target file

  • created_at : string/time

  • updated_at : string/time

  • archivedboolean

    Whether the match target has been archived.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id, *, name='DEFAULT', target_file_name='DEFAULT', archived='DEFAULT')

Update a match target

Parameters
idinteger

The ID of the match target

namestring, optional

The name of the match target

target_file_namestring, optional

The name of the target file

archivedboolean, optional

Whether the match target has been archived.

Returns
civis.response.Response
  • idinteger

    The ID of the match target

  • namestring

    The name of the match target

  • target_file_namestring

    The name of the target file

  • created_at : string/time

  • updated_at : string/time

  • archivedboolean

    Whether the match target has been archived.

post(name, *, target_file_name='DEFAULT', archived='DEFAULT')

Create a new match target

Parameters
namestring

The name of the match target

target_file_namestring, optional

The name of the target file

archivedboolean, optional

Whether the match target has been archived.

Returns
civis.response.Response
  • idinteger

    The ID of the match target

  • namestring

    The name of the match target

  • target_file_namestring

    The name of the target file

  • created_at : string/time

  • updated_at : string/time

  • archivedboolean

    Whether the match target has been archived.

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID of the match target

  • namestring

    The name of the match target

  • target_file_namestring

    The name of the target file

  • created_at : string/time

  • updated_at : string/time

  • archivedboolean

    Whether the match target has been archived.

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

Media
class Media(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.media.list_spot_orders_shares(...)

Methods

delete_optimizations_runs(id, run_id)

Cancel a run

delete_optimizations_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_optimizations_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_ratecards_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_ratecards_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_spot_orders_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_spot_orders_shares_users(id, user_id)

Revoke the permissions a user has on this object

get_optimizations(id)

Show a single optimization

get_optimizations_runs(id, run_id)

Check status of a run

get_ratecards(id)

Get a Ratecard

get_spot_orders(id)

Show a single spot order

list_dmas(*[, name, number])

List all Designated Market Areas

list_optimizations(*[, archived, limit, ...])

List all optimizations

list_optimizations_runs(id, *[, limit, ...])

List runs for the given optimization

list_optimizations_runs_logs(id, run_id, *)

Get the logs for a run

list_optimizations_shares(id)

List users and groups permissioned on this object

list_ratecards(*[, archived, filename, ...])

List all ratecards

list_ratecards_shares(id)

List users and groups permissioned on this object

list_spot_orders(*[, id, archived])

List all spot orders

list_spot_orders_shares(id)

List users and groups permissioned on this object

list_targets(*[, name, identifier, data_source])

List all Media Targets

patch_optimizations(id, *[, name, runs, ...])

Edit an existing optimization

patch_ratecards(id, *[, filename, start_on, ...])

Update some attributes of this Ratecard

post_optimizations(runs, *[, name, ...])

Create a new optimization

post_optimizations_clone(id)

Clone an existing optimization

post_optimizations_runs(id)

Start a run

post_ratecards(filename, start_on, end_on, ...)

Create a Ratecard

post_spot_orders(*[, body])

Create a spot order

put_optimizations_archive(id, status)

Update the archive status of this object

put_optimizations_shares_groups(id, ...[, ...])

Set the permissions groups has on this object

put_optimizations_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_ratecards(id, filename, start_on, ...)

Replace all attributes of this Ratecard

put_ratecards_archive(id, status)

Update the archive status of this object

put_ratecards_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_ratecards_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_spot_orders(id, *[, body])

Edit the specified spot order

put_spot_orders_archive(id, status)

Update the archive status of this object

put_spot_orders_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_spot_orders_shares_users(id, user_ids, ...)

Set the permissions users have on this object

delete_optimizations_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the optimization.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_optimizations_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_optimizations_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_ratecards_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_ratecards_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_spot_orders_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_spot_orders_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get_optimizations(id)

Show a single optimization

Parameters
idinteger

The optimization ID.

Returns
civis.response.Response
  • idinteger

    The optimization ID.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of the optimization.

  • created_at : string/time

  • updated_at : string/time

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

    The state of the last run.

  • last_run_idinteger

    The ID of the last run.

  • spot_order_idinteger

    The ID for the spot order produced by the optimization.

  • archivedstring

    The archival status of the requested item(s).

  • report_linkstring

    A link to the visual report for the optimization.

  • spot_order_linkstring

    A link to the json version of the spot order.

  • file_linkslist

    Links to the csv and xml versions of the spot order.

  • runslist::

    The runs of the optimization. - market_id : integer

    The market ID.

    • start_datestring/date

      The start date for the media run.

    • end_datestring/date

      The end date for the media run.

    • force_cpmboolean

      Whether to force optimization to use CPM data even if partition data is available.

    • reach_alphanumber/float

      A tuning parameter used to adjust RF.

    • syscodeslist

      The syscodes for the media run.

    • rate_cardslist

      The ratecards for the media run.

    • constraintslist::

      The constraints for the media run. - targets : list

      The targets to constrain.

      • budgetnumber/float

        The maximum budget for these targets.

      • frequencynumber/float

        The maximum frequency for these targets.

  • programslist

    An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

  • networkslist

    An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

  • exclude_programsboolean

    If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

  • exclude_networksboolean

    If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

  • time_slot_percentagesdict

    The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.

get_optimizations_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the optimization.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • optimization_idinteger

    The ID of the optimization.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

get_ratecards(id)

Get a Ratecard

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ratecard ID.

  • filenamestring

    Name of the ratecard file.

  • start_onstring/date

    First day to which the ratecard applies.

  • end_onstring/date

    Last day to which the ratecard applies.

  • dma_numberinteger

    Number of the DMA associated with the ratecard.

  • archivedstring

    The archival status of the requested item(s).

get_spot_orders(id)

Show a single spot order

Parameters
idinteger

The ID for the spot order.

Returns
civis.response.Response
  • idinteger

    The ID for the spot order.

  • archivedstring

    The archival status of the requested item(s).

  • csv_s3_uristring

    S3 URI for the spot order CSV file.

  • json_s3_uristring

    S3 URI for the spot order JSON file.

  • xml_archive_s3_uristring

    S3 URI for the spot order XML archive.

  • last_transform_job_idinteger

    ID of the spot order transformation job.

list_dmas(*, name='DEFAULT', number='DEFAULT')

List all Designated Market Areas

Parameters
namestring, optional

If specified, will be used to filter the DMAs returned. Substring matching is supported with “%” and “*” wildcards (e.g., “name=%region%” will return both “region1” and “my region”).

numberinteger, optional

If specified, will be used to filter the DMAS by number.

Returns
civis.response.Response
  • namestring

    Name for the DMA region.

  • numberinteger

    Identifier number for a DMA.

list_optimizations(*, archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List all optimizations

Parameters
archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The optimization ID.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of the optimization.

  • created_at : string/time

  • updated_at : string/time

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

    The state of the last run.

  • last_run_idinteger

    The ID of the last run.

  • spot_order_idinteger

    The ID for the spot order produced by the optimization.

  • archivedstring

    The archival status of the requested item(s).

list_optimizations_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given optimization

Parameters
idinteger

The ID of the optimization.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • optimization_idinteger

    The ID of the optimization.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list_optimizations_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the optimization.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_optimizations_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_ratecards(*, archived='DEFAULT', filename='DEFAULT', dma_number='DEFAULT')

List all ratecards

Parameters
archivedstring, optional

The archival status of the requested item(s).

filenamestring, optional

If specified, will be used to filter the ratecards returned. Substring matching is supported with “%” and “*” wildcards (e.g., “filename=%ratecard%” will return both “ratecard 1” and “my ratecard”).

dma_numberinteger, optional

If specified, will be used to filter the ratecards by DMA.

Returns
civis.response.Response
  • idinteger

    The ratecard ID.

  • filenamestring

    Name of the ratecard file.

  • start_onstring/date

    First day to which the ratecard applies.

  • end_onstring/date

    Last day to which the ratecard applies.

  • dma_numberinteger

    Number of the DMA associated with the ratecard.

  • archivedstring

    The archival status of the requested item(s).

list_ratecards_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_spot_orders(*, id='DEFAULT', archived='DEFAULT')

List all spot orders

Parameters
idinteger, optional

The ID for the spot order.

archivedstring, optional

The archival status of the requested item(s).

Returns
civis.response.Response
  • idinteger

    The ID for the spot order.

  • archivedstring

    The archival status of the requested item(s).

list_spot_orders_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_targets(*, name='DEFAULT', identifier='DEFAULT', data_source='DEFAULT')

List all Media Targets

Parameters
namestring, optional

The name of the target.

identifierstring, optional

A unique identifier for this target.

data_sourcestring, optional

The source of viewership data for this target.

Returns
civis.response.Response
  • namestring

    The name of the target.

  • identifierstring

    A unique identifier for this target.

  • data_sourcestring

    The source of viewership data for this target.

patch_optimizations(id, *, name='DEFAULT', runs='DEFAULT', programs='DEFAULT', networks='DEFAULT', exclude_programs='DEFAULT', exclude_networks='DEFAULT', time_slot_percentages='DEFAULT')

Edit an existing optimization

Parameters
idinteger

The optimization ID.

namestring, optional

The name of the optimization.

runslist, optional::

The runs of the optimization. - market_id : integer

The market ID.

  • start_datestring/date

    The start date for the media run.

  • end_datestring/date

    The end date for the media run.

  • force_cpmboolean

    Whether to force optimization to use CPM data even if partition data is available.

  • reach_alphanumber/float

    A tuning parameter used to adjust RF.

  • syscodeslist

    The syscodes for the media run.

  • rate_cardslist

    The ratecards for the media run.

  • constraintslist::

    The constraints for the media run. - targets : list

    The targets to constrain.

    • budgetnumber/float

      The maximum budget for these targets.

    • frequencynumber/float

      The maximum frequency for these targets.

programslist, optional

An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

networkslist, optional

An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

exclude_programsboolean, optional

If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

exclude_networksboolean, optional

If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

time_slot_percentagesdict, optional

The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.

Returns
civis.response.Response
  • idinteger

    The optimization ID.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of the optimization.

  • created_at : string/time

  • updated_at : string/time

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

    The state of the last run.

  • last_run_idinteger

    The ID of the last run.

  • spot_order_idinteger

    The ID for the spot order produced by the optimization.

  • archivedstring

    The archival status of the requested item(s).

  • report_linkstring

    A link to the visual report for the optimization.

  • spot_order_linkstring

    A link to the json version of the spot order.

  • file_linkslist

    Links to the csv and xml versions of the spot order.

  • runslist::

    The runs of the optimization. - market_id : integer

    The market ID.

    • start_datestring/date

      The start date for the media run.

    • end_datestring/date

      The end date for the media run.

    • force_cpmboolean

      Whether to force optimization to use CPM data even if partition data is available.

    • reach_alphanumber/float

      A tuning parameter used to adjust RF.

    • syscodeslist

      The syscodes for the media run.

    • rate_cardslist

      The ratecards for the media run.

    • constraintslist::

      The constraints for the media run. - targets : list

      The targets to constrain.

      • budgetnumber/float

        The maximum budget for these targets.

      • frequencynumber/float

        The maximum frequency for these targets.

  • programslist

    An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

  • networkslist

    An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

  • exclude_programsboolean

    If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

  • exclude_networksboolean

    If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

  • time_slot_percentagesdict

    The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.

patch_ratecards(id, *, filename='DEFAULT', start_on='DEFAULT', end_on='DEFAULT', dma_number='DEFAULT')

Update some attributes of this Ratecard

Parameters
idinteger

The ratecard ID.

filenamestring, optional

Name of the ratecard file.

start_onstring/date, optional

First day to which the ratecard applies.

end_onstring/date, optional

Last day to which the ratecard applies.

dma_numberinteger, optional

Number of the DMA associated with the ratecard.

Returns
civis.response.Response
  • idinteger

    The ratecard ID.

  • filenamestring

    Name of the ratecard file.

  • start_onstring/date

    First day to which the ratecard applies.

  • end_onstring/date

    Last day to which the ratecard applies.

  • dma_numberinteger

    Number of the DMA associated with the ratecard.

  • archivedstring

    The archival status of the requested item(s).

post_optimizations(runs, *, name='DEFAULT', programs='DEFAULT', networks='DEFAULT', exclude_programs='DEFAULT', exclude_networks='DEFAULT', time_slot_percentages='DEFAULT')

Create a new optimization

Parameters
runslist::

The runs of the optimization. - market_id : integer

The market ID.

  • start_datestring/date

    The start date for the media run.

  • end_datestring/date

    The end date for the media run.

  • force_cpmboolean

    Whether to force optimization to use CPM data even if partition data is available.

  • reach_alphanumber/float

    A tuning parameter used to adjust RF.

  • syscodeslist

    The syscodes for the media run.

  • rate_cardslist

    The ratecards for the media run.

  • constraintslist::

    The constraints for the media run. - targets : list

    The targets to constrain.

    • budgetnumber/float

      The maximum budget for these targets.

    • frequencynumber/float

      The maximum frequency for these targets.

namestring, optional

The name of the optimization.

programslist, optional

An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

networkslist, optional

An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

exclude_programsboolean, optional

If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

exclude_networksboolean, optional

If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

time_slot_percentagesdict, optional

The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.

Returns
civis.response.Response
  • idinteger

    The optimization ID.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of the optimization.

  • created_at : string/time

  • updated_at : string/time

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

    The state of the last run.

  • last_run_idinteger

    The ID of the last run.

  • spot_order_idinteger

    The ID for the spot order produced by the optimization.

  • archivedstring

    The archival status of the requested item(s).

  • report_linkstring

    A link to the visual report for the optimization.

  • spot_order_linkstring

    A link to the json version of the spot order.

  • file_linkslist

    Links to the csv and xml versions of the spot order.

  • runslist::

    The runs of the optimization. - market_id : integer

    The market ID.

    • start_datestring/date

      The start date for the media run.

    • end_datestring/date

      The end date for the media run.

    • force_cpmboolean

      Whether to force optimization to use CPM data even if partition data is available.

    • reach_alphanumber/float

      A tuning parameter used to adjust RF.

    • syscodeslist

      The syscodes for the media run.

    • rate_cardslist

      The ratecards for the media run.

    • constraintslist::

      The constraints for the media run. - targets : list

      The targets to constrain.

      • budgetnumber/float

        The maximum budget for these targets.

      • frequencynumber/float

        The maximum frequency for these targets.

  • programslist

    An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

  • networkslist

    An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

  • exclude_programsboolean

    If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

  • exclude_networksboolean

    If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

  • time_slot_percentagesdict

    The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.

post_optimizations_clone(id)

Clone an existing optimization

Parameters
idinteger

The optimization ID.

Returns
civis.response.Response
  • idinteger

    The optimization ID.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of the optimization.

  • created_at : string/time

  • updated_at : string/time

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

    The state of the last run.

  • last_run_idinteger

    The ID of the last run.

  • spot_order_idinteger

    The ID for the spot order produced by the optimization.

  • archivedstring

    The archival status of the requested item(s).

  • report_linkstring

    A link to the visual report for the optimization.

  • spot_order_linkstring

    A link to the json version of the spot order.

  • file_linkslist

    Links to the csv and xml versions of the spot order.

  • runslist::

    The runs of the optimization. - market_id : integer

    The market ID.

    • start_datestring/date

      The start date for the media run.

    • end_datestring/date

      The end date for the media run.

    • force_cpmboolean

      Whether to force optimization to use CPM data even if partition data is available.

    • reach_alphanumber/float

      A tuning parameter used to adjust RF.

    • syscodeslist

      The syscodes for the media run.

    • rate_cardslist

      The ratecards for the media run.

    • constraintslist::

      The constraints for the media run. - targets : list

      The targets to constrain.

      • budgetnumber/float

        The maximum budget for these targets.

      • frequencynumber/float

        The maximum frequency for these targets.

  • programslist

    An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

  • networkslist

    An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

  • exclude_programsboolean

    If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

  • exclude_networksboolean

    If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

  • time_slot_percentagesdict

    The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.

post_optimizations_runs(id)

Start a run

Parameters
idinteger

The ID of the optimization.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • optimization_idinteger

    The ID of the optimization.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

post_ratecards(filename, start_on, end_on, dma_number)

Create a Ratecard

Parameters
filenamestring

Name of the ratecard file.

start_onstring/date

First day to which the ratecard applies.

end_onstring/date

Last day to which the ratecard applies.

dma_numberinteger

Number of the DMA associated with the ratecard.

Returns
civis.response.Response
  • idinteger

    The ratecard ID.

  • filenamestring

    Name of the ratecard file.

  • start_onstring/date

    First day to which the ratecard applies.

  • end_onstring/date

    Last day to which the ratecard applies.

  • dma_numberinteger

    Number of the DMA associated with the ratecard.

  • archivedstring

    The archival status of the requested item(s).

post_spot_orders(*, body='DEFAULT')

Create a spot order

Parameters
bodystring, optional

CSV body of a spot order.

Returns
civis.response.Response
  • idinteger

    The ID for the spot order.

  • archivedstring

    The archival status of the requested item(s).

  • csv_s3_uristring

    S3 URI for the spot order CSV file.

  • json_s3_uristring

    S3 URI for the spot order JSON file.

  • xml_archive_s3_uristring

    S3 URI for the spot order XML archive.

  • last_transform_job_idinteger

    ID of the spot order transformation job.

put_optimizations_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The optimization ID.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of the optimization.

  • created_at : string/time

  • updated_at : string/time

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

    The state of the last run.

  • last_run_idinteger

    The ID of the last run.

  • spot_order_idinteger

    The ID for the spot order produced by the optimization.

  • archivedstring

    The archival status of the requested item(s).

  • report_linkstring

    A link to the visual report for the optimization.

  • spot_order_linkstring

    A link to the json version of the spot order.

  • file_linkslist

    Links to the csv and xml versions of the spot order.

  • runslist::

    The runs of the optimization. - market_id : integer

    The market ID.

    • start_datestring/date

      The start date for the media run.

    • end_datestring/date

      The end date for the media run.

    • force_cpmboolean

      Whether to force optimization to use CPM data even if partition data is available.

    • reach_alphanumber/float

      A tuning parameter used to adjust RF.

    • syscodeslist

      The syscodes for the media run.

    • rate_cardslist

      The ratecards for the media run.

    • constraintslist::

      The constraints for the media run. - targets : list

      The targets to constrain.

      • budgetnumber/float

        The maximum budget for these targets.

      • frequencynumber/float

        The maximum frequency for these targets.

  • programslist

    An array of programs that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_programs is not also set.

  • networkslist

    An array of networks that the Civis Media Optimizer either exclude or limit to.An error will be thrown if exclude_networks is not also set.

  • exclude_programsboolean

    If Civis Media Optimizer should exclude the programs in the programs parameter.If this value is set to false, it will make the optimization limit itself to the programs supplied through the programs parameter.An error will be thrown if programs is not also set.

  • exclude_networksboolean

    If Civis Media Optimizer should exclude the networks in the networks parameter.If this value is set to false, it will make the optimization limit itself to the networks supplied through the networks.An error will be thrown if networks is not also set.

  • time_slot_percentagesdict

    The maximum amount of the budget spent on that particular day of the week, daypart, or specific time slot for broadcast and cable.

put_optimizations_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_optimizations_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_ratecards(id, filename, start_on, end_on, dma_number)

Replace all attributes of this Ratecard

Parameters
idinteger

The ratecard ID.

filenamestring

Name of the ratecard file.

start_onstring/date

First day to which the ratecard applies.

end_onstring/date

Last day to which the ratecard applies.

dma_numberinteger

Number of the DMA associated with the ratecard.

Returns
civis.response.Response
  • idinteger

    The ratecard ID.

  • filenamestring

    Name of the ratecard file.

  • start_onstring/date

    First day to which the ratecard applies.

  • end_onstring/date

    Last day to which the ratecard applies.

  • dma_numberinteger

    Number of the DMA associated with the ratecard.

  • archivedstring

    The archival status of the requested item(s).

put_ratecards_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ratecard ID.

  • filenamestring

    Name of the ratecard file.

  • start_onstring/date

    First day to which the ratecard applies.

  • end_onstring/date

    Last day to which the ratecard applies.

  • dma_numberinteger

    Number of the DMA associated with the ratecard.

  • archivedstring

    The archival status of the requested item(s).

put_ratecards_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_ratecards_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_spot_orders(id, *, body='DEFAULT')

Edit the specified spot order

Parameters
idinteger

The ID for the spot order.

bodystring, optional

CSV body of a spot order.

Returns
civis.response.Response
  • idinteger

    The ID for the spot order.

  • archivedstring

    The archival status of the requested item(s).

  • csv_s3_uristring

    S3 URI for the spot order CSV file.

  • json_s3_uristring

    S3 URI for the spot order JSON file.

  • xml_archive_s3_uristring

    S3 URI for the spot order XML archive.

  • last_transform_job_idinteger

    ID of the spot order transformation job.

put_spot_orders_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the spot order.

  • archivedstring

    The archival status of the requested item(s).

  • csv_s3_uristring

    S3 URI for the spot order CSV file.

  • json_s3_uristring

    S3 URI for the spot order JSON file.

  • xml_archive_s3_uristring

    S3 URI for the spot order XML archive.

  • last_transform_job_idinteger

    ID of the spot order transformation job.

put_spot_orders_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_spot_orders_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

Models
class Models(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.models.list_types(...)

Methods

delete_builds(id, build_id)

Cancel a build

delete_projects(id, project_id)

Remove a Model from a project

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Retrieve model configuration

get_builds(id, build_id)

Check status of a build

list(*[, model_name, training_table_name, ...])

List

list_builds(id, *[, limit, page_num, order, ...])

List builds for the given model

list_builds_logs(id, build_id, *[, last_id, ...])

Get the logs for a build

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_projects(id, *[, hidden])

List the projects a Model belongs to

list_schedules(id)

Show the model build schedule

list_shares(id)

List users and groups permissioned on this object

list_types()

List all available model types

put_archive(id, status)

Update the archive status of this object

put_projects(id, project_id)

Add a Model to a project

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_builds(id, build_id)

Cancel a build

Parameters
idinteger

The ID of the model.

build_idinteger

The ID of the build.

Returns
None

Response code 202: success

delete_projects(id, project_id)

Remove a Model from a project

Parameters
idinteger

The ID of the Model.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Retrieve model configuration

Parameters
idinteger

The ID of the model.

Returns
civis.response.Response
  • idinteger

    The ID of the model.

  • table_namestring

    The qualified name of the table containing the training set from which to build the model.

  • database_idinteger

    The ID of the database holding the training set table used to build the model.

  • credential_idinteger

    The ID of the credential used to read the target table. Defaults to the user’s default credential.

  • model_namestring

    The name of the model.

  • descriptionstring

    A description of the model.

  • interaction_termsboolean

    Whether to search for interaction terms.

  • box_cox_transformationboolean

    Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.

  • model_type_idinteger

    The ID of the model’s type.

  • primary_keystring

    The unique ID (primary key) of the training dataset.

  • dependent_variablestring

    The dependent variable of the training dataset.

  • dependent_variable_orderlist

    The order of dependent variables, especially useful for Ordinal Modeling.

  • excluded_columnslist

    A list of columns which will be considered ineligible to be independent variables.

  • limiting_sqlstring

    A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).

  • active_build_idinteger

    The ID of the current active build, the build used to score predictions.

  • cross_validation_parametersdict

    Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.

  • number_of_foldsinteger

    Number of folds for cross validation. Default value is 5.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    The ID of the parent job that will trigger this model.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this model.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • hiddenboolean

    The hidden status of the item.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_atstring/date-time

    The time the model was created.

  • updated_atstring/date-time

    The time the model was updated.

  • current_build_statestring

    The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.

  • current_build_exceptionstring

    Exception message, if applicable, of the current model build.

  • buildslist::

    A list of trained models available for making predictions. - id : integer

    The ID of the model build.

    • namestring

      The name of the model build.

    • created_atstring

      The time the model build was created.

    • descriptionstring

      A description of the model build.

    • root_mean_squared_errornumber/float

      A key metric for continuous models. Nil for other model types.

    • r_squared_errornumber/float

      A key metric for continuous models. Nil for other model types.

    • roc_aucnumber/float

      A key metric for binary, multinomial, and ordinal models. Nil for other model types.

  • predictionslist::

    The tables upon which the model will be applied. - id : integer

    The ID of the model to which to apply the prediction.

    • table_namestring

      The qualified name of the table on which to apply the predictive model.

    • primary_keylist

      The primary key or composite keys of the table being predicted.

    • limiting_sqlstring

      A SQL WHERE clause used to scope the rows to be predicted.

    • output_tablestring

      The qualified name of the table to be created which will contain the model’s predictions.

    • scheduledict::
      • scheduledboolean

        If the item is scheduled.

      • scheduled_dayslist

        Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

      • scheduled_hourslist

        Hours of the day it is scheduled on.

      • scheduled_minuteslist

        Minutes of the day it is scheduled on.

      • scheduled_runs_per_hourinteger

        Alternative to scheduled minutes, number of times to run per hour.

      • scheduled_days_of_monthlist

        Days of the month it is scheduled on, mutually exclusive with scheduledDays.

    • statestring

      The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.

  • last_output_locationstring

    The output JSON for the last build.

  • archivedstring

    The archival status of the requested item(s).

get_builds(id, build_id)

Check status of a build

Parameters
idinteger

The ID of the model.

build_idinteger

The ID of the build.

Returns
civis.response.Response
  • idinteger

    The ID of the model build.

  • statestring

    The state of the model build.one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • errorstring

    The error, if any, returned by the build.

  • namestring

    The name of the model build.

  • created_atstring

    The time the model build was created.

  • descriptionstring

    A description of the model build.

  • root_mean_squared_errornumber/float

    A key metric for continuous models. Nil for other model types.

  • r_squared_errornumber/float

    A key metric for continuous models. Nil for other model types.

  • roc_aucnumber/float

    A key metric for binary, multinomial, and ordinal models. Nil for other model types.

  • transformation_metadatastring

    A string representing the full JSON output of the metadata for transformation of column names

  • outputstring

    A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.

  • output_locationstring

    A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes.

list(*, model_name='DEFAULT', training_table_name='DEFAULT', dependent_variable='DEFAULT', status='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List

Parameters
model_namestring, optional

If specified, will be used to filter the models returned. Substring matching is supported. (e.g., “modelName=model” will return both “model1” and “my model”).

training_table_namestring, optional

If specified, will be used to filter the models returned by the training dataset table name. Substring matching is supported. (e.g., “trainingTableName=table” will return both “table1” and “my_table”).

dependent_variablestring, optional

If specified, will be used to filter the models returned by the dependent variable column name. Substring matching is supported. (e.g., “dependentVariable=predictor” will return both “predictor” and “my predictor”).

statusstring, optional

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

authorstring, optional

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

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the model.

  • table_namestring

    The qualified name of the table containing the training set from which to build the model.

  • database_idinteger

    The ID of the database holding the training set table used to build the model.

  • credential_idinteger

    The ID of the credential used to read the target table. Defaults to the user’s default credential.

  • model_namestring

    The name of the model.

  • descriptionstring

    A description of the model.

  • interaction_termsboolean

    Whether to search for interaction terms.

  • box_cox_transformationboolean

    Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.

  • model_type_idinteger

    The ID of the model’s type.

  • primary_keystring

    The unique ID (primary key) of the training dataset.

  • dependent_variablestring

    The dependent variable of the training dataset.

  • dependent_variable_orderlist

    The order of dependent variables, especially useful for Ordinal Modeling.

  • excluded_columnslist

    A list of columns which will be considered ineligible to be independent variables.

  • limiting_sqlstring

    A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).

  • cross_validation_parametersdict

    Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.

  • number_of_foldsinteger

    Number of folds for cross validation. Default value is 5.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    The ID of the parent job that will trigger this model.

  • time_zonestring

    The time zone of this model.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_atstring/date-time

    The time the model was created.

  • updated_atstring/date-time

    The time the model was updated.

  • current_build_statestring

    The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.

  • current_build_exceptionstring

    Exception message, if applicable, of the current model build.

  • buildslist::

    A list of trained models available for making predictions. - id : integer

    The ID of the model build.

    • namestring

      The name of the model build.

    • created_atstring

      The time the model build was created.

    • descriptionstring

      A description of the model build.

    • root_mean_squared_errornumber/float

      A key metric for continuous models. Nil for other model types.

    • r_squared_errornumber/float

      A key metric for continuous models. Nil for other model types.

    • roc_aucnumber/float

      A key metric for binary, multinomial, and ordinal models. Nil for other model types.

  • predictionslist::

    The tables upon which the model will be applied. - id : integer

    The ID of the model to which to apply the prediction.

    • table_namestring

      The qualified name of the table on which to apply the predictive model.

    • primary_keylist

      The primary key or composite keys of the table being predicted.

    • limiting_sqlstring

      A SQL WHERE clause used to scope the rows to be predicted.

    • output_tablestring

      The qualified name of the table to be created which will contain the model’s predictions.

    • statestring

      The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.

  • last_output_locationstring

    The output JSON for the last build.

  • archivedstring

    The archival status of the requested item(s).

list_builds(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List builds for the given model

Parameters
idinteger

The ID of the model.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the model build.

  • statestring

    The state of the model build.one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • errorstring

    The error, if any, returned by the build.

  • namestring

    The name of the model build.

  • created_atstring

    The time the model build was created.

  • descriptionstring

    A description of the model build.

  • root_mean_squared_errornumber/float

    A key metric for continuous models. Nil for other model types.

  • r_squared_errornumber/float

    A key metric for continuous models. Nil for other model types.

  • roc_aucnumber/float

    A key metric for binary, multinomial, and ordinal models. Nil for other model types.

  • transformation_metadatastring

    A string representing the full JSON output of the metadata for transformation of column names

  • outputstring

    A string representing the JSON output for the specified build. Only present when smaller than 10KB in size.

  • output_locationstring

    A URL representing the location of the full JSON output for the specified build.The URL link will be valid for 5 minutes.

list_builds_logs(id, build_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a build

Parameters
idinteger

The ID of the model.

build_idinteger

The ID of the build.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_projects(id, *, hidden='DEFAULT')

List the projects a Model belongs to

Parameters
idinteger

The ID of the Model.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_schedules(id)

Show the model build schedule

Parameters
idinteger

The ID of the model associated with this schedule.

Returns
civis.response.Response
  • idinteger

    The ID of the model associated with this schedule.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_types()

List all available model types

Returns
civis.response.Response
  • idinteger

    The ID of the model type.

  • algorithmstring

    The name of the algorithm used to train the model.

  • dv_typestring

    The type of dependent variable predicted by the model.

  • fint_allowedboolean

    Whether this model type supports searching for interaction terms.

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID of the model.

  • table_namestring

    The qualified name of the table containing the training set from which to build the model.

  • database_idinteger

    The ID of the database holding the training set table used to build the model.

  • credential_idinteger

    The ID of the credential used to read the target table. Defaults to the user’s default credential.

  • model_namestring

    The name of the model.

  • descriptionstring

    A description of the model.

  • interaction_termsboolean

    Whether to search for interaction terms.

  • box_cox_transformationboolean

    Whether to transform data so that it assumes a normal distribution. Valid only with continuous models.

  • model_type_idinteger

    The ID of the model’s type.

  • primary_keystring

    The unique ID (primary key) of the training dataset.

  • dependent_variablestring

    The dependent variable of the training dataset.

  • dependent_variable_orderlist

    The order of dependent variables, especially useful for Ordinal Modeling.

  • excluded_columnslist

    A list of columns which will be considered ineligible to be independent variables.

  • limiting_sqlstring

    A custom SQL WHERE clause used to filter the rows used to build the model. (e.g., “id > 105”).

  • active_build_idinteger

    The ID of the current active build, the build used to score predictions.

  • cross_validation_parametersdict

    Cross validation parameter grid for tree methods, e.g. {“n_estimators”: [100, 200, 500], “learning_rate”: [0.01, 0.1], “max_depth”: [2, 3]}.

  • number_of_foldsinteger

    Number of folds for cross validation. Default value is 5.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • parent_idinteger

    The ID of the parent job that will trigger this model.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this model.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • hiddenboolean

    The hidden status of the item.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_atstring/date-time

    The time the model was created.

  • updated_atstring/date-time

    The time the model was updated.

  • current_build_statestring

    The status of the current model build. One of “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.

  • current_build_exceptionstring

    Exception message, if applicable, of the current model build.

  • buildslist::

    A list of trained models available for making predictions. - id : integer

    The ID of the model build.

    • namestring

      The name of the model build.

    • created_atstring

      The time the model build was created.

    • descriptionstring

      A description of the model build.

    • root_mean_squared_errornumber/float

      A key metric for continuous models. Nil for other model types.

    • r_squared_errornumber/float

      A key metric for continuous models. Nil for other model types.

    • roc_aucnumber/float

      A key metric for binary, multinomial, and ordinal models. Nil for other model types.

  • predictionslist::

    The tables upon which the model will be applied. - id : integer

    The ID of the model to which to apply the prediction.

    • table_namestring

      The qualified name of the table on which to apply the predictive model.

    • primary_keylist

      The primary key or composite keys of the table being predicted.

    • limiting_sqlstring

      A SQL WHERE clause used to scope the rows to be predicted.

    • output_tablestring

      The qualified name of the table to be created which will contain the model’s predictions.

    • scheduledict::
      • scheduledboolean

        If the item is scheduled.

      • scheduled_dayslist

        Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

      • scheduled_hourslist

        Hours of the day it is scheduled on.

      • scheduled_minuteslist

        Minutes of the day it is scheduled on.

      • scheduled_runs_per_hourinteger

        Alternative to scheduled minutes, number of times to run per hour.

      • scheduled_days_of_monthlist

        Days of the month it is scheduled on, mutually exclusive with scheduledDays.

    • statestring

      The status of the prediction. One of: “succeeded”, “failed”, “queued”, or “running,”or “idle”, if no build has been attempted.

  • last_output_locationstring

    The output JSON for the last build.

  • archivedstring

    The archival status of the requested item(s).

put_projects(id, project_id)

Add a Model to a project

Parameters
idinteger

The ID of the Model.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Notebooks
class Notebooks(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.notebooks.list(...)

Methods

delete_deployments(notebook_id, deployment_id)

Delete a Notebook deployment

delete_projects(id, project_id)

Remove a Notebook from a project

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get a Notebook

get_deployments(notebook_id, deployment_id)

Get details about a Notebook deployment

get_git_commits(id, commit_hash)

Get file contents at git ref

list(*[, hidden, archived, author, status, ...])

List Notebooks

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_deployments(notebook_id, *[, ...])

List deployments for a Notebook

list_deployments_logs(id, deployment_id, *)

Get the logs for a Notebook deployment

list_git(id)

Get the git metadata attached to an item

list_git_commits(id)

Get the git commits for an item on the current branch

list_projects(id, *[, hidden])

List the projects a Notebook belongs to

list_shares(id)

List users and groups permissioned on this object

list_update_links(id)

Get URLs to update notebook

patch(id, *[, name, language, description, ...])

Update some attributes of this Notebook

patch_git(id, *[, git_ref, git_branch, ...])

Update an attached git file

post(*[, name, language, description, ...])

Create a Notebook

post_clone(id)

Clone this Notebook

post_deployments(notebook_id, *[, deployment_id])

Deploy a Notebook

post_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

put(id, *[, name, language, description, ...])

Replace all attributes of this Notebook

put_archive(id, status)

Update the archive status of this object

put_git(id, *[, git_ref, git_branch, ...])

Attach an item to a file in a git repo

put_projects(id, project_id)

Add a Notebook to a project

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_deployments(notebook_id, deployment_id)

Delete a Notebook deployment

Parameters
notebook_idinteger

The ID of the owning Notebook

deployment_idinteger

The ID for this deployment

Returns
None

Response code 204: success

delete_projects(id, project_id)

Remove a Notebook from a project

Parameters
idinteger

The ID of the Notebook.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get a Notebook

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for this notebook.

  • namestring

    The name of this notebook.

  • languagestring

    The kernel language of this notebook.

  • descriptionstring

    The description of this notebook.

  • notebook_urlstring

    Time-limited URL to get the .ipynb file for this notebook.

  • notebook_preview_urlstring

    Time-limited URL to get the .htm preview file for this notebook.

  • requirements_urlstring

    Time-limited URL to get the requirements.txt file for this notebook.

  • file_idstring

    The file ID for the S3 file containing the .ipynb file.

  • requirements_file_idstring

    The file ID for the S3 file containing the requirements.txt file.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to the notebook.

  • cpuinteger

    The amount of cpu allocated to the the notebook.

  • created_at : string/time

  • updated_at : string/time

  • most_recent_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • notebook_idinteger

      The ID of owning Notebook

  • credentialslist

    A list of credential IDs to pass to the notebook.

  • environment_variablesdict

    Environment variables to be passed into the Notebook.

  • idle_timeoutinteger

    How long the notebook will stay alive without any kernel activity.

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • git_repo_idinteger

    The ID of the git repository.

  • git_repo_urlstring

    The url of the git repository

  • git_refstring

    The git reference if git repo is specified

  • git_pathstring

    The path to the .ipynb file in the git repo that will be started up on notebook launch

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

get_deployments(notebook_id, deployment_id)

Get details about a Notebook deployment

Parameters
notebook_idinteger

The ID of the owning Notebook

deployment_idinteger

The ID for this deployment

Returns
civis.response.Response
  • deployment_idinteger

    The ID for this deployment.

  • user_idinteger

    The ID of the owner.

  • hoststring

    Domain of the deployment.

  • namestring

    Name of the deployment.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • display_urlstring

    A signed URL for viewing the deployed item.

  • instance_typestring

    The EC2 instance type requested for the deployment.

  • memoryinteger

    The memory allocated to the deployment, in MB.

  • cpuinteger

    The cpu allocated to the deployment, in millicores.

  • statestring

    The state of the deployment.

  • state_messagestring

    A detailed description of the state.

  • max_memory_usagenumber/float

    If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

  • max_cpu_usagenumber/float

    If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

  • created_at : string/time

  • updated_at : string/time

  • notebook_idinteger

    The ID of owning Notebook

get_git_commits(id, commit_hash)

Get file contents at git ref

Parameters
idinteger

The ID of the file.

commit_hashstring

The SHA (full or shortened) of the desired git commit.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

list(*, hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', status='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Notebooks

Parameters
hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

authorstring, optional

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

statusstring, optional

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

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for this notebook.

  • namestring

    The name of this notebook.

  • languagestring

    The kernel language of this notebook.

  • descriptionstring

    The description of this notebook.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • most_recent_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • notebook_idinteger

      The ID of owning Notebook

  • archivedstring

    The archival status of the requested item(s).

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_deployments(notebook_id, *, deployment_id='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List deployments for a Notebook

Parameters
notebook_idinteger

The ID of the owning Notebook

deployment_idinteger, optional

The ID for this deployment

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • deployment_idinteger

    The ID for this deployment.

  • user_idinteger

    The ID of the owner.

  • hoststring

    Domain of the deployment.

  • namestring

    Name of the deployment.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • instance_typestring

    The EC2 instance type requested for the deployment.

  • memoryinteger

    The memory allocated to the deployment, in MB.

  • cpuinteger

    The cpu allocated to the deployment, in millicores.

  • statestring

    The state of the deployment.

  • state_messagestring

    A detailed description of the state.

  • max_memory_usagenumber/float

    If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

  • max_cpu_usagenumber/float

    If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

  • created_at : string/time

  • updated_at : string/time

  • notebook_idinteger

    The ID of owning Notebook

list_deployments_logs(id, deployment_id, *, start_at='DEFAULT', end_at='DEFAULT', limit='DEFAULT')

Get the logs for a Notebook deployment

Parameters
idinteger

The ID of the owning Notebook.

deployment_idinteger

The ID for this deployment.

start_atstring, optional

Log entries with a lower timestamp will be omitted.

end_atstring, optional

Log entries with a higher timestamp will be omitted.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • messagestring

    The log message.

  • streamstring

    The stream of the log. One of “stdout”, “stderr”.

  • created_atstring/date-time

    The time the log was created.

  • sourcestring

    The source of the log. One of “system”, “user”.

list_git(id)

Get the git metadata attached to an item

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_git_commits(id)

Get the git commits for an item on the current branch

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • commit_hashstring

    The SHA of the commit.

  • author_namestring

    The name of the commit’s author.

  • datestring/time

    The commit’s timestamp.

  • messagestring

    The commit message.

list_projects(id, *, hidden='DEFAULT')

List the projects a Notebook belongs to

Parameters
idinteger

The ID of the Notebook.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

Get URLs to update notebook

Parameters
idinteger
Returns
civis.response.Response
  • update_urlstring

    Time-limited URL to PUT new contents of the .ipynb file for this notebook.

  • update_preview_urlstring

    Time-limited URL to PUT new contents of the .htm preview file for this notebook.

patch(id, *, name='DEFAULT', language='DEFAULT', description='DEFAULT', file_id='DEFAULT', requirements_file_id='DEFAULT', requirements='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT', partition_label='DEFAULT', git_repo_url='DEFAULT', git_ref='DEFAULT', git_path='DEFAULT')

Update some attributes of this Notebook

Parameters
idinteger

The ID for this notebook.

namestring, optional

The name of this notebook.

languagestring, optional

The kernel language of this notebook.

descriptionstring, optional

The description of this notebook.

file_idstring, optional

The file ID for the S3 file containing the .ipynb file.

requirements_file_idstring, optional

The file ID for the S3 file containing the requirements.txt file.

requirementsstring, optional

The requirements txt file.

docker_image_namestring, optional

The name of the docker image to pull from DockerHub.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub (default: latest).

instance_typestring, optional

The EC2 instance type to deploy to.

memoryinteger, optional

The amount of memory allocated to the notebook.

cpuinteger, optional

The amount of cpu allocated to the the notebook.

credentialslist, optional

A list of credential IDs to pass to the notebook.

environment_variablesdict, optional

Environment variables to be passed into the Notebook.

idle_timeoutinteger, optional

How long the notebook will stay alive without any kernel activity.

partition_labelstring, optional

The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

git_repo_urlstring, optional

The url of the git repository

git_refstring, optional

The git reference if git repo is specified

git_pathstring, optional

The path to the .ipynb file in the git repo that will be started up on notebook launch

Returns
civis.response.Response
  • idinteger

    The ID for this notebook.

  • namestring

    The name of this notebook.

  • languagestring

    The kernel language of this notebook.

  • descriptionstring

    The description of this notebook.

  • notebook_urlstring

    Time-limited URL to get the .ipynb file for this notebook.

  • notebook_preview_urlstring

    Time-limited URL to get the .htm preview file for this notebook.

  • requirements_urlstring

    Time-limited URL to get the requirements.txt file for this notebook.

  • file_idstring

    The file ID for the S3 file containing the .ipynb file.

  • requirements_file_idstring

    The file ID for the S3 file containing the requirements.txt file.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to the notebook.

  • cpuinteger

    The amount of cpu allocated to the the notebook.

  • created_at : string/time

  • updated_at : string/time

  • most_recent_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • notebook_idinteger

      The ID of owning Notebook

  • credentialslist

    A list of credential IDs to pass to the notebook.

  • environment_variablesdict

    Environment variables to be passed into the Notebook.

  • idle_timeoutinteger

    How long the notebook will stay alive without any kernel activity.

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • git_repo_idinteger

    The ID of the git repository.

  • git_repo_urlstring

    The url of the git repository

  • git_refstring

    The git reference if git repo is specified

  • git_pathstring

    The path to the .ipynb file in the git repo that will be started up on notebook launch

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

patch_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Update an attached git file

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

post(*, name='DEFAULT', language='DEFAULT', description='DEFAULT', file_id='DEFAULT', requirements_file_id='DEFAULT', requirements='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT', partition_label='DEFAULT', git_repo_url='DEFAULT', git_ref='DEFAULT', git_path='DEFAULT', hidden='DEFAULT')

Create a Notebook

Parameters
namestring, optional

The name of this notebook.

languagestring, optional

The kernel language of this notebook.

descriptionstring, optional

The description of this notebook.

file_idstring, optional

The file ID for the S3 file containing the .ipynb file.

requirements_file_idstring, optional

The file ID for the S3 file containing the requirements.txt file.

requirementsstring, optional

The requirements txt file.

docker_image_namestring, optional

The name of the docker image to pull from DockerHub.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub (default: latest).

instance_typestring, optional

The EC2 instance type to deploy to.

memoryinteger, optional

The amount of memory allocated to the notebook.

cpuinteger, optional

The amount of cpu allocated to the the notebook.

credentialslist, optional

A list of credential IDs to pass to the notebook.

environment_variablesdict, optional

Environment variables to be passed into the Notebook.

idle_timeoutinteger, optional

How long the notebook will stay alive without any kernel activity.

partition_labelstring, optional

The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

git_repo_urlstring, optional

The url of the git repository

git_refstring, optional

The git reference if git repo is specified

git_pathstring, optional

The path to the .ipynb file in the git repo that will be started up on notebook launch

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID for this notebook.

  • namestring

    The name of this notebook.

  • languagestring

    The kernel language of this notebook.

  • descriptionstring

    The description of this notebook.

  • notebook_urlstring

    Time-limited URL to get the .ipynb file for this notebook.

  • notebook_preview_urlstring

    Time-limited URL to get the .htm preview file for this notebook.

  • requirements_urlstring

    Time-limited URL to get the requirements.txt file for this notebook.

  • file_idstring

    The file ID for the S3 file containing the .ipynb file.

  • requirements_file_idstring

    The file ID for the S3 file containing the requirements.txt file.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to the notebook.

  • cpuinteger

    The amount of cpu allocated to the the notebook.

  • created_at : string/time

  • updated_at : string/time

  • most_recent_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • notebook_idinteger

      The ID of owning Notebook

  • credentialslist

    A list of credential IDs to pass to the notebook.

  • environment_variablesdict

    Environment variables to be passed into the Notebook.

  • idle_timeoutinteger

    How long the notebook will stay alive without any kernel activity.

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • git_repo_idinteger

    The ID of the git repository.

  • git_repo_urlstring

    The url of the git repository

  • git_refstring

    The git reference if git repo is specified

  • git_pathstring

    The path to the .ipynb file in the git repo that will be started up on notebook launch

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

post_clone(id)

Clone this Notebook

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for this notebook.

  • namestring

    The name of this notebook.

  • languagestring

    The kernel language of this notebook.

  • descriptionstring

    The description of this notebook.

  • notebook_urlstring

    Time-limited URL to get the .ipynb file for this notebook.

  • notebook_preview_urlstring

    Time-limited URL to get the .htm preview file for this notebook.

  • requirements_urlstring

    Time-limited URL to get the requirements.txt file for this notebook.

  • file_idstring

    The file ID for the S3 file containing the .ipynb file.

  • requirements_file_idstring

    The file ID for the S3 file containing the requirements.txt file.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to the notebook.

  • cpuinteger

    The amount of cpu allocated to the the notebook.

  • created_at : string/time

  • updated_at : string/time

  • most_recent_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • notebook_idinteger

      The ID of owning Notebook

  • credentialslist

    A list of credential IDs to pass to the notebook.

  • environment_variablesdict

    Environment variables to be passed into the Notebook.

  • idle_timeoutinteger

    How long the notebook will stay alive without any kernel activity.

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • git_repo_idinteger

    The ID of the git repository.

  • git_repo_urlstring

    The url of the git repository

  • git_refstring

    The git reference if git repo is specified

  • git_pathstring

    The path to the .ipynb file in the git repo that will be started up on notebook launch

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

post_deployments(notebook_id, *, deployment_id='DEFAULT')

Deploy a Notebook

Parameters
notebook_idinteger

The ID of the owning Notebook

deployment_idinteger, optional

The ID for this deployment

Returns
civis.response.Response
  • deployment_idinteger

    The ID for this deployment.

  • user_idinteger

    The ID of the owner.

  • hoststring

    Domain of the deployment.

  • namestring

    Name of the deployment.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • display_urlstring

    A signed URL for viewing the deployed item.

  • instance_typestring

    The EC2 instance type requested for the deployment.

  • memoryinteger

    The memory allocated to the deployment, in MB.

  • cpuinteger

    The cpu allocated to the deployment, in millicores.

  • statestring

    The state of the deployment.

  • state_messagestring

    A detailed description of the state.

  • max_memory_usagenumber/float

    If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

  • max_cpu_usagenumber/float

    If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

  • created_at : string/time

  • updated_at : string/time

  • notebook_idinteger

    The ID of owning Notebook

post_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

Parameters
idinteger

The ID of the file.

contentstring

The contents to commit to the file.

messagestring

A commit message describing the changes being made.

file_hashstring

The full SHA of the file being replaced.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

put(id, *, name='DEFAULT', language='DEFAULT', description='DEFAULT', file_id='DEFAULT', requirements_file_id='DEFAULT', requirements='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', environment_variables='DEFAULT', idle_timeout='DEFAULT', partition_label='DEFAULT', git_repo_url='DEFAULT', git_ref='DEFAULT', git_path='DEFAULT')

Replace all attributes of this Notebook

Parameters
idinteger

The ID for this notebook.

namestring, optional

The name of this notebook.

languagestring, optional

The kernel language of this notebook.

descriptionstring, optional

The description of this notebook.

file_idstring, optional

The file ID for the S3 file containing the .ipynb file.

requirements_file_idstring, optional

The file ID for the S3 file containing the requirements.txt file.

requirementsstring, optional

The requirements txt file.

docker_image_namestring, optional

The name of the docker image to pull from DockerHub.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub (default: latest).

instance_typestring, optional

The EC2 instance type to deploy to.

memoryinteger, optional

The amount of memory allocated to the notebook.

cpuinteger, optional

The amount of cpu allocated to the the notebook.

credentialslist, optional

A list of credential IDs to pass to the notebook.

environment_variablesdict, optional

Environment variables to be passed into the Notebook.

idle_timeoutinteger, optional

How long the notebook will stay alive without any kernel activity.

partition_labelstring, optional

The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

git_repo_urlstring, optional

The url of the git repository

git_refstring, optional

The git reference if git repo is specified

git_pathstring, optional

The path to the .ipynb file in the git repo that will be started up on notebook launch

Returns
civis.response.Response
  • idinteger

    The ID for this notebook.

  • namestring

    The name of this notebook.

  • languagestring

    The kernel language of this notebook.

  • descriptionstring

    The description of this notebook.

  • notebook_urlstring

    Time-limited URL to get the .ipynb file for this notebook.

  • notebook_preview_urlstring

    Time-limited URL to get the .htm preview file for this notebook.

  • requirements_urlstring

    Time-limited URL to get the requirements.txt file for this notebook.

  • file_idstring

    The file ID for the S3 file containing the .ipynb file.

  • requirements_file_idstring

    The file ID for the S3 file containing the requirements.txt file.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to the notebook.

  • cpuinteger

    The amount of cpu allocated to the the notebook.

  • created_at : string/time

  • updated_at : string/time

  • most_recent_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • notebook_idinteger

      The ID of owning Notebook

  • credentialslist

    A list of credential IDs to pass to the notebook.

  • environment_variablesdict

    Environment variables to be passed into the Notebook.

  • idle_timeoutinteger

    How long the notebook will stay alive without any kernel activity.

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • git_repo_idinteger

    The ID of the git repository.

  • git_repo_urlstring

    The url of the git repository

  • git_refstring

    The git reference if git repo is specified

  • git_pathstring

    The path to the .ipynb file in the git repo that will be started up on notebook launch

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for this notebook.

  • namestring

    The name of this notebook.

  • languagestring

    The kernel language of this notebook.

  • descriptionstring

    The description of this notebook.

  • notebook_urlstring

    Time-limited URL to get the .ipynb file for this notebook.

  • notebook_preview_urlstring

    Time-limited URL to get the .htm preview file for this notebook.

  • requirements_urlstring

    Time-limited URL to get the requirements.txt file for this notebook.

  • file_idstring

    The file ID for the S3 file containing the .ipynb file.

  • requirements_file_idstring

    The file ID for the S3 file containing the requirements.txt file.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to the notebook.

  • cpuinteger

    The amount of cpu allocated to the the notebook.

  • created_at : string/time

  • updated_at : string/time

  • most_recent_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • notebook_idinteger

      The ID of owning Notebook

  • credentialslist

    A list of credential IDs to pass to the notebook.

  • environment_variablesdict

    Environment variables to be passed into the Notebook.

  • idle_timeoutinteger

    How long the notebook will stay alive without any kernel activity.

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • git_repo_idinteger

    The ID of the git repository.

  • git_repo_urlstring

    The url of the git repository

  • git_refstring

    The git reference if git repo is specified

  • git_pathstring

    The path to the .ipynb file in the git repo that will be started up on notebook launch

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

put_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Attach an item to a file in a git repo

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_projects(id, project_id)

Add a Notebook to a project

Parameters
idinteger

The ID of the Notebook.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Notifications
class Notifications(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.notifications.list(...)

Methods

list(*[, last_event_id, r, mock])

Receive a stream of notifications as they come in

list(*, last_event_id='DEFAULT', r='DEFAULT', mock='DEFAULT')

Receive a stream of notifications as they come in

Parameters
last_event_idstring, optional

allows browser to keep track of last event fired

rstring, optional

specifies retry/reconnect timeout

mockstring, optional

used for testing

Returns
None

Response code 200: success

Ontology
class Ontology(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.ontology.list(...)

Methods

list(*[, subset])

List the ontology of column names Civis uses

list(*, subset='DEFAULT')

List the ontology of column names Civis uses

Parameters
subsetstring, optional

A subset of fields to return.

Returns
civis.response.Response
  • key : string

  • title : string

  • descstring

    A description of this field.

  • aliases : list

Permission_Sets
class Permission_Sets(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.permission_sets.list(...)

Methods

delete_resources(id, name)

Delete a resource in a permission set

delete_resources_shares_groups(id, name, ...)

Revoke the permissions a group has on this object

delete_resources_shares_users(id, name, user_id)

Revoke the permissions a user has on this object

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get a Permission Set

get_resources(id, name)

Get a resource in a permission set

list(*[, archived, author, limit, page_num, ...])

List Permission Sets

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_resources(id, *[, limit, page_num, ...])

List resources in a permission set

list_resources_shares(id, name)

List users and groups permissioned on this object

list_shares(id)

List users and groups permissioned on this object

list_users_permissions(id, user_id)

Get all permissions for a user, in this permission set

patch(id, *[, name, description])

Update some attributes of this Permission Set

patch_resources(id, name, *[, description])

Update a resource in a permission set

post(name, *[, description])

Create a Permission Set

post_resources(id, name, *[, description])

Create a resource in a permission set

put(id, name, *[, description])

Replace all attributes of this Permission Set

put_archive(id, status)

Update the archive status of this object

put_resources_shares_groups(id, name, ...[, ...])

Set the permissions groups has on this object

put_resources_shares_users(id, name, ...[, ...])

Set the permissions users have on this object

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_resources(id, name)

Delete a resource in a permission set

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

Returns
None

Response code 204: success

delete_resources_shares_groups(id, name, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_resources_shares_users(id, name, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get a Permission Set

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for this permission set.

  • namestring

    The name of this permission set.

  • descriptionstring

    A description of this permission set.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

get_resources(id, name)

Get a resource in a permission set

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

Returns
civis.response.Response
  • permission_set_idinteger

    The ID for the permission set this resource belongs to.

  • namestring

    The name of this resource.

  • descriptionstring

    A description of this resource.

  • created_at : string/time

  • updated_at : string/time

list(*, archived='DEFAULT', author='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Permission Sets

Parameters
archivedstring, optional

The archival status of the requested item(s).

authorstring, optional

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

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for this permission set.

  • namestring

    The name of this permission set.

  • descriptionstring

    A description of this permission set.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_resources(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List resources in a permission set

Parameters
idinteger

The ID for this permission set.

limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • permission_set_idinteger

    The ID for the permission set this resource belongs to.

  • namestring

    The name of this resource.

  • descriptionstring

    A description of this resource.

  • created_at : string/time

  • updated_at : string/time

list_resources_shares(id, name)

List users and groups permissioned on this object

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_users_permissions(id, user_id)

Get all permissions for a user, in this permission set

Parameters
idinteger

The ID for this permission set.

user_idinteger

The ID for the user.

Returns
civis.response.Response
  • resource_namestring

    The name of the resource.

  • readboolean

    If true, the user has read permission on this resource.

  • writeboolean

    If true, the user has write permission on this resource.

  • manageboolean

    If true, the user has manage permission on this resource.

patch(id, *, name='DEFAULT', description='DEFAULT')

Update some attributes of this Permission Set

Parameters
idinteger

The ID for this permission set.

namestring, optional

The name of this permission set.

descriptionstring, optional

A description of this permission set.

Returns
civis.response.Response
  • idinteger

    The ID for this permission set.

  • namestring

    The name of this permission set.

  • descriptionstring

    A description of this permission set.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

patch_resources(id, name, *, description='DEFAULT')

Update a resource in a permission set

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

descriptionstring, optional

A description of this resource.

Returns
civis.response.Response
  • permission_set_idinteger

    The ID for the permission set this resource belongs to.

  • namestring

    The name of this resource.

  • descriptionstring

    A description of this resource.

  • created_at : string/time

  • updated_at : string/time

post(name, *, description='DEFAULT')

Create a Permission Set

Parameters
namestring

The name of this permission set.

descriptionstring, optional

A description of this permission set.

Returns
civis.response.Response
  • idinteger

    The ID for this permission set.

  • namestring

    The name of this permission set.

  • descriptionstring

    A description of this permission set.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

post_resources(id, name, *, description='DEFAULT')

Create a resource in a permission set

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

descriptionstring, optional

A description of this resource.

Returns
civis.response.Response
  • permission_set_idinteger

    The ID for the permission set this resource belongs to.

  • namestring

    The name of this resource.

  • descriptionstring

    A description of this resource.

  • created_at : string/time

  • updated_at : string/time

put(id, name, *, description='DEFAULT')

Replace all attributes of this Permission Set

Parameters
idinteger

The ID for this permission set.

namestring

The name of this permission set.

descriptionstring, optional

A description of this permission set.

Returns
civis.response.Response
  • idinteger

    The ID for this permission set.

  • namestring

    The name of this permission set.

  • descriptionstring

    A description of this permission set.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for this permission set.

  • namestring

    The name of this permission set.

  • descriptionstring

    A description of this permission set.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

put_resources_shares_groups(id, name, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_resources_shares_users(id, name, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID for this permission set.

namestring

The name of this resource.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Predictions
class Predictions(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.predictions.list(...)

Methods

get(id)

Show the specified prediction

list(*[, model_id])

List predictions

list_schedules(id)

Show the prediction schedule

get(id)

Show the specified prediction

Parameters
idinteger

The ID of the prediction.

Returns
civis.response.Response
  • idinteger

    The ID of the prediction.

  • model_idinteger

    The ID of the model used for this prediction.

  • scored_table_idinteger

    The ID of the source table for this prediction.

  • scored_table_namestring

    The name of the source table for this prediction.

  • output_table_namestring

    The name of the output table for this prediction.

  • statestring

    The state of the last run of this prediction.

  • errorstring

    The error, if any, of the last run of this prediction.

  • started_atstring/date-time

    The start time of the last run of this prediction.

  • finished_atstring/date-time

    The end time of the last run of this prediction.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • scored_tableslist::

    An array of created prediction tables. - id : integer

    The ID of the table with created predictions.

    • schemastring

      The schema of table with created predictions.

    • namestring

      The name of table with created predictions.

    • created_atstring/date-time

      The time when the table with created predictions was created.

    • score_statslist::

      An array of metrics on the created predictions. - score_name : string

      The name of the score.

      • histogramlist

        The histogram of the distribution of scores.

      • avg_scorenumber/float

        The average score.

      • min_scorenumber/float

        The minimum score.

      • max_scorenumber/float

        The maximum score.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • limiting_sqlstring

    A SQL WHERE clause used to scope the rows to be predicted.

  • primary_keylist

    The primary key or composite keys of the table being predicted.

list(*, model_id='DEFAULT')

List predictions

Parameters
model_idinteger, optional

If specified, only return predictions associated with this model ID.

Returns
civis.response.Response
  • idinteger

    The ID of the prediction.

  • model_idinteger

    The ID of the model used for this prediction.

  • scored_table_idinteger

    The ID of the source table for this prediction.

  • scored_table_namestring

    The name of the source table for this prediction.

  • output_table_namestring

    The name of the output table for this prediction.

  • statestring

    The state of the last run of this prediction.

  • errorstring

    The error, if any, of the last run of this prediction.

  • started_atstring/date-time

    The start time of the last run of this prediction.

  • finished_atstring/date-time

    The end time of the last run of this prediction.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

list_schedules(id)

Show the prediction schedule

Parameters
idinteger

ID of the prediction associated with this schedule.

Returns
civis.response.Response
  • idinteger

    ID of the prediction associated with this schedule.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • score_on_model_buildboolean

    Whether the prediction will run after a rebuild of the associated model.

Projects
class Projects(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.projects.list(...)

Methods

delete_parent_projects(id, parent_project_id)

Remove an item from a Parent Project

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(project_id)

Get a detailed view of a project and the objects in it

list(*[, permission, author, hidden, ...])

List projects

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_parent_projects(id, *[, hidden])

List the Parent Projects an item belongs to

list_shares(id)

List users and groups permissioned on this object

post(name, description, *[, note, hidden])

Create a project

put(project_id, *[, name, description, ...])

Update a project

put_archive(id, status)

Update the archive status of this object

put_parent_projects(id, parent_project_id)

Add an item to a Parent Project

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_parent_projects(id, parent_project_id)

Remove an item from a Parent Project

Parameters
idinteger

The ID of the item.

parent_project_idinteger

The ID of the Parent Project.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(project_id)

Get a detailed view of a project and the objects in it

Parameters
project_idinteger
Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • tableslist::
    • schema : string

    • name : string

    • row_count : integer

    • column_count : integer

    • created_at : string/time

    • updated_at : string/time

  • surveyslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

  • scriptslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • importslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • exportslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • modelslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

  • notebookslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • current_deployment_id : integer

    • last_deploydict::
      • state : string

      • updated_at : string/time

  • serviceslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • current_deployment_id : integer

    • last_deploydict::
      • state : string

      • updated_at : string/time

  • workflowslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

    • last_executiondict::
      • state : string

      • updated_at : string/time

  • reportslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

  • script_templateslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

  • fileslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • file_name : string

    • file_size : integer

    • expired : boolean

  • enhancementslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • projectslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • description : string

  • all_objectslist::
    • project_id : integer

    • object_id : integer

    • object_type : string

    • fco_type : string

    • sub_type : string

    • name : string

    • icon : string

    • author : string

    • updated_at : string/time

    • archivedstring

      The archival status of the requested item(s).

    • hiddenboolean

      The hidden status of the item.

  • note : string

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • parent_projectdict::
    • idinteger

      The parent project’s ID.

    • nameinteger

      The parent project’s name.

list(*, permission='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List projects

Parameters
permissionstring, optional

A permissions string, one of “read”, “write”, or “manage”. Lists only projects for which the current user has that permission.

authorstring, optional

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

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_parent_projects(id, *, hidden='DEFAULT')

List the Parent Projects an item belongs to

Parameters
idinteger

The ID of the item.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

post(name, description, *, note='DEFAULT', hidden='DEFAULT')

Create a project

Parameters
namestring

The name of this project.

descriptionstring

A description of the project.

notestring, optional

Notes for the project.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • tableslist::
    • schema : string

    • name : string

    • row_count : integer

    • column_count : integer

    • created_at : string/time

    • updated_at : string/time

  • surveyslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

  • scriptslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • importslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • exportslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • modelslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

  • notebookslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • current_deployment_id : integer

    • last_deploydict::
      • state : string

      • updated_at : string/time

  • serviceslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • current_deployment_id : integer

    • last_deploydict::
      • state : string

      • updated_at : string/time

  • workflowslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

    • last_executiondict::
      • state : string

      • updated_at : string/time

  • reportslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

  • script_templateslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

  • fileslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • file_name : string

    • file_size : integer

    • expired : boolean

  • enhancementslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • projectslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • description : string

  • all_objectslist::
    • project_id : integer

    • object_id : integer

    • object_type : string

    • fco_type : string

    • sub_type : string

    • name : string

    • icon : string

    • author : string

    • updated_at : string/time

    • archivedstring

      The archival status of the requested item(s).

    • hiddenboolean

      The hidden status of the item.

  • note : string

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • parent_projectdict::
    • idinteger

      The parent project’s ID.

    • nameinteger

      The parent project’s name.

put(project_id, *, name='DEFAULT', description='DEFAULT', note='DEFAULT', auto_share='DEFAULT')

Update a project

Parameters
project_idinteger
namestring, optional

The name of this project.

descriptionstring, optional

A description of the project.

notestring, optional

Notes for the project.

auto_shareboolean, optional

A toggle for sharing the objects within the project when the project is shared.This does not automatically share new objects to the project.

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • tableslist::
    • schema : string

    • name : string

    • row_count : integer

    • column_count : integer

    • created_at : string/time

    • updated_at : string/time

  • surveyslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

  • scriptslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • importslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • exportslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • modelslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

  • notebookslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • current_deployment_id : integer

    • last_deploydict::
      • state : string

      • updated_at : string/time

  • serviceslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • current_deployment_id : integer

    • last_deploydict::
      • state : string

      • updated_at : string/time

  • workflowslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

    • last_executiondict::
      • state : string

      • updated_at : string/time

  • reportslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

  • script_templateslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

  • fileslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • file_name : string

    • file_size : integer

    • expired : boolean

  • enhancementslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • projectslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • description : string

  • all_objectslist::
    • project_id : integer

    • object_id : integer

    • object_type : string

    • fco_type : string

    • sub_type : string

    • name : string

    • icon : string

    • author : string

    • updated_at : string/time

    • archivedstring

      The archival status of the requested item(s).

    • hiddenboolean

      The hidden status of the item.

  • note : string

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • parent_projectdict::
    • idinteger

      The parent project’s ID.

    • nameinteger

      The parent project’s name.

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • tableslist::
    • schema : string

    • name : string

    • row_count : integer

    • column_count : integer

    • created_at : string/time

    • updated_at : string/time

  • surveyslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

  • scriptslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • importslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • exportslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • type : string

    • finished_at : string/time

    • state : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • modelslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

  • notebookslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • current_deployment_id : integer

    • last_deploydict::
      • state : string

      • updated_at : string/time

  • serviceslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • current_deployment_id : integer

    • last_deploydict::
      • state : string

      • updated_at : string/time

  • workflowslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

    • last_executiondict::
      • state : string

      • updated_at : string/time

  • reportslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • state : string

  • script_templateslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

  • fileslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • file_name : string

    • file_size : integer

    • expired : boolean

  • enhancementslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • last_rundict::
      • state : string

      • updated_at : string/time

  • projectslist::
    • idinteger

      The item’s ID.

    • created_at : string/time

    • updated_at : string/time

    • name : string

    • description : string

  • all_objectslist::
    • project_id : integer

    • object_id : integer

    • object_type : string

    • fco_type : string

    • sub_type : string

    • name : string

    • icon : string

    • author : string

    • updated_at : string/time

    • archivedstring

      The archival status of the requested item(s).

    • hiddenboolean

      The hidden status of the item.

  • note : string

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • parent_projectdict::
    • idinteger

      The parent project’s ID.

    • nameinteger

      The parent project’s name.

put_parent_projects(id, parent_project_id)

Add an item to a Parent Project

Parameters
idinteger

The ID of the item.

parent_project_idinteger

The ID of the Parent Project.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Queries
class Queries(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.queries.list(...)

Methods

delete(id)

Sets Query Hidden to true

delete_runs(id, run_id)

Cancel a run

get(id)

Get details about a query

get_runs(id, run_id)

Check status of a run

list(*[, database_id, credential_id, ...])

List

list_runs(id, *[, limit, page_num, order, ...])

List runs for the given query

list_runs_logs(id, run_id, *[, last_id, limit])

Get the logs for a run

post(database, sql, preview_rows, *[, ...])

Execute a query

post_runs(id)

Start a run

put_scripts(id, script_id)

Update the query's associated script

delete(id)

Sets Query Hidden to true

Parameters
idinteger

The query ID.

Returns
civis.response.Response
  • idinteger

    The query ID.

  • databaseinteger

    The database ID.

  • sqlstring

    The SQL to execute.

  • credentialinteger

    The credential ID.

  • result_rowslist

    A preview of rows returned by the query.

  • result_columnslist

    A preview of columns returned by the query.

  • script_idinteger

    The ID of the script associated with this query.

  • exceptionstring

    Deprecated and not used.

  • errorstring

    The error message for this run, if present.

  • created_at : string/time

  • updated_at : string/time

  • started_atstring/date-time

    The start time of the last run.

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

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

  • last_run_idinteger

    The ID of the last run.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • namestring

    The name of the query.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • report_idinteger

    The ID of the report associated with this query.

delete_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the query.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

get(id)

Get details about a query

Parameters
idinteger

The query ID.

Returns
civis.response.Response
  • idinteger

    The query ID.

  • databaseinteger

    The database ID.

  • sqlstring

    The SQL to execute.

  • credentialinteger

    The credential ID.

  • result_rowslist

    A preview of rows returned by the query.

  • result_columnslist

    A preview of columns returned by the query.

  • script_idinteger

    The ID of the script associated with this query.

  • exceptionstring

    Deprecated and not used.

  • errorstring

    The error message for this run, if present.

  • created_at : string/time

  • updated_at : string/time

  • started_atstring/date-time

    The start time of the last run.

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

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

  • last_run_idinteger

    The ID of the last run.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • namestring

    The name of the query.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • report_idinteger

    The ID of the report associated with this query.

get_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the query.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • query_idinteger

    The ID of the query.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list(*, database_id='DEFAULT', credential_id='DEFAULT', author_id='DEFAULT', created_before='DEFAULT', created_after='DEFAULT', started_before='DEFAULT', started_after='DEFAULT', state='DEFAULT', exclude_results='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List

Parameters
database_idinteger, optional

The database ID.

credential_idinteger, optional

The credential ID.

author_idinteger, optional

The author of the query.

created_beforestring, optional

An upper bound for the creation date of the query.

created_afterstring, optional

A lower bound for the creation date of the query.

started_beforestring, optional

An upper bound for the start date of the last run.

started_afterstring, optional

A lower bound for the start date of the last run.

statearray, optional

The state of the last run. One or more of queued, running, succeeded, failed, and cancelled. Specify multiple values as a comma-separated list (e.g., “A,B”).

exclude_resultsboolean, optional

If true, does not return cached query results.

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The query ID.

  • databaseinteger

    The database ID.

  • sqlstring

    The SQL to execute.

  • credentialinteger

    The credential ID.

  • result_rowslist

    A preview of rows returned by the query.

  • result_columnslist

    A preview of columns returned by the query.

  • script_idinteger

    The ID of the script associated with this query.

  • exceptionstring

    Deprecated and not used.

  • errorstring

    The error message for this run, if present.

  • created_at : string/time

  • updated_at : string/time

  • started_atstring/date-time

    The start time of the last run.

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

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

  • last_run_idinteger

    The ID of the last run.

  • archivedstring

    The archival status of the requested item(s).

  • preview_rowsinteger

    The number of rows to save from the query’s result (maximum: 100).

  • report_idinteger

    The ID of the report associated with this query.

list_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given query

Parameters
idinteger

The ID of the query.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • query_idinteger

    The ID of the query.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the query.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

post(database, sql, preview_rows, *, credential='DEFAULT', hidden='DEFAULT', interactive='DEFAULT', include_header='DEFAULT', compression='DEFAULT', column_delimiter='DEFAULT', unquoted='DEFAULT', filename_prefix='DEFAULT')

Execute a query

Parameters
databaseinteger

The database ID.

sqlstring

The SQL to execute.

preview_rowsinteger

The number of rows to save from the query’s result (maximum: 100).

credentialinteger, optional

The credential ID.

hiddenboolean, optional

The hidden status of the item.

interactiveboolean, optional

Deprecated and not used.

include_headerboolean, optional

Whether the CSV output should include a header row [default: true].

compressionstring, optional

The type of compression. One of gzip or zip, or none [default: gzip].

column_delimiterstring, optional

The delimiter to use. One of comma or tab, or pipe [default: comma].

unquotedboolean, optional

If true, will not quote fields.

filename_prefixstring, optional

The output filename prefix.

Returns
civis.response.Response
  • idinteger

    The query ID.

  • databaseinteger

    The database ID.

  • sqlstring

    The SQL to execute.

  • credentialinteger

    The credential ID.

  • result_rowslist

    A preview of rows returned by the query.

  • result_columnslist

    A preview of columns returned by the query.

  • script_idinteger

    The ID of the script associated with this query.

  • exceptionstring

    Deprecated and not used.

  • errorstring

    The error message for this run, if present.

  • created_at : string/time

  • updated_at : string/time

  • started_atstring/date-time

    The start time of the last run.

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

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

  • last_run_idinteger

    The ID of the last run.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • interactiveboolean

    Deprecated and not used.

  • preview_rowsinteger

    The number of rows to save from the query’s result (maximum: 100).

  • include_headerboolean

    Whether the CSV output should include a header row [default: true].

  • compressionstring

    The type of compression. One of gzip or zip, or none [default: gzip].

  • column_delimiterstring

    The delimiter to use. One of comma or tab, or pipe [default: comma].

  • unquotedboolean

    If true, will not quote fields.

  • filename_prefixstring

    The output filename prefix.

  • report_idinteger

    The ID of the report associated with this query.

post_runs(id)

Start a run

Parameters
idinteger

The ID of the query.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • query_idinteger

    The ID of the query.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

put_scripts(id, script_id)

Update the query’s associated script

Parameters
idinteger

The query ID.

script_idinteger

The ID of the script associated with this query.

Returns
civis.response.Response
  • idinteger

    The query ID.

  • databaseinteger

    The database ID.

  • sqlstring

    The SQL to execute.

  • credentialinteger

    The credential ID.

  • result_rowslist

    A preview of rows returned by the query.

  • result_columnslist

    A preview of columns returned by the query.

  • script_idinteger

    The ID of the script associated with this query.

  • exceptionstring

    Deprecated and not used.

  • errorstring

    The error message for this run, if present.

  • created_at : string/time

  • updated_at : string/time

  • started_atstring/date-time

    The start time of the last run.

  • finished_atstring/date-time

    The end time of the last run.

  • statestring

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

  • last_run_idinteger

    The ID of the last run.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • namestring

    The name of the query.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • report_idinteger

    The ID of the report associated with this query.

Remote_Hosts
class Remote_Hosts(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.remote_hosts.list_shares(...)

Methods

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

list(*[, type])

List the remote hosts

list_data_sets(id, *[, credential_id, ...])

List data sets available from a remote host

list_shares(id)

List users and groups permissioned on this object

post(name, url, type)

Create a new remote host

post_authenticate(id, *[, credential_id, ...])

Authenticate against a remote host using either a credential or a user name and password

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

list(*, type='DEFAULT')

List the remote hosts

Parameters
typestring, optional

The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce

Returns
civis.response.Response
  • idinteger

    The ID of the remote host.

  • namestring

    The name of the remote host.

  • typestring

    The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce

  • urlstring

    The URL for remote host.

list_data_sets(id, *, credential_id='DEFAULT', username='DEFAULT', password='DEFAULT', q='DEFAULT', s='DEFAULT')

List data sets available from a remote host

Parameters
idinteger

The ID of the remote host.

credential_idinteger, optional

The credential ID.

usernamestring, optional

The user name for remote host.

passwordstring, optional

The password for remote host.

qstring, optional

The query string for data set.

sboolean, optional

If true will only return schemas, otherwise, the results will be the full path.

Returns
civis.response.Response
  • namestring

    The path to a data_set.

  • full_pathboolean

    Boolean that indicates whether further querying needs to be done before the table can be selected.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

post(name, url, type)

Create a new remote host

Parameters
namestring

The human readable name for the remote host.

urlstring

The URL to your host.

typestring

The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce

Returns
civis.response.Response
  • idinteger

    The ID of the remote host.

  • namestring

    The name of the remote host.

  • typestring

    The type of remote host. One of: RemoteHostTypes::Bigquery, RemoteHostTypes::Bitbucket, RemoteHostTypes::GitSSH, RemoteHostTypes::Github, RemoteHostTypes::GoogleDoc, RemoteHostTypes::JDBC, RemoteHostTypes::Postgres, RemoteHostTypes::Redshift, RemoteHostTypes::S3Storage, and RemoteHostTypes::Salesforce

  • urlstring

    The URL for remote host.

post_authenticate(id, *, credential_id='DEFAULT', username='DEFAULT', password='DEFAULT')

Authenticate against a remote host using either a credential or a user name and password

Parameters
idinteger

The ID of the remote host.

credential_idinteger, optional

The credential ID.

usernamestring, optional

The user name for remote host.

passwordstring, optional

The password for remote host.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

Reports
class Reports(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.reports.list(...)

Methods

delete_grants(id)

Revoke permission for this report to perform Civis platform API operations on your behalf

delete_projects(id, project_id)

Remove a Report from a project

delete_services_projects(id, project_id)

Remove a Service Report from a project

delete_services_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_services_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Show a single report

get_git_commits(id, commit_hash)

Get file contents at git ref

get_services(id)

Show a single service report

list(*[, type, template_id, author, hidden, ...])

List Reports

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_git(id)

Get the git metadata attached to an item

list_git_commits(id)

Get the git commits for an item on the current branch

list_projects(id, *[, hidden])

List the projects a Report belongs to

list_services_dependencies(id, *[, user_id])

List dependent objects for this object

list_services_projects(id, *[, hidden])

List the projects a Service Report belongs to

list_services_shares(id)

List users and groups permissioned on this object

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, name, script_id, code_body, ...])

Update a report

patch_git(id, *[, git_ref, git_branch, ...])

Update an attached git file

patch_services(id, *[, name, provide_api_key])

Update some attributes of this service report

post(*[, script_id, name, code_body, ...])

Create a report

post_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

post_grants(id)

Grant this report the ability to perform Civis platform API operations on your behalf

post_refresh(id)

Refresh the data in this Tableau report

post_services(service_id, *[, provide_api_key])

Create a service report

put_archive(id, status)

Update the archive status of this object

put_git(id, *[, git_ref, git_branch, ...])

Attach an item to a file in a git repo

put_projects(id, project_id)

Add a Report to a project

put_services_archive(id, status)

Update the archive status of this object

put_services_projects(id, project_id)

Add a Service Report to a project

put_services_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_services_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_services_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_grants(id)

Revoke permission for this report to perform Civis platform API operations on your behalf

Parameters
idinteger

The ID of this report.

Returns
None

Response code 204: success

delete_projects(id, project_id)

Remove a Report from a project

Parameters
idinteger

The ID of the Report.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_services_projects(id, project_id)

Remove a Service Report from a project

Parameters
idinteger

The ID of the Service Report.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_services_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_services_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Show a single report

Parameters
idinteger

The ID of this report.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • projectslist::

    A list of projects containing the report. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • statestring

    The status of the report’s last run.

  • finished_atstring/time

    The time that the report’s last run finished.

  • viz_updated_atstring/time

    The time that the report’s visualization was last updated.

  • scriptdict::
    • idinteger

      The ID for the script.

    • namestring

      The name of the script.

    • sqlstring

      The raw SQL query for the script.

  • job_pathstring

    The link to details of the job that backs this report.

  • tableau_id : integer

  • type : string

  • template_idinteger

    The ID of the template used for this report.

  • auth_thumbnail_urlstring

    URL for a thumbnail of the report.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • auth_data_url : string

  • auth_code_url : string

  • configstring

    Any configuration metadata for this report.

  • valid_output_fileboolean

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernameboolean

    Apply user level filtering on Tableau reports.

get_git_commits(id, commit_hash)

Get file contents at git ref

Parameters
idinteger

The ID of the file.

commit_hashstring

The SHA (full or shortened) of the desired git commit.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

get_services(id)

Show a single service report

Parameters
idinteger

The ID of this report.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • hoststring

    The host for the service report

  • display_urlstring

    The URL to display the service report.

  • service_idinteger

    The id of the backing service

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • archivedstring

    The archival status of the requested item(s).

list(*, type='DEFAULT', template_id='DEFAULT', author='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Reports

Parameters
typestring, optional

If specified, return report of these types. It accepts a comma-separated list, possible values are ‘tableau’ or ‘other’.

template_idinteger, optional

If specified, return reports using the provided Template.

authorstring, optional

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

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • projectslist::

    A list of projects containing the report. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • statestring

    The status of the report’s last run.

  • finished_atstring/time

    The time that the report’s last run finished.

  • viz_updated_atstring/time

    The time that the report’s visualization was last updated.

  • scriptdict::
    • idinteger

      The ID for the script.

    • namestring

      The name of the script.

    • sqlstring

      The raw SQL query for the script.

  • job_pathstring

    The link to details of the job that backs this report.

  • tableau_id : integer

  • type : string

  • template_idinteger

    The ID of the template used for this report.

  • auth_thumbnail_urlstring

    URL for a thumbnail of the report.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_git(id)

Get the git metadata attached to an item

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_git_commits(id)

Get the git commits for an item on the current branch

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • commit_hashstring

    The SHA of the commit.

  • author_namestring

    The name of the commit’s author.

  • datestring/time

    The commit’s timestamp.

  • messagestring

    The commit message.

list_projects(id, *, hidden='DEFAULT')

List the projects a Report belongs to

Parameters
idinteger

The ID of the Report.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_services_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_services_projects(id, *, hidden='DEFAULT')

List the projects a Service Report belongs to

Parameters
idinteger

The ID of the Service Report.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_services_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id, *, name='DEFAULT', script_id='DEFAULT', code_body='DEFAULT', config='DEFAULT', app_state='DEFAULT', provide_api_key='DEFAULT', template_id='DEFAULT', use_viewers_tableau_username='DEFAULT')

Update a report

Parameters
idinteger

The ID of the report to modify.

namestring, optional

The name of the report.

script_idinteger, optional

The ID of the job (a script or a query) used to create this report.

code_bodystring, optional

The code for the report visualization.

configstring, optional
app_statedict, optional

The application state blob for this report.

provide_api_keyboolean, optional

Allow the report to provide an API key to front-end code.

template_idinteger, optional

The ID of the template used for this report. If null is passed, no template will back this report. Changes to the backing template will reset the report appState.

use_viewers_tableau_usernameboolean, optional

Apply user level filtering on Tableau reports.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • projectslist::

    A list of projects containing the report. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • statestring

    The status of the report’s last run.

  • finished_atstring/time

    The time that the report’s last run finished.

  • viz_updated_atstring/time

    The time that the report’s visualization was last updated.

  • scriptdict::
    • idinteger

      The ID for the script.

    • namestring

      The name of the script.

    • sqlstring

      The raw SQL query for the script.

  • job_pathstring

    The link to details of the job that backs this report.

  • tableau_id : integer

  • type : string

  • template_idinteger

    The ID of the template used for this report.

  • auth_thumbnail_urlstring

    URL for a thumbnail of the report.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • auth_data_url : string

  • auth_code_url : string

  • configstring

    Any configuration metadata for this report.

  • valid_output_fileboolean

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernameboolean

    Apply user level filtering on Tableau reports.

patch_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Update an attached git file

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_services(id, *, name='DEFAULT', provide_api_key='DEFAULT')

Update some attributes of this service report

Parameters
idinteger

The ID of this report.

namestring, optional

The name of the service report.

provide_api_keyboolean, optional

Whether the report requests an API Key from the report viewer.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • hoststring

    The host for the service report

  • display_urlstring

    The URL to display the service report.

  • service_idinteger

    The id of the backing service

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • archivedstring

    The archival status of the requested item(s).

post(*, script_id='DEFAULT', name='DEFAULT', code_body='DEFAULT', app_state='DEFAULT', provide_api_key='DEFAULT', template_id='DEFAULT', hidden='DEFAULT')

Create a report

Parameters
script_idinteger, optional

The ID of the job (a script or a query) used to create this report.

namestring, optional

The name of the report.

code_bodystring, optional

The code for the report visualization.

app_statedict, optional

Any application state blob for this report.

provide_api_keyboolean, optional

Allow the report to provide an API key to front-end code.

template_idinteger, optional

The ID of the template used for this report.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • projectslist::

    A list of projects containing the report. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • statestring

    The status of the report’s last run.

  • finished_atstring/time

    The time that the report’s last run finished.

  • viz_updated_atstring/time

    The time that the report’s visualization was last updated.

  • scriptdict::
    • idinteger

      The ID for the script.

    • namestring

      The name of the script.

    • sqlstring

      The raw SQL query for the script.

  • job_pathstring

    The link to details of the job that backs this report.

  • tableau_id : integer

  • type : string

  • template_idinteger

    The ID of the template used for this report.

  • auth_thumbnail_urlstring

    URL for a thumbnail of the report.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • auth_data_url : string

  • auth_code_url : string

  • configstring

    Any configuration metadata for this report.

  • valid_output_fileboolean

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernameboolean

    Apply user level filtering on Tableau reports.

post_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

Parameters
idinteger

The ID of the file.

contentstring

The contents to commit to the file.

messagestring

A commit message describing the changes being made.

file_hashstring

The full SHA of the file being replaced.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_grants(id)

Grant this report the ability to perform Civis platform API operations on your behalf

Parameters
idinteger

The ID of this report.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • projectslist::

    A list of projects containing the report. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • statestring

    The status of the report’s last run.

  • finished_atstring/time

    The time that the report’s last run finished.

  • viz_updated_atstring/time

    The time that the report’s visualization was last updated.

  • scriptdict::
    • idinteger

      The ID for the script.

    • namestring

      The name of the script.

    • sqlstring

      The raw SQL query for the script.

  • job_pathstring

    The link to details of the job that backs this report.

  • tableau_id : integer

  • type : string

  • template_idinteger

    The ID of the template used for this report.

  • auth_thumbnail_urlstring

    URL for a thumbnail of the report.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • auth_data_url : string

  • auth_code_url : string

  • configstring

    Any configuration metadata for this report.

  • valid_output_fileboolean

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernameboolean

    Apply user level filtering on Tableau reports.

post_refresh(id)

Refresh the data in this Tableau report

Parameters
idinteger

The ID of this report.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • organizationdict::
    • idinteger

      The ID of this organization.

    • tableau_refresh_usageinteger

      The number of tableau refreshes used this month.

    • tableau_refresh_limitinteger

      The number of monthly tableau refreshes permitted to this organization.

    • tableau_refresh_historylist

      The number of tableau refreshes used this month.

post_services(service_id, *, provide_api_key='DEFAULT')

Create a service report

Parameters
service_idinteger

The id of the backing service

provide_api_keyboolean, optional

Whether the report requests an API Key from the report viewer.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • hoststring

    The host for the service report

  • display_urlstring

    The URL to display the service report.

  • service_idinteger

    The id of the backing service

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • archivedstring

    The archival status of the requested item(s).

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • projectslist::

    A list of projects containing the report. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • statestring

    The status of the report’s last run.

  • finished_atstring/time

    The time that the report’s last run finished.

  • viz_updated_atstring/time

    The time that the report’s visualization was last updated.

  • scriptdict::
    • idinteger

      The ID for the script.

    • namestring

      The name of the script.

    • sqlstring

      The raw SQL query for the script.

  • job_pathstring

    The link to details of the job that backs this report.

  • tableau_id : integer

  • type : string

  • template_idinteger

    The ID of the template used for this report.

  • auth_thumbnail_urlstring

    URL for a thumbnail of the report.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • auth_data_url : string

  • auth_code_url : string

  • configstring

    Any configuration metadata for this report.

  • valid_output_fileboolean

    Whether the job (a script or a query) that backs the report currently has a valid output file.

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • app_statedict

    Any application state blob for this report.

  • use_viewers_tableau_usernameboolean

    Apply user level filtering on Tableau reports.

put_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Attach an item to a file in a git repo

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_projects(id, project_id)

Add a Report to a project

Parameters
idinteger

The ID of the Report.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_services_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID of this report.

  • namestring

    The name of the report.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • created_at : string/time

  • updated_at : string/time

  • hoststring

    The host for the service report

  • display_urlstring

    The URL to display the service report.

  • service_idinteger

    The id of the backing service

  • provide_api_keyboolean

    Whether the report requests an API Key from the report viewer.

  • api_keystring

    A Civis API key that can be used by this report.

  • api_key_idinteger

    The ID of the API key. Can be used for auditing API use by this report.

  • archivedstring

    The archival status of the requested item(s).

put_services_projects(id, project_id)

Add a Service Report to a project

Parameters
idinteger

The ID of the Service Report.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_services_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_services_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_services_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Roles
class Roles(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.roles.list(...)

Methods

list(*[, limit, page_num, order, order_dir, ...])

List Roles

list(*, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Roles

Parameters
limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    ID of the Role.

  • namestring

    The name of the Role.

  • slugstring

    The slug.

  • descriptionstring

    The description of the Role.

Saml_Service_Providers
class Saml_Service_Providers(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.saml_service_providers.list_shares(...)

Methods

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

list_shares(id)

List users and groups permissioned on this object

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

Scripts
class Scripts(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.scripts.list_types(...)

Methods

delete_containers_projects(id, project_id)

Remove a Container Script from a project

delete_containers_runs(id, run_id)

Cancel a run

delete_containers_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_containers_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_custom_projects(id, project_id)

Remove a Custom Script from a project

delete_custom_runs(id, run_id)

Cancel a run

delete_custom_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_custom_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_javascript_projects(id, project_id)

Remove a JavaScript Script from a project

delete_javascript_runs(id, run_id)

Cancel a run

delete_javascript_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_javascript_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_python3_projects(id, project_id)

Remove a Python Script from a project

delete_python3_runs(id, run_id)

Cancel a run

delete_python3_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_python3_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_r_projects(id, project_id)

Remove an R Script from a project

delete_r_runs(id, run_id)

Cancel a run

delete_r_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_r_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_sql_projects(id, project_id)

Remove a SQL script from a project

delete_sql_runs(id, run_id)

Cancel a run

delete_sql_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_sql_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get details about a script

get_containers(id)

View a container

get_containers_runs(id, run_id)

Check status of a run

get_custom(id)

Get a Custom Script

get_custom_runs(id, run_id)

Check status of a run

get_javascript(id)

Get a JavaScript Script

get_javascript_git_commits(id, commit_hash)

Get file contents at git ref

get_javascript_runs(id, run_id)

Check status of a run

get_python3(id)

Get a Python Script

get_python3_git_commits(id, commit_hash)

Get file contents at git ref

get_python3_runs(id, run_id)

Check status of a run

get_r(id)

Get an R Script

get_r_git_commits(id, commit_hash)

Get file contents at git ref

get_r_runs(id, run_id)

Check status of a run

get_sql(id)

Get a SQL script

get_sql_git_commits(id, commit_hash)

Get file contents at git ref

get_sql_runs(id, run_id)

Check status of a run

list(*[, type, category, author, status, ...])

List Scripts

list_containers_dependencies(id, *[, user_id])

List dependent objects for this object

list_containers_projects(id, *[, hidden])

List the projects a Container Script belongs to

list_containers_runs(id, *[, limit, ...])

List runs for the given container

list_containers_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_containers_runs_outputs(id, run_id, *)

List the outputs for a run

list_containers_shares(id)

List users and groups permissioned on this object

list_custom(*[, from_template_id, author, ...])

List Custom Scripts

list_custom_dependencies(id, *[, user_id])

List dependent objects for this object

list_custom_projects(id, *[, hidden])

List the projects a Custom Script belongs to

list_custom_runs(id, *[, limit, page_num, ...])

List runs for the given custom

list_custom_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_custom_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

list_custom_shares(id)

List users and groups permissioned on this object

list_history(id)

Get the run history and outputs of this script

list_javascript_dependencies(id, *[, user_id])

List dependent objects for this object

list_javascript_git(id)

Get the git metadata attached to an item

list_javascript_git_commits(id)

Get the git commits for an item on the current branch

list_javascript_projects(id, *[, hidden])

List the projects a JavaScript Script belongs to

list_javascript_runs(id, *[, limit, ...])

List runs for the given javascript

list_javascript_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_javascript_runs_outputs(id, run_id, *)

List the outputs for a run

list_javascript_shares(id)

List users and groups permissioned on this object

list_python3_dependencies(id, *[, user_id])

List dependent objects for this object

list_python3_git(id)

Get the git metadata attached to an item

list_python3_git_commits(id)

Get the git commits for an item on the current branch

list_python3_projects(id, *[, hidden])

List the projects a Python Script belongs to

list_python3_runs(id, *[, limit, page_num, ...])

List runs for the given python

list_python3_runs_logs(id, run_id, *[, ...])

Get the logs for a run

list_python3_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

list_python3_shares(id)

List users and groups permissioned on this object

list_r_dependencies(id, *[, user_id])

List dependent objects for this object

list_r_git(id)

Get the git metadata attached to an item

list_r_git_commits(id)

Get the git commits for an item on the current branch

list_r_projects(id, *[, hidden])

List the projects an R Script belongs to

list_r_runs(id, *[, limit, page_num, order, ...])

List runs for the given r

list_r_runs_logs(id, run_id, *[, last_id, limit])

Get the logs for a run

list_r_runs_outputs(id, run_id, *[, limit, ...])

List the outputs for a run

list_r_shares(id)

List users and groups permissioned on this object

list_sql_dependencies(id, *[, user_id])

List dependent objects for this object

list_sql_git(id)

Get the git metadata attached to an item

list_sql_git_commits(id)

Get the git commits for an item on the current branch

list_sql_projects(id, *[, hidden])

List the projects a SQL script belongs to

list_sql_runs(id, *[, limit, page_num, ...])

List runs for the given sql

list_sql_runs_logs(id, run_id, *[, last_id, ...])

Get the logs for a run

list_sql_runs_outputs(id, run_id, *[, ...])

List the outputs for a run

list_sql_shares(id)

List users and groups permissioned on this object

list_types()

List available script types

patch(id, *[, name, sql, params, arguments, ...])

Update a script

patch_container_runs(id, run_id, *[, error])

Update the given run

patch_containers(id, *[, name, parent_id, ...])

Update a container

patch_custom(id, *[, name, parent_id, ...])

Update some attributes of this Custom Script

patch_javascript(id, *[, name, parent_id, ...])

Update some attributes of this JavaScript Script

patch_javascript_git(id, *[, git_ref, ...])

Update an attached git file

patch_javascript_runs(id, run_id, *[, error])

Update the given run

patch_python3(id, *[, name, parent_id, ...])

Update some attributes of this Python Script

patch_python3_git(id, *[, git_ref, ...])

Update an attached git file

patch_python3_runs(id, run_id, *[, error])

Update the given run

patch_r(id, *[, name, parent_id, ...])

Update some attributes of this R Script

patch_r_git(id, *[, git_ref, git_branch, ...])

Update an attached git file

patch_r_runs(id, run_id, *[, error])

Update the given run

patch_sql(id, *[, name, parent_id, ...])

Update some attributes of this SQL script

patch_sql_git(id, *[, git_ref, git_branch, ...])

Update an attached git file

patch_sql_runs(id, run_id, *[, error])

Update the given run

post(name, remote_host_id, credential_id, sql, *)

Create a script

post_cancel(id)

Cancel a run

post_containers(required_resources, ...[, ...])

Create a container

post_containers_clone(id, *[, ...])

Clone this Container Script

post_containers_runs(id)

Start a run

post_containers_runs_logs(id, run_id, *[, ...])

Add log messages

post_containers_runs_outputs(id, run_id, ...)

Add an output for a run

post_custom(from_template_id, *[, name, ...])

Create a Custom Script

post_custom_clone(id, *[, clone_schedule, ...])

Clone this Custom Script

post_custom_runs(id)

Start a run

post_custom_runs_outputs(id, run_id, ...)

Add an output for a run

post_javascript(name, source, ...[, ...])

Create a JavaScript Script

post_javascript_clone(id, *[, ...])

Clone this JavaScript Script

post_javascript_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_javascript_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_javascript_git_commits(id, content, ...)

Commit and push a new version of the file

post_javascript_runs(id)

Start a run

post_javascript_runs_outputs(id, run_id, ...)

Add an output for a run

post_python3(name, source, *[, parent_id, ...])

Create a Python Script

post_python3_clone(id, *[, clone_schedule, ...])

Clone this Python Script

post_python3_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_python3_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_python3_git_commits(id, content, ...)

Commit and push a new version of the file

post_python3_runs(id)

Start a run

post_python3_runs_outputs(id, run_id, ...)

Add an output for a run

post_r(name, source, *[, parent_id, ...])

Create an R Script

post_r_clone(id, *[, clone_schedule, ...])

Clone this R Script

post_r_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_r_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_r_git_commits(id, content, message, ...)

Commit and push a new version of the file

post_r_runs(id)

Start a run

post_r_runs_outputs(id, run_id, object_type, ...)

Add an output for a run

post_run(id)

Run a script

post_sql(name, sql, remote_host_id, ...[, ...])

Create a SQL script

post_sql_clone(id, *[, clone_schedule, ...])

Clone this SQL script

post_sql_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_sql_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_sql_git_commits(id, content, message, ...)

Commit and push a new version of the file

post_sql_runs(id)

Start a run

put_containers(id, required_resources, ...)

Edit a container

put_containers_archive(id, status)

Update the archive status of this object

put_containers_projects(id, project_id)

Add a Container Script to a project

put_containers_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_containers_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_containers_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_custom(id, *[, name, parent_id, ...])

Replace all attributes of this Custom Script

put_custom_archive(id, status)

Update the archive status of this object

put_custom_projects(id, project_id)

Add a Custom Script to a project

put_custom_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_custom_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_custom_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_javascript(id, name, source, ...[, ...])

Replace all attributes of this JavaScript Script

put_javascript_archive(id, status)

Update the archive status of this object

put_javascript_git(id, *[, git_ref, ...])

Attach an item to a file in a git repo

put_javascript_projects(id, project_id)

Add a JavaScript Script to a project

put_javascript_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_javascript_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_javascript_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_python3(id, name, source, *[, ...])

Replace all attributes of this Python Script

put_python3_archive(id, status)

Update the archive status of this object

put_python3_git(id, *[, git_ref, ...])

Attach an item to a file in a git repo

put_python3_projects(id, project_id)

Add a Python Script to a project

put_python3_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_python3_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_python3_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_r(id, name, source, *[, parent_id, ...])

Replace all attributes of this R Script

put_r_archive(id, status)

Update the archive status of this object

put_r_git(id, *[, git_ref, git_branch, ...])

Attach an item to a file in a git repo

put_r_projects(id, project_id)

Add an R Script to a project

put_r_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_r_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_r_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_sql(id, name, sql, remote_host_id, ...)

Replace all attributes of this SQL script

put_sql_archive(id, status)

Update the archive status of this object

put_sql_git(id, *[, git_ref, git_branch, ...])

Attach an item to a file in a git repo

put_sql_projects(id, project_id)

Add a SQL script to a project

put_sql_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_sql_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_sql_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

delete_containers_projects(id, project_id)

Remove a Container Script from a project

Parameters
idinteger

The ID of the Container Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_containers_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the container.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_containers_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_containers_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_custom_projects(id, project_id)

Remove a Custom Script from a project

Parameters
idinteger

The ID of the Custom Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_custom_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the custom.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_custom_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_custom_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_javascript_projects(id, project_id)

Remove a JavaScript Script from a project

Parameters
idinteger

The ID of the JavaScript Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_javascript_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the javascript.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_javascript_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_javascript_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_python3_projects(id, project_id)

Remove a Python Script from a project

Parameters
idinteger

The ID of the Python Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_python3_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the python.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_python3_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_python3_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_r_projects(id, project_id)

Remove an R Script from a project

Parameters
idinteger

The ID of the R Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_r_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the r.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_r_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_r_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_sql_projects(id, project_id)

Remove a SQL script from a project

Parameters
idinteger

The ID of the SQL script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_sql_runs(id, run_id)

Cancel a run

Parameters
idinteger

The ID of the sql.

run_idinteger

The ID of the run.

Returns
None

Response code 202: success

delete_sql_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_sql_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get details about a script

Parameters
idinteger

The ID for the script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of script.

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time this script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sqlstring

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • template_script_idinteger

    The ID of the template script, if any.

get_containers(id)

View a container

Parameters
idinteger

The ID for the script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the container.

  • typestring

    The type of the script (e.g Container)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • repo_http_uristring

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstring

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idinteger

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idinteger

    The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

  • docker_commandstring

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • time_zonestring

    The time zone of this script.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • running_as_idinteger

    The ID of the runner of this script.

get_containers_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the container.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • container_idinteger

    The ID of the container.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

get_custom(id)

Get a Custom Script

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g Custom)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • category : string

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • ui_report_urlinteger

    The url of the custom HTML.

  • ui_report_idinteger

    The id of the report with the custom HTML.

  • ui_report_provide_api_keyboolean

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestring

    The name of the template script.

  • template_notestring

    The template’s note.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • last_successful_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB).

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • partition_labelstring

    The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

get_custom_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the custom.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • custom_idinteger

    The ID of the custom.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.

get_javascript(id)

Get a JavaScript Script

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sourcestring

    The body/text of the script.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • running_as_idinteger

    The ID of the runner of this script.

get_javascript_git_commits(id, commit_hash)

Get file contents at git ref

Parameters
idinteger

The ID of the file.

commit_hashstring

The SHA (full or shortened) of the desired git commit.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

get_javascript_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the javascript.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • javascript_idinteger

    The ID of the javascript.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

get_python3(id)

Get a Python Script

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

get_python3_git_commits(id, commit_hash)

Get file contents at git ref

Parameters
idinteger

The ID of the file.

commit_hashstring

The SHA (full or shortened) of the desired git commit.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

get_python3_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the python.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • python_idinteger

    The ID of the python.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

get_r(id)

Get an R Script

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

get_r_git_commits(id, commit_hash)

Get file contents at git ref

Parameters
idinteger

The ID of the file.

commit_hashstring

The SHA (full or shortened) of the desired git commit.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

get_r_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the r.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • r_idinteger

    The ID of the r.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

get_sql(id)

Get a SQL script

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sqlstring

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • csv_settingsdict::
    • include_headerboolean

      Whether or not to include headers in the output data. Default: true

    • compressionstring

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstring

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedboolean

      Whether or not to quote fields. Default: false

    • force_multifileboolean

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstring

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeinteger

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idinteger

    The ID of the runner of this script.

get_sql_git_commits(id, commit_hash)

Get file contents at git ref

Parameters
idinteger

The ID of the file.

commit_hashstring

The SHA (full or shortened) of the desired git commit.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

get_sql_runs(id, run_id)

Check status of a run

Parameters
idinteger

The ID of the sql.

run_idinteger

The ID of the run.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • sql_idinteger

    The ID of the sql.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • outputlist::

    A list of the outputs of this script. - output_name : string

    The name of the output file.

    • file_idinteger

      The unique ID of the output file.

    • pathstring

      The temporary link to download this output file, valid for 36 hours.

  • output_cached_onstring/time

    The time that the output was originally exported, if a cache entry was used by the run.

list(*, type='DEFAULT', category='DEFAULT', author='DEFAULT', status='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Scripts

Parameters
typestring, optional

If specified, return items of these types. The valid types are sql, python3, javascript, r, and containers.

categorystring, optional

A job category for filtering scripts. Must be one of script, import, export, and enhancement.

authorstring, optional

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

statusstring, optional

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

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • is_templateboolean

    Whether others scripts use this one as a template.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

  • template_script_idinteger

    The ID of the template script, if any.

list_containers_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_containers_projects(id, *, hidden='DEFAULT')

List the projects a Container Script belongs to

Parameters
idinteger

The ID of the Container Script.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_containers_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given container

Parameters
idinteger

The ID of the container.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • container_idinteger

    The ID of the container.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

list_containers_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the container.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_containers_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the container script.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_containers_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_custom(*, from_template_id='DEFAULT', author='DEFAULT', status='DEFAULT', hidden='DEFAULT', archived='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Custom Scripts

Parameters
from_template_idstring, optional

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

authorstring, optional

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

statusstring, optional

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

hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g Custom)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • from_template_idinteger

    The ID of the template script.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • archivedstring

    The archival status of the requested item(s).

  • last_successful_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

list_custom_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_custom_projects(id, *, hidden='DEFAULT')

List the projects a Custom Script belongs to

Parameters
idinteger

The ID of the Custom Script.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_custom_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given custom

Parameters
idinteger

The ID of the custom.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • custom_idinteger

    The ID of the custom.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.

list_custom_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the custom.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_custom_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the custom script.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_custom_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_history(id)

Get the run history and outputs of this script

Parameters
idinteger

The ID for the script.

Returns
civis.response.Response
  • idinteger

    The ID of this run.

  • sql_idinteger

    The ID of this sql.

  • statestring

    The state of this run.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • finished_atstring/time

    The time that this run finished.

  • errorstring

    The error message for this run, if present.

  • outputlist::

    A list of the outputs of this script. - output_name : string

    The name of the output file.

    • file_idinteger

      The unique ID of the output file.

    • pathstring

      The temporary link to download this output file, valid for 36 hours.

list_javascript_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_javascript_git(id)

Get the git metadata attached to an item

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_javascript_git_commits(id)

Get the git commits for an item on the current branch

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • commit_hashstring

    The SHA of the commit.

  • author_namestring

    The name of the commit’s author.

  • datestring/time

    The commit’s timestamp.

  • messagestring

    The commit message.

list_javascript_projects(id, *, hidden='DEFAULT')

List the projects a JavaScript Script belongs to

Parameters
idinteger

The ID of the JavaScript Script.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_javascript_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given javascript

Parameters
idinteger

The ID of the javascript.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • javascript_idinteger

    The ID of the javascript.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

list_javascript_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the javascript.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_javascript_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the javascript script.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_javascript_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_python3_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_python3_git(id)

Get the git metadata attached to an item

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_python3_git_commits(id)

Get the git commits for an item on the current branch

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • commit_hashstring

    The SHA of the commit.

  • author_namestring

    The name of the commit’s author.

  • datestring/time

    The commit’s timestamp.

  • messagestring

    The commit message.

list_python3_projects(id, *, hidden='DEFAULT')

List the projects a Python Script belongs to

Parameters
idinteger

The ID of the Python Script.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_python3_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given python

Parameters
idinteger

The ID of the python.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • python_idinteger

    The ID of the python.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

list_python3_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the python.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_python3_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the python script.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_python3_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_r_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_r_git(id)

Get the git metadata attached to an item

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_r_git_commits(id)

Get the git commits for an item on the current branch

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • commit_hashstring

    The SHA of the commit.

  • author_namestring

    The name of the commit’s author.

  • datestring/time

    The commit’s timestamp.

  • messagestring

    The commit message.

list_r_projects(id, *, hidden='DEFAULT')

List the projects an R Script belongs to

Parameters
idinteger

The ID of the R Script.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_r_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given r

Parameters
idinteger

The ID of the r.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • r_idinteger

    The ID of the r.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

list_r_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the r.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_r_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the r script.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_r_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_sql_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_sql_git(id)

Get the git metadata attached to an item

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_sql_git_commits(id)

Get the git commits for an item on the current branch

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • commit_hashstring

    The SHA of the commit.

  • author_namestring

    The name of the commit’s author.

  • datestring/time

    The commit’s timestamp.

  • messagestring

    The commit message.

list_sql_projects(id, *, hidden='DEFAULT')

List the projects a SQL script belongs to

Parameters
idinteger

The ID of the SQL script.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_sql_runs(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List runs for the given sql

Parameters
idinteger

The ID of the sql.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 100.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the run.

  • sql_idinteger

    The ID of the sql.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • outputlist::

    A list of the outputs of this script. - output_name : string

    The name of the output file.

    • file_idinteger

      The unique ID of the output file.

    • pathstring

      The temporary link to download this output file, valid for 36 hours.

  • output_cached_onstring/time

    The time that the output was originally exported, if a cache entry was used by the run.

list_sql_runs_logs(id, run_id, *, last_id='DEFAULT', limit='DEFAULT')

Get the logs for a run

Parameters
idinteger

The ID of the sql.

run_idinteger

The ID of the run.

last_idinteger, optional

The ID of the last log message received. Log entries with this ID value or lower will be omitted.Logs are sorted by ID if this value is provided, and are otherwise sorted by createdAt.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • idinteger

    The ID of the log.

  • created_atstring/date-time

    The time the log was created.

  • messagestring

    The log message.

  • levelstring

    The level of the log. One of unknown,fatal,error,warn,info,debug.

list_sql_runs_outputs(id, run_id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List the outputs for a run

Parameters
idinteger

The ID of the sql script.

run_idinteger

The ID of the run.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

list_sql_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_types()

List available script types

Returns
civis.response.Response
  • namestring

    The name of the type.

patch(id, *, name='DEFAULT', sql='DEFAULT', params='DEFAULT', arguments='DEFAULT', template_script_id='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', parent_id='DEFAULT', running_as_id='DEFAULT')

Update a script

Parameters
idinteger

The ID for the script.

namestring, optional

The name of the script.

sqlstring, optional

The raw SQL query for the script.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. Cannot be set if this script uses a template script. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

template_script_idinteger, optional

The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

parent_idinteger, optional

The ID of the parent job that will trigger this script

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of script.

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time this script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sqlstring

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • template_script_idinteger

    The ID of the template script, if any.

patch_container_runs(id, run_id, *, error='DEFAULT')

Update the given run

Parameters
idinteger

ID of the Job

run_idinteger

ID of the Run

errorstring, optional

The error message to update

Returns
None

Response code 204: success

patch_containers(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', required_resources='DEFAULT', repo_http_uri='DEFAULT', repo_ref='DEFAULT', remote_host_credential_id='DEFAULT', git_credential_id='DEFAULT', docker_command='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', partition_label='DEFAULT', target_project_id='DEFAULT', running_as_id='DEFAULT')

Update a container

Parameters
idinteger

The ID for the script.

namestring, optional

The name of the container.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

repo_http_uristring, optional

The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

repo_refstring, optional

The tag or branch of the github repo to clone into the container.

remote_host_credential_idinteger, optional

The id of the database credentials to pass into the environment of the container.

git_credential_idinteger, optional

The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

docker_commandstring, optional

The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

docker_image_namestring, optional

The name of the docker image to pull from DockerHub.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

time_zonestring, optional

The time zone of this script.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

target_project_idinteger, optional

Target project to which script outputs will be added.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the container.

  • typestring

    The type of the script (e.g Container)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • repo_http_uristring

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstring

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idinteger

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idinteger

    The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

  • docker_commandstring

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • time_zonestring

    The time zone of this script.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • running_as_idinteger

    The ID of the runner of this script.

patch_custom(id, *, name='DEFAULT', parent_id='DEFAULT', arguments='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Update some attributes of this Custom Script

Parameters
idinteger

The ID for the script.

namestring, optional

The name of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

remote_host_idinteger, optional

The remote host ID that this script will connect to.

credential_idinteger, optional

The credential that this script will use.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB).

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

partition_labelstring, optional

The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g Custom)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • category : string

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • ui_report_urlinteger

    The url of the custom HTML.

  • ui_report_idinteger

    The id of the report with the custom HTML.

  • ui_report_provide_api_keyboolean

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestring

    The name of the template script.

  • template_notestring

    The template’s note.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • last_successful_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB).

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • partition_labelstring

    The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

patch_javascript(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', source='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', running_as_id='DEFAULT')

Update some attributes of this JavaScript Script

Parameters
idinteger

The ID for the script.

namestring, optional

The name of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

sourcestring, optional

The body/text of the script.

remote_host_idinteger, optional

The remote host ID that this script will connect to.

credential_idinteger, optional

The credential that this script will use.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sourcestring

    The body/text of the script.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • running_as_idinteger

    The ID of the runner of this script.

patch_javascript_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Update an attached git file

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_javascript_runs(id, run_id, *, error='DEFAULT')

Update the given run

Parameters
idinteger

ID of the Job

run_idinteger

ID of the Run

errorstring, optional

The error message to update

Returns
None

Response code 204: success

patch_python3(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', instance_type='DEFAULT', source='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Update some attributes of this Python Script

Parameters
idinteger

The ID for the script.

namestring, optional

The name of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

sourcestring, optional

The body/text of the script.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

patch_python3_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Update an attached git file

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_python3_runs(id, run_id, *, error='DEFAULT')

Update the given run

Parameters
idinteger

ID of the Job

run_idinteger

ID of the Run

errorstring, optional

The error message to update

Returns
None

Response code 204: success

patch_r(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', instance_type='DEFAULT', source='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Update some attributes of this R Script

Parameters
idinteger

The ID for the script.

namestring, optional

The name of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

sourcestring, optional

The body/text of the script.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

patch_r_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Update an attached git file

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_r_runs(id, run_id, *, error='DEFAULT')

Update the given run

Parameters
idinteger

ID of the Job

run_idinteger

ID of the Run

errorstring, optional

The error message to update

Returns
None

Response code 204: success

patch_sql(id, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', sql='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', csv_settings='DEFAULT', running_as_id='DEFAULT')

Update some attributes of this SQL script

Parameters
idinteger

The ID for the script.

namestring, optional

The name of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

sqlstring, optional

The raw SQL query for the script.

remote_host_idinteger, optional

The remote host ID that this script will connect to.

credential_idinteger, optional

The credential that this script will use.

csv_settingsdict, optional::
  • include_headerboolean

    Whether or not to include headers in the output data. Default: true

  • compressionstring

    The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

  • column_delimiterstring

    Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

  • unquotedboolean

    Whether or not to quote fields. Default: false

  • force_multifileboolean

    Whether or not the csv should be split into multiple files. Default: false

  • filename_prefixstring

    A user specified filename prefix for the output file to have. Default: null

  • max_file_sizeinteger

    The max file size, in MB, created files will be. Only available when force_multifile is true.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sqlstring

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • csv_settingsdict::
    • include_headerboolean

      Whether or not to include headers in the output data. Default: true

    • compressionstring

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstring

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedboolean

      Whether or not to quote fields. Default: false

    • force_multifileboolean

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstring

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeinteger

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idinteger

    The ID of the runner of this script.

patch_sql_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Update an attached git file

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

patch_sql_runs(id, run_id, *, error='DEFAULT')

Update the given run

Parameters
idinteger

ID of the Job

run_idinteger

ID of the Run

errorstring, optional

The error message to update

Returns
None

Response code 204: success

post(name, remote_host_id, credential_id, sql, *, params='DEFAULT', arguments='DEFAULT', template_script_id='DEFAULT', notifications='DEFAULT', hidden='DEFAULT')

Create a script

Parameters
namestring

The name of the script.

remote_host_idinteger

The database ID.

credential_idinteger

The credential ID.

sqlstring

The raw SQL query for the script.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. Cannot be set if this script uses a template script. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

template_script_idinteger, optional

The ID of the template script, if any. A script cannot both have a template script and be a template for other scripts.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • template_script_idinteger

    The ID of the template script, if any.

post_cancel(id)

Cancel a run

Parameters
idinteger

The ID of the job.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • statestring

    The state of the run, one of ‘queued’, ‘running’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

post_containers(required_resources, docker_image_name, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', repo_http_uri='DEFAULT', repo_ref='DEFAULT', remote_host_credential_id='DEFAULT', git_credential_id='DEFAULT', docker_command='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', partition_label='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', running_as_id='DEFAULT')

Create a container

Parameters
required_resourcesdict::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

docker_image_namestring

The name of the docker image to pull from DockerHub.

namestring, optional

The name of the container.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

repo_http_uristring, optional

The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

repo_refstring, optional

The tag or branch of the github repo to clone into the container.

remote_host_credential_idinteger, optional

The id of the database credentials to pass into the environment of the container.

git_credential_idinteger, optional

The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

docker_commandstring, optional

The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

time_zonestring, optional

The time zone of this script.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

hiddenboolean, optional

The hidden status of the item.

target_project_idinteger, optional

Target project to which script outputs will be added.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the container.

  • typestring

    The type of the script (e.g Container)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • repo_http_uristring

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstring

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idinteger

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idinteger

    The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

  • docker_commandstring

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • time_zonestring

    The time zone of this script.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • running_as_idinteger

    The ID of the runner of this script.

post_containers_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')

Clone this Container Script

Parameters
idinteger

The ID for the script.

clone_scheduleboolean, optional

If true, also copy the schedule to the new script.

clone_triggersboolean, optional

If true, also copy the triggers to the new script.

clone_notificationsboolean, optional

If true, also copy the notifications to the new script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the container.

  • typestring

    The type of the script (e.g Container)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • repo_http_uristring

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstring

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idinteger

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idinteger

    The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

  • docker_commandstring

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • time_zonestring

    The time zone of this script.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • running_as_idinteger

    The ID of the runner of this script.

post_containers_runs(id)

Start a run

Parameters
idinteger

The ID of the container.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • container_idinteger

    The ID of the container.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

post_containers_runs_logs(id, run_id, *, message='DEFAULT', level='DEFAULT', messages='DEFAULT', child_job_id='DEFAULT')

Add log messages

Parameters
idinteger

The ID of the script.

run_idinteger

The ID of the script run.

messagestring, optional

The log message to store.

levelstring, optional

The log level of this message [default: info]

messageslist, optional::

If specified, a batch of logs to store. If createdAt timestamps for the logs are supplied, the ordering of this list is not preserved, and the timestamps are used to sort the logs.If createdAt timestamps are not supplied, the ordering of this list is preserved and the logs are given the timestamp of when they were received. - message : string

The log message to store.

  • levelstring

    The log level of this message [default: info]

  • created_atstring/date-time

    The timestamp of this message in ISO 8601 format. This is what logs are ordered by, so it is recommended to use timestamps with nanosecond precision. If absent, defaults to the time that the log was received by the API.

child_job_idinteger, optional

The ID of the child job the message came from.

Returns
None

Response code 204: success

post_containers_runs_outputs(id, run_id, object_type, object_id)

Add an output for a run

Parameters
idinteger

The ID of the container script.

run_idinteger

The ID of the run.

object_typestring

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idinteger

The ID of the output.

Returns
civis.response.Response
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

post_custom(from_template_id, *, name='DEFAULT', parent_id='DEFAULT', arguments='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Create a Custom Script

Parameters
from_template_idinteger

The ID of the template script.

namestring, optional

The name of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

remote_host_idinteger, optional

The remote host ID that this script will connect to.

credential_idinteger, optional

The credential that this script will use.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

time_zonestring, optional

The time zone of this script.

hiddenboolean, optional

The hidden status of the item.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB).

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

partition_labelstring, optional

The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g Custom)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • category : string

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • ui_report_urlinteger

    The url of the custom HTML.

  • ui_report_idinteger

    The id of the report with the custom HTML.

  • ui_report_provide_api_keyboolean

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestring

    The name of the template script.

  • template_notestring

    The template’s note.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • last_successful_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB).

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • partition_labelstring

    The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

post_custom_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')

Clone this Custom Script

Parameters
idinteger

The ID for the script.

clone_scheduleboolean, optional

If true, also copy the schedule to the new script.

clone_triggersboolean, optional

If true, also copy the triggers to the new script.

clone_notificationsboolean, optional

If true, also copy the notifications to the new script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g Custom)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • category : string

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • ui_report_urlinteger

    The url of the custom HTML.

  • ui_report_idinteger

    The id of the report with the custom HTML.

  • ui_report_provide_api_keyboolean

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestring

    The name of the template script.

  • template_notestring

    The template’s note.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • last_successful_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB).

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • partition_labelstring

    The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

post_custom_runs(id)

Start a run

Parameters
idinteger

The ID of the custom.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • custom_idinteger

    The ID of the custom.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB. Only available if the backing script is a Python, R, or container script.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores. Only available if the backing script is a Python, R, or container script.

post_custom_runs_outputs(id, run_id, object_type, object_id)

Add an output for a run

Parameters
idinteger

The ID of the custom script.

run_idinteger

The ID of the run.

object_typestring

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idinteger

The ID of the output.

Returns
civis.response.Response
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

post_javascript(name, source, remote_host_id, credential_id, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', running_as_id='DEFAULT')

Create a JavaScript Script

Parameters
namestring

The name of the script.

sourcestring

The body/text of the script.

remote_host_idinteger

The remote host ID that this script will connect to.

credential_idinteger

The credential that this script will use.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

hiddenboolean, optional

The hidden status of the item.

target_project_idinteger, optional

Target project to which script outputs will be added.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sourcestring

    The body/text of the script.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • running_as_idinteger

    The ID of the runner of this script.

post_javascript_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')

Clone this JavaScript Script

Parameters
idinteger

The ID for the script.

clone_scheduleboolean, optional

If true, also copy the schedule to the new script.

clone_triggersboolean, optional

If true, also copy the triggers to the new script.

clone_notificationsboolean, optional

If true, also copy the notifications to the new script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sourcestring

    The body/text of the script.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • running_as_idinteger

    The ID of the runner of this script.

post_javascript_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_javascript_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_javascript_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

Parameters
idinteger

The ID of the file.

contentstring

The contents to commit to the file.

messagestring

A commit message describing the changes being made.

file_hashstring

The full SHA of the file being replaced.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_javascript_runs(id)

Start a run

Parameters
idinteger

The ID of the javascript.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • javascript_idinteger

    The ID of the javascript.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

post_javascript_runs_outputs(id, run_id, object_type, object_id)

Add an output for a run

Parameters
idinteger

The ID of the javascript script.

run_idinteger

The ID of the run.

object_typestring

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idinteger

The ID of the output.

Returns
civis.response.Response
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

post_python3(name, source, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Create a Python Script

Parameters
namestring

The name of the script.

sourcestring

The body/text of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

hiddenboolean, optional

The hidden status of the item.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

post_python3_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')

Clone this Python Script

Parameters
idinteger

The ID for the script.

clone_scheduleboolean, optional

If true, also copy the schedule to the new script.

clone_triggersboolean, optional

If true, also copy the triggers to the new script.

clone_notificationsboolean, optional

If true, also copy the notifications to the new script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

post_python3_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_python3_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_python3_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

Parameters
idinteger

The ID of the file.

contentstring

The contents to commit to the file.

messagestring

A commit message describing the changes being made.

file_hashstring

The full SHA of the file being replaced.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_python3_runs(id)

Start a run

Parameters
idinteger

The ID of the python.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • python_idinteger

    The ID of the python.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

post_python3_runs_outputs(id, run_id, object_type, object_id)

Add an output for a run

Parameters
idinteger

The ID of the python script.

run_idinteger

The ID of the run.

object_typestring

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idinteger

The ID of the output.

Returns
civis.response.Response
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

post_r(name, source, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Create an R Script

Parameters
namestring

The name of the script.

sourcestring

The body/text of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

hiddenboolean, optional

The hidden status of the item.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

post_r_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')

Clone this R Script

Parameters
idinteger

The ID for the script.

clone_scheduleboolean, optional

If true, also copy the schedule to the new script.

clone_triggersboolean, optional

If true, also copy the triggers to the new script.

clone_notificationsboolean, optional

If true, also copy the notifications to the new script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

post_r_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_r_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_r_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

Parameters
idinteger

The ID of the file.

contentstring

The contents to commit to the file.

messagestring

A commit message describing the changes being made.

file_hashstring

The full SHA of the file being replaced.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_r_runs(id)

Start a run

Parameters
idinteger

The ID of the r.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • r_idinteger

    The ID of the r.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • max_memory_usagenumber/float

    If the run has finished, the maximum amount of memory used during the run, in MB.

  • max_cpu_usagenumber/float

    If the run has finished, the maximum amount of cpu used during the run, in millicores.

post_r_runs_outputs(id, run_id, object_type, object_id)

Add an output for a run

Parameters
idinteger

The ID of the r script.

run_idinteger

The ID of the run.

object_typestring

The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

object_idinteger

The ID of the output.

Returns
civis.response.Response
  • object_typestring

    The type of the output. Valid values are File, Table, Report, Project, Credential, or JSONValue

  • object_idinteger

    The ID of the output.

  • namestring

    The name of the output.

  • linkstring

    The hypermedia link to the output.

  • value : string

post_run(id)

Run a script

Parameters
idinteger

The ID for the script.

Returns
None

Response code 204: success

post_sql(name, sql, remote_host_id, credential_id, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', hidden='DEFAULT', target_project_id='DEFAULT', csv_settings='DEFAULT', running_as_id='DEFAULT')

Create a SQL script

Parameters
namestring

The name of the script.

sqlstring

The raw SQL query for the script.

remote_host_idinteger

The remote host ID that this script will connect to.

credential_idinteger

The credential that this script will use.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

hiddenboolean, optional

The hidden status of the item.

target_project_idinteger, optional

Target project to which script outputs will be added.

csv_settingsdict, optional::
  • include_headerboolean

    Whether or not to include headers in the output data. Default: true

  • compressionstring

    The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

  • column_delimiterstring

    Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

  • unquotedboolean

    Whether or not to quote fields. Default: false

  • force_multifileboolean

    Whether or not the csv should be split into multiple files. Default: false

  • filename_prefixstring

    A user specified filename prefix for the output file to have. Default: null

  • max_file_sizeinteger

    The max file size, in MB, created files will be. Only available when force_multifile is true.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sqlstring

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • csv_settingsdict::
    • include_headerboolean

      Whether or not to include headers in the output data. Default: true

    • compressionstring

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstring

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedboolean

      Whether or not to quote fields. Default: false

    • force_multifileboolean

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstring

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeinteger

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idinteger

    The ID of the runner of this script.

post_sql_clone(id, *, clone_schedule='DEFAULT', clone_triggers='DEFAULT', clone_notifications='DEFAULT')

Clone this SQL script

Parameters
idinteger

The ID for the script.

clone_scheduleboolean, optional

If true, also copy the schedule to the new script.

clone_triggersboolean, optional

If true, also copy the triggers to the new script.

clone_notificationsboolean, optional

If true, also copy the notifications to the new script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sqlstring

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • csv_settingsdict::
    • include_headerboolean

      Whether or not to include headers in the output data. Default: true

    • compressionstring

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstring

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedboolean

      Whether or not to quote fields. Default: false

    • force_multifileboolean

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstring

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeinteger

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idinteger

    The ID of the runner of this script.

post_sql_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_sql_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_sql_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

Parameters
idinteger

The ID of the file.

contentstring

The contents to commit to the file.

messagestring

A commit message describing the changes being made.

file_hashstring

The full SHA of the file being replaced.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_sql_runs(id)

Start a run

Parameters
idinteger

The ID of the sql.

Returns
civis.response.Response
  • idinteger

    The ID of the run.

  • sql_idinteger

    The ID of the sql.

  • statestring

    The state of the run, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • is_cancel_requestedboolean

    True if run cancel requested, else false.

  • started_atstring/time

    The time the last run started at.

  • finished_atstring/time

    The time the last run completed.

  • errorstring

    The error, if any, returned by the run.

  • outputlist::

    A list of the outputs of this script. - output_name : string

    The name of the output file.

    • file_idinteger

      The unique ID of the output file.

    • pathstring

      The temporary link to download this output file, valid for 36 hours.

  • output_cached_onstring/time

    The time that the output was originally exported, if a cache entry was used by the run.

put_containers(id, required_resources, docker_image_name, *, name='DEFAULT', parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', repo_http_uri='DEFAULT', repo_ref='DEFAULT', remote_host_credential_id='DEFAULT', git_credential_id='DEFAULT', docker_command='DEFAULT', docker_image_tag='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', time_zone='DEFAULT', partition_label='DEFAULT', target_project_id='DEFAULT', running_as_id='DEFAULT')

Edit a container

Parameters
idinteger

The ID for the script.

required_resourcesdict::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

docker_image_namestring

The name of the docker image to pull from DockerHub.

namestring, optional

The name of the container.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

repo_http_uristring, optional

The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

repo_refstring, optional

The tag or branch of the github repo to clone into the container.

remote_host_credential_idinteger, optional

The id of the database credentials to pass into the environment of the container.

git_credential_idinteger, optional

The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

docker_commandstring, optional

The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

time_zonestring, optional

The time zone of this script.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

target_project_idinteger, optional

Target project to which script outputs will be added.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the container.

  • typestring

    The type of the script (e.g Container)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • repo_http_uristring

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstring

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idinteger

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idinteger

    The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

  • docker_commandstring

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • time_zonestring

    The time zone of this script.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • running_as_idinteger

    The ID of the runner of this script.

put_containers_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the container.

  • typestring

    The type of the script (e.g Container)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • repo_http_uristring

    The location of a github repo to clone into the container, e.g. github.com/my-user/my-repo.git.

  • repo_refstring

    The tag or branch of the github repo to clone into the container.

  • remote_host_credential_idinteger

    The id of the database credentials to pass into the environment of the container.

  • git_credential_idinteger

    The id of the git credential to be used when checking out the specified git repo. If not supplied, the first git credential you’ve submitted will be used. Unnecessary if no git repo is specified or the git repo is public.

  • docker_commandstring

    The command to run on the container. Will be run via sh as: [“sh”, “-c”, dockerCommand]. Defaults to the Docker image’s ENTRYPOINT/CMD.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • time_zonestring

    The time zone of this script.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • running_as_idinteger

    The ID of the runner of this script.

put_containers_projects(id, project_id)

Add a Container Script to a project

Parameters
idinteger

The ID of the Container Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_containers_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_containers_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_containers_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_custom(id, *, name='DEFAULT', parent_id='DEFAULT', arguments='DEFAULT', remote_host_id='DEFAULT', credential_id='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Replace all attributes of this Custom Script

Parameters
idinteger

The ID for the script.

namestring, optional

The name of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

remote_host_idinteger, optional

The remote host ID that this script will connect to.

credential_idinteger, optional

The credential that this script will use.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB).

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

partition_labelstring, optional

The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g Custom)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • category : string

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • ui_report_urlinteger

    The url of the custom HTML.

  • ui_report_idinteger

    The id of the report with the custom HTML.

  • ui_report_provide_api_keyboolean

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestring

    The name of the template script.

  • template_notestring

    The template’s note.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • last_successful_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB).

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • partition_labelstring

    The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

put_custom_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g Custom)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • category : string

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template script.

  • ui_report_urlinteger

    The url of the custom HTML.

  • ui_report_idinteger

    The id of the report with the custom HTML.

  • ui_report_provide_api_keyboolean

    Whether the ui report requests an API Key from the report viewer.

  • template_script_namestring

    The name of the template script.

  • template_notestring

    The template’s note.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • archivedstring

    The archival status of the requested item(s).

  • target_project_idinteger

    Target project to which script outputs will be added.

  • last_successful_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB).

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • partition_labelstring

    The partition label used to run this object. Only applicable for jobs using Docker.Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

put_custom_projects(id, project_id)

Add a Custom Script to a project

Parameters
idinteger

The ID of the Custom Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_custom_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_custom_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_custom_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_javascript(id, name, source, remote_host_id, credential_id, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', running_as_id='DEFAULT')

Replace all attributes of this JavaScript Script

Parameters
idinteger

The ID for the script.

namestring

The name of the script.

sourcestring

The body/text of the script.

remote_host_idinteger

The remote host ID that this script will connect to.

credential_idinteger

The credential that this script will use.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sourcestring

    The body/text of the script.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • running_as_idinteger

    The ID of the runner of this script.

put_javascript_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sourcestring

    The body/text of the script.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • running_as_idinteger

    The ID of the runner of this script.

put_javascript_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Attach an item to a file in a git repo

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_javascript_projects(id, project_id)

Add a JavaScript Script to a project

Parameters
idinteger

The ID of the JavaScript Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_javascript_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_javascript_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_javascript_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_python3(id, name, source, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Replace all attributes of this Python Script

Parameters
idinteger

The ID for the script.

namestring

The name of the script.

sourcestring

The body/text of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

put_python3_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

put_python3_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Attach an item to a file in a git repo

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_python3_projects(id, project_id)

Add a Python Script to a project

Parameters
idinteger

The ID of the Python Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_python3_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_python3_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_python3_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_r(id, name, source, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', required_resources='DEFAULT', instance_type='DEFAULT', cancel_timeout='DEFAULT', docker_image_tag='DEFAULT', partition_label='DEFAULT', running_as_id='DEFAULT')

Replace all attributes of this R Script

Parameters
idinteger

The ID for the script.

namestring

The name of the script.

sourcestring

The body/text of the script.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

required_resourcesdict, optional::
  • cpuinteger

    The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

  • memoryinteger

    The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

  • disk_spacenumber/float

    The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

instance_typestring, optional

The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

cancel_timeoutinteger, optional

The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub.

partition_labelstring, optional

The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

put_r_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • required_resourcesdict::
    • cpuinteger

      The number of CPU shares to allocate for the container. Each core has 1000 shares. Must be at least 2 shares.

    • memoryinteger

      The amount of RAM to allocate for the container (in MB). Must be at least 4 MB.

    • disk_spacenumber/float

      The amount of disk space, in GB, to allocate for the container. This space will be used to hold the git repo configured for the container and anything your container writes to /tmp or /data. Fractional values (e.g. 0.25) are supported.

  • instance_typestring

    The EC2 instance type to deploy to. Only available for jobs running on kubernetes.

  • sourcestring

    The body/text of the script.

  • cancel_timeoutinteger

    The amount of time (in seconds) to wait before forcibly terminating the script. When the script is cancelled, it is first sent a TERM signal. If the script is still running after the timeout, it is sent a KILL signal. Defaults to 0.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub.

  • partition_labelstring

    The partition label used to run this object. Not generally available. Beware this attribute may be removed in the future.

  • running_as_idinteger

    The ID of the runner of this script.

put_r_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Attach an item to a file in a git repo

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_r_projects(id, project_id)

Add an R Script to a project

Parameters
idinteger

The ID of the R Script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_r_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_r_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_r_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_sql(id, name, sql, remote_host_id, credential_id, *, parent_id='DEFAULT', user_context='DEFAULT', params='DEFAULT', arguments='DEFAULT', schedule='DEFAULT', notifications='DEFAULT', next_run_at='DEFAULT', time_zone='DEFAULT', target_project_id='DEFAULT', csv_settings='DEFAULT', running_as_id='DEFAULT')

Replace all attributes of this SQL script

Parameters
idinteger

The ID for the script.

namestring

The name of the script.

sqlstring

The raw SQL query for the script.

remote_host_idinteger

The remote host ID that this script will connect to.

credential_idinteger

The credential that this script will use.

parent_idinteger, optional

The ID of the parent job that will trigger this script

user_contextstring, optional

“runner” or “author”, who to execute the script as when run as a template.

paramslist, optional::

A definition of the parameters this script accepts in the arguments field. - name : string

The variable’s name as used within your code.

  • labelstring

    The label to present to users when asking them for the value.

  • descriptionstring

    A short sentence or fragment describing this parameter to the end user.

  • typestring

    The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

  • requiredboolean

    Whether this param is required.

  • valuestring

    The value you would like to set this param to. Setting this value makes this parameter a fixed param.

  • defaultstring

    If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

  • allowed_valueslist

    The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

argumentsdict, optional

Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • success_email_from_namestring

    Name from which success emails are sent; defaults to “Civis.”

  • success_email_reply_tostring

    Address for replies to success emails; defaults to the author of the job.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on.

  • failure_onboolean

    If failure email notifications are on.

next_run_atstring/time, optional

The time of the next scheduled run.

time_zonestring, optional

The time zone of this script.

target_project_idinteger, optional

Target project to which script outputs will be added.

csv_settingsdict, optional::
  • include_headerboolean

    Whether or not to include headers in the output data. Default: true

  • compressionstring

    The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

  • column_delimiterstring

    Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

  • unquotedboolean

    Whether or not to quote fields. Default: false

  • force_multifileboolean

    Whether or not the csv should be split into multiple files. Default: false

  • filename_prefixstring

    A user specified filename prefix for the output file to have. Default: null

  • max_file_sizeinteger

    The max file size, in MB, created files will be. Only available when force_multifile is true.

running_as_idinteger, optional

The ID of the runner of this script.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sqlstring

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • csv_settingsdict::
    • include_headerboolean

      Whether or not to include headers in the output data. Default: true

    • compressionstring

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstring

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedboolean

      Whether or not to quote fields. Default: false

    • force_multifileboolean

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstring

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeinteger

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idinteger

    The ID of the runner of this script.

put_sql_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for the script.

  • namestring

    The name of the script.

  • typestring

    The type of the script (e.g SQL, Container, Python, R, JavaScript)

  • created_atstring/time

    The time this script was created.

  • updated_atstring/time

    The time the script was last updated.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The status of the script’s last run.

  • finished_atstring/time

    The time that the script’s last run finished.

  • categorystring

    The category of the script.

  • projectslist::

    A list of projects containing the script. - id : integer

    The ID for the project.

    • namestring

      The name of the project.

  • parent_idinteger

    The ID of the parent job that will trigger this script

  • user_contextstring

    “runner” or “author”, who to execute the script as when run as a template.

  • paramslist::

    A definition of the parameters this script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • argumentsdict

    Parameter-value pairs to use when running this script. Only settable if this script has defined parameters.

  • is_templateboolean

    Whether others scripts use this one as a template.

  • published_as_template_idinteger

    The ID of the template that this script is backing.

  • from_template_idinteger

    The ID of the template this script uses, if any.

  • template_dependents_countinteger

    How many other scripts use this one as a template.

  • template_script_namestring

    The name of the template script.

  • linksdict::
    • detailsstring

      The details link to get more information about the script.

    • runsstring

      The runs link to get the run information list for this script.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • success_email_from_namestring

      Name from which success emails are sent; defaults to “Civis.”

    • success_email_reply_tostring

      Address for replies to success emails; defaults to the author of the job.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on.

    • failure_onboolean

      If failure email notifications are on.

  • running_asdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • next_run_atstring/time

    The time of the next scheduled run.

  • time_zonestring

    The time zone of this script.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • hiddenboolean

    The hidden status of the item.

  • target_project_idinteger

    Target project to which script outputs will be added.

  • archivedstring

    The archival status of the requested item(s).

  • sqlstring

    The raw SQL query for the script.

  • expanded_argumentsdict

    Expanded arguments for use in injecting into different environments.

  • remote_host_idinteger

    The remote host ID that this script will connect to.

  • credential_idinteger

    The credential that this script will use.

  • code_previewstring

    The code that this script will run with arguments inserted.

  • csv_settingsdict::
    • include_headerboolean

      Whether or not to include headers in the output data. Default: true

    • compressionstring

      The type of compression to use, if any, one of “none”, “zip”, or “gzip”. Default: gzip

    • column_delimiterstring

      Which delimiter to use, one of “comma”, “tab”, or “pipe”. Default: comma

    • unquotedboolean

      Whether or not to quote fields. Default: false

    • force_multifileboolean

      Whether or not the csv should be split into multiple files. Default: false

    • filename_prefixstring

      A user specified filename prefix for the output file to have. Default: null

    • max_file_sizeinteger

      The max file size, in MB, created files will be. Only available when force_multifile is true.

  • running_as_idinteger

    The ID of the runner of this script.

put_sql_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Attach an item to a file in a git repo

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_sql_projects(id, project_id)

Add a SQL script to a project

Parameters
idinteger

The ID of the SQL script.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_sql_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_sql_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_sql_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Services
class Services(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.services.list(...)

Methods

delete_deployments(service_id, deployment_id)

Delete a Service deployment

delete_projects(id, project_id)

Remove a Service from a project

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_tokens(id, token_id)

Revoke a token by id

get(id)

Get a Service

get_deployments(service_id, deployment_id)

Get details about a Service deployment

list(*[, hidden, archived, author, status, ...])

List Services

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_deployments(service_id, *[, ...])

List deployments for a Service

list_deployments_logs(id, deployment_id, *)

Get the logs for a Service deployment

list_projects(id, *[, hidden])

List the projects a Service belongs to

list_shares(id)

List users and groups permissioned on this object

list_tokens(id)

List tokens

patch(id, *[, name, description, ...])

Update some attributes of this Service

post(*[, name, description, type, ...])

Create a Service

post_clone(id)

Clone this Service

post_deployments(service_id, *[, deployment_id])

Deploy a Service

post_redeploy(service_id, *[, deployment_id])

Redeploy a Service

post_tokens(id, name, *[, machine_token, ...])

Create a new long-lived service token

put(id, *[, name, description, ...])

Replace all attributes of this Service

put_archive(id, status)

Update the archive status of this object

put_projects(id, project_id)

Add a Service to a project

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_deployments(service_id, deployment_id)

Delete a Service deployment

Parameters
service_idinteger

The ID of the owning Service

deployment_idinteger

The ID for this deployment

Returns
None

Response code 204: success

delete_projects(id, project_id)

Remove a Service from a project

Parameters
idinteger

The ID of the Service.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_tokens(id, token_id)

Revoke a token by id

Parameters
idinteger

The ID of the service.

token_idinteger

The ID of the token.

Returns
None

Response code 204: success

get(id)

Get a Service

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for this Service.

  • namestring

    The name of this Service.

  • descriptionstring

    The description of this Service.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • typestring

    The type of this Service

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • scheduledict::
    • runtime_planstring

      Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

    • recurrenceslist::

      List of day-hour combinations this item is scheduled for - scheduled_days : list

      Days it is scheduled on, based on numeric value starting at 0 for Sunday

      • scheduled_hourslist

        Hours it is scheduled on

  • time_zone : string

  • replicasinteger

    The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

  • max_replicasinteger

    The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to each replica of the Service.

  • cpuinteger

    The amount of cpu allocated to each replica of the the Service.

  • created_at : string/time

  • updated_at : string/time

  • credentialslist

    A list of credential IDs to pass to the Service.

  • permission_set_idinteger

    The ID of the associated permission set, if any.

  • git_repo_urlstring

    The url for the git repo where the Service code lives.

  • git_repo_refstring

    The git reference to use when pulling code from the repo.

  • git_path_dirstring

    The path to the Service code within the git repo. If unspecified, the root directory will be used.

  • report_idinteger

    The ID of the associated report.

  • current_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • service_idinteger

      The ID of owning Service

  • current_urlstring

    The URL that the service is hosted at.

  • environment_variablesdict

    Environment Variables to be passed into the Service.

  • notificationsdict::
    • failure_email_addresseslist

      Addresses to notify by e-mail when the service fails.

    • failure_onboolean

      If failure email notifications are on

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

get_deployments(service_id, deployment_id)

Get details about a Service deployment

Parameters
service_idinteger

The ID of the owning Service

deployment_idinteger

The ID for this deployment

Returns
civis.response.Response
  • deployment_idinteger

    The ID for this deployment.

  • user_idinteger

    The ID of the owner.

  • hoststring

    Domain of the deployment.

  • namestring

    Name of the deployment.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • display_urlstring

    A signed URL for viewing the deployed item.

  • instance_typestring

    The EC2 instance type requested for the deployment.

  • memoryinteger

    The memory allocated to the deployment, in MB.

  • cpuinteger

    The cpu allocated to the deployment, in millicores.

  • statestring

    The state of the deployment.

  • state_messagestring

    A detailed description of the state.

  • max_memory_usagenumber/float

    If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

  • max_cpu_usagenumber/float

    If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

  • created_at : string/time

  • updated_at : string/time

  • service_idinteger

    The ID of owning Service

list(*, hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', status='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Services

Parameters
hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

authorstring, optional

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

statusstring, optional

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

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for this Service.

  • namestring

    The name of this Service.

  • descriptionstring

    The description of this Service.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • typestring

    The type of this Service

  • created_at : string/time

  • updated_at : string/time

  • git_repo_urlstring

    The url for the git repo where the Service code lives.

  • git_repo_refstring

    The git reference to use when pulling code from the repo.

  • git_path_dirstring

    The path to the Service code within the git repo. If unspecified, the root directory will be used.

  • current_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • service_idinteger

      The ID of owning Service

  • archivedstring

    The archival status of the requested item(s).

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_deployments(service_id, *, deployment_id='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List deployments for a Service

Parameters
service_idinteger

The ID of the owning Service

deployment_idinteger, optional

The ID for this deployment

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • deployment_idinteger

    The ID for this deployment.

  • user_idinteger

    The ID of the owner.

  • hoststring

    Domain of the deployment.

  • namestring

    Name of the deployment.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • instance_typestring

    The EC2 instance type requested for the deployment.

  • memoryinteger

    The memory allocated to the deployment, in MB.

  • cpuinteger

    The cpu allocated to the deployment, in millicores.

  • statestring

    The state of the deployment.

  • state_messagestring

    A detailed description of the state.

  • max_memory_usagenumber/float

    If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

  • max_cpu_usagenumber/float

    If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

  • created_at : string/time

  • updated_at : string/time

  • service_idinteger

    The ID of owning Service

list_deployments_logs(id, deployment_id, *, start_at='DEFAULT', end_at='DEFAULT', limit='DEFAULT')

Get the logs for a Service deployment

Parameters
idinteger

The ID of the owning Service.

deployment_idinteger

The ID for this deployment.

start_atstring, optional

Log entries with a lower timestamp will be omitted.

end_atstring, optional

Log entries with a higher timestamp will be omitted.

limitinteger, optional

The maximum number of log messages to return. Default of 10000.

Returns
civis.response.Response
  • messagestring

    The log message.

  • streamstring

    The stream of the log. One of “stdout”, “stderr”.

  • created_atstring/date-time

    The time the log was created.

  • sourcestring

    The source of the log. One of “system”, “user”.

list_projects(id, *, hidden='DEFAULT')

List the projects a Service belongs to

Parameters
idinteger

The ID of the Service.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_tokens(id)

List tokens

Parameters
idinteger

The ID of the service.

Returns
civis.response.Response
  • idinteger

    The ID of the token.

  • namestring

    The name of the token.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • machine_tokenboolean

    If true, this token is not tied to a particular user.

  • expires_atstring/date-time

    The date and time when the token expires.

  • created_atstring/time

    The date and time when the token was created.

patch(id, *, name='DEFAULT', description='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', schedule='DEFAULT', replicas='DEFAULT', max_replicas='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', permission_set_id='DEFAULT', git_repo_url='DEFAULT', git_repo_ref='DEFAULT', git_path_dir='DEFAULT', environment_variables='DEFAULT', notifications='DEFAULT', partition_label='DEFAULT')

Update some attributes of this Service

Parameters
idinteger

The ID for this Service.

namestring, optional

The name of this Service.

descriptionstring, optional

The description of this Service.

docker_image_namestring, optional

The name of the docker image to pull from DockerHub.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub (default: latest).

scheduledict, optional::
  • runtime_planstring

    Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

  • recurrenceslist::

    List of day-hour combinations this item is scheduled for - scheduled_days : list

    Days it is scheduled on, based on numeric value starting at 0 for Sunday

    • scheduled_hourslist

      Hours it is scheduled on

replicasinteger, optional

The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

max_replicasinteger, optional

The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

instance_typestring, optional

The EC2 instance type to deploy to.

memoryinteger, optional

The amount of memory allocated to each replica of the Service.

cpuinteger, optional

The amount of cpu allocated to each replica of the the Service.

credentialslist, optional

A list of credential IDs to pass to the Service.

permission_set_idinteger, optional

The ID of the associated permission set, if any.

git_repo_urlstring, optional

The url for the git repo where the Service code lives.

git_repo_refstring, optional

The git reference to use when pulling code from the repo.

git_path_dirstring, optional

The path to the Service code within the git repo. If unspecified, the root directory will be used.

environment_variablesdict, optional

Environment Variables to be passed into the Service.

notificationsdict, optional::
  • failure_email_addresseslist

    Addresses to notify by e-mail when the service fails.

  • failure_onboolean

    If failure email notifications are on

partition_labelstring, optional

The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

Returns
civis.response.Response
  • idinteger

    The ID for this Service.

  • namestring

    The name of this Service.

  • descriptionstring

    The description of this Service.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • typestring

    The type of this Service

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • scheduledict::
    • runtime_planstring

      Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

    • recurrenceslist::

      List of day-hour combinations this item is scheduled for - scheduled_days : list

      Days it is scheduled on, based on numeric value starting at 0 for Sunday

      • scheduled_hourslist

        Hours it is scheduled on

  • time_zone : string

  • replicasinteger

    The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

  • max_replicasinteger

    The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to each replica of the Service.

  • cpuinteger

    The amount of cpu allocated to each replica of the the Service.

  • created_at : string/time

  • updated_at : string/time

  • credentialslist

    A list of credential IDs to pass to the Service.

  • permission_set_idinteger

    The ID of the associated permission set, if any.

  • git_repo_urlstring

    The url for the git repo where the Service code lives.

  • git_repo_refstring

    The git reference to use when pulling code from the repo.

  • git_path_dirstring

    The path to the Service code within the git repo. If unspecified, the root directory will be used.

  • report_idinteger

    The ID of the associated report.

  • current_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • service_idinteger

      The ID of owning Service

  • current_urlstring

    The URL that the service is hosted at.

  • environment_variablesdict

    Environment Variables to be passed into the Service.

  • notificationsdict::
    • failure_email_addresseslist

      Addresses to notify by e-mail when the service fails.

    • failure_onboolean

      If failure email notifications are on

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

post(*, name='DEFAULT', description='DEFAULT', type='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', schedule='DEFAULT', replicas='DEFAULT', max_replicas='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', permission_set_id='DEFAULT', git_repo_url='DEFAULT', git_repo_ref='DEFAULT', git_path_dir='DEFAULT', environment_variables='DEFAULT', notifications='DEFAULT', partition_label='DEFAULT', hidden='DEFAULT')

Create a Service

Parameters
namestring, optional

The name of this Service.

descriptionstring, optional

The description of this Service.

typestring, optional

The type of this Service

docker_image_namestring, optional

The name of the docker image to pull from DockerHub.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub (default: latest).

scheduledict, optional::
  • runtime_planstring

    Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

  • recurrenceslist::

    List of day-hour combinations this item is scheduled for - scheduled_days : list

    Days it is scheduled on, based on numeric value starting at 0 for Sunday

    • scheduled_hourslist

      Hours it is scheduled on

replicasinteger, optional

The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

max_replicasinteger, optional

The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

instance_typestring, optional

The EC2 instance type to deploy to.

memoryinteger, optional

The amount of memory allocated to each replica of the Service.

cpuinteger, optional

The amount of cpu allocated to each replica of the the Service.

credentialslist, optional

A list of credential IDs to pass to the Service.

permission_set_idinteger, optional

The ID of the associated permission set, if any.

git_repo_urlstring, optional

The url for the git repo where the Service code lives.

git_repo_refstring, optional

The git reference to use when pulling code from the repo.

git_path_dirstring, optional

The path to the Service code within the git repo. If unspecified, the root directory will be used.

environment_variablesdict, optional

Environment Variables to be passed into the Service.

notificationsdict, optional::
  • failure_email_addresseslist

    Addresses to notify by e-mail when the service fails.

  • failure_onboolean

    If failure email notifications are on

partition_labelstring, optional

The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID for this Service.

  • namestring

    The name of this Service.

  • descriptionstring

    The description of this Service.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • typestring

    The type of this Service

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • scheduledict::
    • runtime_planstring

      Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

    • recurrenceslist::

      List of day-hour combinations this item is scheduled for - scheduled_days : list

      Days it is scheduled on, based on numeric value starting at 0 for Sunday

      • scheduled_hourslist

        Hours it is scheduled on

  • time_zone : string

  • replicasinteger

    The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

  • max_replicasinteger

    The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to each replica of the Service.

  • cpuinteger

    The amount of cpu allocated to each replica of the the Service.

  • created_at : string/time

  • updated_at : string/time

  • credentialslist

    A list of credential IDs to pass to the Service.

  • permission_set_idinteger

    The ID of the associated permission set, if any.

  • git_repo_urlstring

    The url for the git repo where the Service code lives.

  • git_repo_refstring

    The git reference to use when pulling code from the repo.

  • git_path_dirstring

    The path to the Service code within the git repo. If unspecified, the root directory will be used.

  • report_idinteger

    The ID of the associated report.

  • current_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • service_idinteger

      The ID of owning Service

  • current_urlstring

    The URL that the service is hosted at.

  • environment_variablesdict

    Environment Variables to be passed into the Service.

  • notificationsdict::
    • failure_email_addresseslist

      Addresses to notify by e-mail when the service fails.

    • failure_onboolean

      If failure email notifications are on

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

post_clone(id)

Clone this Service

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for this Service.

  • namestring

    The name of this Service.

  • descriptionstring

    The description of this Service.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • typestring

    The type of this Service

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • scheduledict::
    • runtime_planstring

      Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

    • recurrenceslist::

      List of day-hour combinations this item is scheduled for - scheduled_days : list

      Days it is scheduled on, based on numeric value starting at 0 for Sunday

      • scheduled_hourslist

        Hours it is scheduled on

  • time_zone : string

  • replicasinteger

    The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

  • max_replicasinteger

    The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to each replica of the Service.

  • cpuinteger

    The amount of cpu allocated to each replica of the the Service.

  • created_at : string/time

  • updated_at : string/time

  • credentialslist

    A list of credential IDs to pass to the Service.

  • permission_set_idinteger

    The ID of the associated permission set, if any.

  • git_repo_urlstring

    The url for the git repo where the Service code lives.

  • git_repo_refstring

    The git reference to use when pulling code from the repo.

  • git_path_dirstring

    The path to the Service code within the git repo. If unspecified, the root directory will be used.

  • report_idinteger

    The ID of the associated report.

  • current_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • service_idinteger

      The ID of owning Service

  • current_urlstring

    The URL that the service is hosted at.

  • environment_variablesdict

    Environment Variables to be passed into the Service.

  • notificationsdict::
    • failure_email_addresseslist

      Addresses to notify by e-mail when the service fails.

    • failure_onboolean

      If failure email notifications are on

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

post_deployments(service_id, *, deployment_id='DEFAULT')

Deploy a Service

Parameters
service_idinteger

The ID of the owning Service

deployment_idinteger, optional

The ID for this deployment

Returns
civis.response.Response
  • deployment_idinteger

    The ID for this deployment.

  • user_idinteger

    The ID of the owner.

  • hoststring

    Domain of the deployment.

  • namestring

    Name of the deployment.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • display_urlstring

    A signed URL for viewing the deployed item.

  • instance_typestring

    The EC2 instance type requested for the deployment.

  • memoryinteger

    The memory allocated to the deployment, in MB.

  • cpuinteger

    The cpu allocated to the deployment, in millicores.

  • statestring

    The state of the deployment.

  • state_messagestring

    A detailed description of the state.

  • max_memory_usagenumber/float

    If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

  • max_cpu_usagenumber/float

    If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

  • created_at : string/time

  • updated_at : string/time

  • service_idinteger

    The ID of owning Service

post_redeploy(service_id, *, deployment_id='DEFAULT')

Redeploy a Service

Parameters
service_idinteger

The ID of the owning Service

deployment_idinteger, optional

The ID for this deployment

Returns
civis.response.Response
  • deployment_idinteger

    The ID for this deployment.

  • user_idinteger

    The ID of the owner.

  • hoststring

    Domain of the deployment.

  • namestring

    Name of the deployment.

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • display_urlstring

    A signed URL for viewing the deployed item.

  • instance_typestring

    The EC2 instance type requested for the deployment.

  • memoryinteger

    The memory allocated to the deployment, in MB.

  • cpuinteger

    The cpu allocated to the deployment, in millicores.

  • statestring

    The state of the deployment.

  • state_messagestring

    A detailed description of the state.

  • max_memory_usagenumber/float

    If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

  • max_cpu_usagenumber/float

    If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

  • created_at : string/time

  • updated_at : string/time

  • service_idinteger

    The ID of owning Service

post_tokens(id, name, *, machine_token='DEFAULT', expires_in='DEFAULT')

Create a new long-lived service token

Parameters
idinteger

The ID of the service.

namestring

The name of the token.

machine_tokenboolean, optional

If true, create a compact token with no user information.

expires_ininteger, optional

The number of seconds until the token should expire

Returns
civis.response.Response
  • idinteger

    The ID of the token.

  • namestring

    The name of the token.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • machine_tokenboolean

    If true, this token is not tied to a particular user.

  • expires_atstring/date-time

    The date and time when the token expires.

  • created_atstring/time

    The date and time when the token was created.

  • tokenstring

    The value of the token. Only returned when the token is first created.

put(id, *, name='DEFAULT', description='DEFAULT', docker_image_name='DEFAULT', docker_image_tag='DEFAULT', schedule='DEFAULT', replicas='DEFAULT', max_replicas='DEFAULT', instance_type='DEFAULT', memory='DEFAULT', cpu='DEFAULT', credentials='DEFAULT', permission_set_id='DEFAULT', git_repo_url='DEFAULT', git_repo_ref='DEFAULT', git_path_dir='DEFAULT', environment_variables='DEFAULT', notifications='DEFAULT', partition_label='DEFAULT')

Replace all attributes of this Service

Parameters
idinteger

The ID for this Service.

namestring, optional

The name of this Service.

descriptionstring, optional

The description of this Service.

docker_image_namestring, optional

The name of the docker image to pull from DockerHub.

docker_image_tagstring, optional

The tag of the docker image to pull from DockerHub (default: latest).

scheduledict, optional::
  • runtime_planstring

    Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

  • recurrenceslist::

    List of day-hour combinations this item is scheduled for - scheduled_days : list

    Days it is scheduled on, based on numeric value starting at 0 for Sunday

    • scheduled_hourslist

      Hours it is scheduled on

replicasinteger, optional

The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

max_replicasinteger, optional

The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

instance_typestring, optional

The EC2 instance type to deploy to.

memoryinteger, optional

The amount of memory allocated to each replica of the Service.

cpuinteger, optional

The amount of cpu allocated to each replica of the the Service.

credentialslist, optional

A list of credential IDs to pass to the Service.

permission_set_idinteger, optional

The ID of the associated permission set, if any.

git_repo_urlstring, optional

The url for the git repo where the Service code lives.

git_repo_refstring, optional

The git reference to use when pulling code from the repo.

git_path_dirstring, optional

The path to the Service code within the git repo. If unspecified, the root directory will be used.

environment_variablesdict, optional

Environment Variables to be passed into the Service.

notificationsdict, optional::
  • failure_email_addresseslist

    Addresses to notify by e-mail when the service fails.

  • failure_onboolean

    If failure email notifications are on

partition_labelstring, optional

The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

Returns
civis.response.Response
  • idinteger

    The ID for this Service.

  • namestring

    The name of this Service.

  • descriptionstring

    The description of this Service.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • typestring

    The type of this Service

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • scheduledict::
    • runtime_planstring

      Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

    • recurrenceslist::

      List of day-hour combinations this item is scheduled for - scheduled_days : list

      Days it is scheduled on, based on numeric value starting at 0 for Sunday

      • scheduled_hourslist

        Hours it is scheduled on

  • time_zone : string

  • replicasinteger

    The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

  • max_replicasinteger

    The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to each replica of the Service.

  • cpuinteger

    The amount of cpu allocated to each replica of the the Service.

  • created_at : string/time

  • updated_at : string/time

  • credentialslist

    A list of credential IDs to pass to the Service.

  • permission_set_idinteger

    The ID of the associated permission set, if any.

  • git_repo_urlstring

    The url for the git repo where the Service code lives.

  • git_repo_refstring

    The git reference to use when pulling code from the repo.

  • git_path_dirstring

    The path to the Service code within the git repo. If unspecified, the root directory will be used.

  • report_idinteger

    The ID of the associated report.

  • current_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • service_idinteger

      The ID of owning Service

  • current_urlstring

    The URL that the service is hosted at.

  • environment_variablesdict

    Environment Variables to be passed into the Service.

  • notificationsdict::
    • failure_email_addresseslist

      Addresses to notify by e-mail when the service fails.

    • failure_onboolean

      If failure email notifications are on

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for this Service.

  • namestring

    The name of this Service.

  • descriptionstring

    The description of this Service.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • typestring

    The type of this Service

  • docker_image_namestring

    The name of the docker image to pull from DockerHub.

  • docker_image_tagstring

    The tag of the docker image to pull from DockerHub (default: latest).

  • scheduledict::
    • runtime_planstring

      Only affects the service when deployed. On Demand means that the service will be turned on when viewed and automatically turned off after periods of inactivity. Specific Times means the service will be on when scheduled. Always On means the deployed service will always be on.

    • recurrenceslist::

      List of day-hour combinations this item is scheduled for - scheduled_days : list

      Days it is scheduled on, based on numeric value starting at 0 for Sunday

      • scheduled_hourslist

        Hours it is scheduled on

  • time_zone : string

  • replicasinteger

    The number of Service replicas to deploy. When maxReplicas is set, this field defines the minimum number of replicas to deploy.

  • max_replicasinteger

    The maximum number of Service replicas to deploy. Defining this field enables autoscaling.

  • instance_typestring

    The EC2 instance type to deploy to.

  • memoryinteger

    The amount of memory allocated to each replica of the Service.

  • cpuinteger

    The amount of cpu allocated to each replica of the the Service.

  • created_at : string/time

  • updated_at : string/time

  • credentialslist

    A list of credential IDs to pass to the Service.

  • permission_set_idinteger

    The ID of the associated permission set, if any.

  • git_repo_urlstring

    The url for the git repo where the Service code lives.

  • git_repo_refstring

    The git reference to use when pulling code from the repo.

  • git_path_dirstring

    The path to the Service code within the git repo. If unspecified, the root directory will be used.

  • report_idinteger

    The ID of the associated report.

  • current_deploymentdict::
    • deployment_idinteger

      The ID for this deployment.

    • user_idinteger

      The ID of the owner.

    • hoststring

      Domain of the deployment.

    • namestring

      Name of the deployment.

    • docker_image_namestring

      The name of the docker image to pull from DockerHub.

    • docker_image_tagstring

      The tag of the docker image to pull from DockerHub (default: latest).

    • display_urlstring

      A signed URL for viewing the deployed item.

    • instance_typestring

      The EC2 instance type requested for the deployment.

    • memoryinteger

      The memory allocated to the deployment, in MB.

    • cpuinteger

      The cpu allocated to the deployment, in millicores.

    • statestring

      The state of the deployment.

    • state_messagestring

      A detailed description of the state.

    • max_memory_usagenumber/float

      If the deployment has finished, the maximum amount of memory used during the deployment, in MB.

    • max_cpu_usagenumber/float

      If the deployment has finished, the maximum amount of cpu used during the deployment, in millicores.

    • created_at : string/time

    • updated_at : string/time

    • service_idinteger

      The ID of owning Service

  • current_urlstring

    The URL that the service is hosted at.

  • environment_variablesdict

    Environment Variables to be passed into the Service.

  • notificationsdict::
    • failure_email_addresseslist

      Addresses to notify by e-mail when the service fails.

    • failure_onboolean

      If failure email notifications are on

  • partition_labelstring

    The partition label used to run this object. Only settable with custom_partitions feature flag. Beware attribute may break or change in the future.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

put_projects(id, project_id)

Add a Service to a project

Parameters
idinteger

The ID of the Service.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Storage_Hosts
class Storage_Hosts(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.storage_hosts.list(...)

Methods

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get a storage host

list()

List the storage hosts

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, name, provider, bucket, ...])

Update some attributes of this storage host

post(provider, bucket, name, *[, s3_options])

Create a new storage host

put(id, name, provider, bucket, *[, s3_options])

Replace all attributes of this storage host

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get a storage host

Parameters
idinteger

The ID of the storage host.

Returns
civis.response.Response
  • idinteger

    The ID of the storage host.

  • ownerdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The human readable name for the storage host.

  • providerstring

    The storage provider.One of: s3.

  • bucketstring

    The bucket for this storage host.

  • s3_optionsdict::
    • regionstring

      The region for this storage host (ex. “us-east-1”)

list()

List the storage hosts

Returns
civis.response.Response
  • idinteger

    The ID of the storage host.

  • ownerdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The human readable name for the storage host.

  • providerstring

    The storage provider.One of: s3.

  • bucketstring

    The bucket for this storage host.

  • s3_optionsdict::
    • regionstring

      The region for this storage host (ex. “us-east-1”)

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id, *, name='DEFAULT', provider='DEFAULT', bucket='DEFAULT', s3_options='DEFAULT')

Update some attributes of this storage host

Parameters
idinteger

The ID of the storage host.

namestring, optional

The human readable name for the storage host.

providerstring, optional

The storage provider.One of: s3.

bucketstring, optional

The bucket for this storage host.

s3_optionsdict, optional::
  • regionstring

    The region for this storage host (ex. “us-east-1”)

Returns
civis.response.Response
  • idinteger

    The ID of the storage host.

  • ownerdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The human readable name for the storage host.

  • providerstring

    The storage provider.One of: s3.

  • bucketstring

    The bucket for this storage host.

  • s3_optionsdict::
    • regionstring

      The region for this storage host (ex. “us-east-1”)

post(provider, bucket, name, *, s3_options='DEFAULT')

Create a new storage host

Parameters
providerstring

The storage provider.One of: s3.

bucketstring

The bucket for this storage host.

namestring

The human readable name for the storage host.

s3_optionsdict, optional::
  • regionstring

    The region for this storage host (ex. “us-east-1”)

Returns
civis.response.Response
  • idinteger

    The ID of the storage host.

  • ownerdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The human readable name for the storage host.

  • providerstring

    The storage provider.One of: s3.

  • bucketstring

    The bucket for this storage host.

  • s3_optionsdict::
    • regionstring

      The region for this storage host (ex. “us-east-1”)

put(id, name, provider, bucket, *, s3_options='DEFAULT')

Replace all attributes of this storage host

Parameters
idinteger

The ID of the storage host.

namestring

The human readable name for the storage host.

providerstring

The storage provider.One of: s3.

bucketstring

The bucket for this storage host.

s3_optionsdict, optional::
  • regionstring

    The region for this storage host (ex. “us-east-1”)

Returns
civis.response.Response
  • idinteger

    The ID of the storage host.

  • ownerdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The human readable name for the storage host.

  • providerstring

    The storage provider.One of: s3.

  • bucketstring

    The bucket for this storage host.

  • s3_optionsdict::
    • regionstring

      The region for this storage host (ex. “us-east-1”)

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Table_Tags
class Table_Tags(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.table_tags.list(...)

Methods

delete(id)

Delete a Table Tag

get(id)

Get a Table Tag

list(*[, name, limit, page_num, order, ...])

List Table Tags

post(name)

Create a Table Tag

delete(id)

Delete a Table Tag

Parameters
idinteger
Returns
None

Response code 204: success

get(id)

Get a Table Tag

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    Table Tag ID

  • namestring

    Table Tag Name

  • created_atstring/date-time

    The date the tag was created.

  • updated_atstring/date-time

    The date the tag was recently updated on.

  • table_countinteger

    The total number of tables associated with the tag.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

list(*, name='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Table Tags

Parameters
namestring, optional

Name of the tag. If it is provided, the results will be filtered by name

limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    Table Tag ID

  • namestring

    Table Tag Name

  • table_countinteger

    The total number of tables associated with the tag.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

post(name)

Create a Table Tag

Parameters
namestring

Table Tag Name

Returns
civis.response.Response
  • idinteger

    Table Tag ID

  • namestring

    Table Tag Name

  • created_atstring/date-time

    The date the tag was created.

  • updated_atstring/date-time

    The date the tag was recently updated on.

  • table_countinteger

    The total number of tables associated with the tag.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

Tables
class Tables(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.tables.post_enhancements_geocodings(...)

Methods

delete_projects(id, project_id)

Remove a Table from a project

delete_tags(id, table_tag_id)

Add a tag to a table

get(id)

Show basic table info

get_enhancements_cass_ncoa(id, source_table_id)

Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:source_table_id/enhancements/cass-ncoa/:id endpoint is deprecated and will be removed after January 1, 2021. View the status of a CASS / NCOA table enhancement

get_enhancements_geocodings(id, source_table_id)

Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:source_table_id/enhancements/geocodings/:id endpoint is deprecated and will be removed after January 1, 2021. View the status of a geocoding table enhancement

list(*[, database_id, schema, name, search, ...])

List tables

list_columns(id, *[, name, limit, page_num, ...])

List columns in the specified table

list_projects(id, *[, hidden])

List the projects a Table belongs to

patch(id, *[, ontology_mapping, ...])

Update a table

post_enhancements_cass_ncoa(source_table_id, *)

Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:source_table_id/enhancements/cass-ncoa endpoint is deprecated and will be removed after January 1, 2021. Standardize addresses in a table

post_enhancements_geocodings(source_table_id)

Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:source_table_id/enhancements/geocodings endpoint is deprecated and will be removed after January 1, 2021. Geocode a table

post_refresh(id)

Deprecation warning! :2: (WARNING/2) Title underline too short. Deprecation warning! ------------------ Warning: The tables/:id/refresh endpoint is deprecated. Please use tables/scan from now on. Request a refresh for column and table statistics

post_scan(database_id, schema, table_name, *)

Creates and enqueues a single table scanner job on a new table

put_projects(id, project_id)

Add a Table to a project

put_tags(id, table_tag_id)

Add a tag to a table

delete_projects(id, project_id)

Remove a Table from a project

Parameters
idinteger

The ID of the Table.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_tags(id, table_tag_id)

Add a tag to a table

Parameters
idinteger

The ID of the table.

table_tag_idinteger

The ID of the tag.

Returns
None

Response code 200: success

get(id)

Show basic table info

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID of the table.

  • database_idinteger

    The ID of the database.

  • schemastring

    The name of the schema containing the table.

  • namestring

    Name of the table.

  • descriptionstring

    The description of the table, as specified by the table owner

  • is_viewboolean

    True if this table represents a view. False if it represents a regular table.

  • row_countinteger

    The number of rows in the table.

  • column_countinteger

    The number of columns in the table.

  • size_mbnumber/float

    The size of the table in megabytes.

  • ownerstring

    The database username of the table’s owner.

  • distkeystring

    The column used as the Amazon Redshift distkey.

  • sortkeysstring

    The column used as the Amazon Redshift sortkey.

  • refresh_statusstring

    How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.

  • last_refreshstring/date-time

    The time of the last statistics refresh.

  • data_updated_atstring/date-time

    The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • schema_updated_atstring/date-time

    The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • refresh_idstring

    The ID of the most recent statistics refresh.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • primary_keyslist

    The primary keys for this table.

  • last_modified_keyslist

    The columns indicating an entry’s modification status for this table.

  • table_tagslist::

    The table tags associated with this table. - id : integer

    Table Tag ID

    • namestring

      Table Tag Name

  • ontology_mappingdict

    The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.

  • columnslist::
    • namestring

      Name of the column.

    • civis_data_typestring

      The generic data type of the column (ex. “string”). Since this is database-agnostic, it may be helpful when loading data to R/Python.

    • sql_typestring

      The database-specific SQL type of the column (ex. “varchar(30)”).

    • sample_valueslist

      A sample of values from the column.

    • encodingstring

      The compression encoding for this columnSee: http://docs.aws.amazon .com/redshift/latest/dg/c_Compression_encodings.html

    • descriptionstring

      The description of the column, as specified by the table owner

    • orderinteger

      Relative position of the column in the table.

    • min_valuestring

      Smallest value in the column.

    • max_valuestring

      Largest value in the column.

    • avg_valuenumber/float

      This parameter is deprecated.

    • stddevnumber/float

      This parameter is deprecated.

    • value_distribution_percentdict

      A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.

    • coverage_countinteger

      Number of non-null values in the column.

    • null_countinteger

      Number of null values in the column.

    • possible_dependent_variable_typeslist

      Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.

    • useable_as_independent_variableboolean

      Whether the column may be used as an independent variable to train a model.

    • useable_as_primary_keyboolean

      Whether the column may be used as an primary key to identify table rows.

    • value_distributiondict

      An object mapping distinct values in the column to the number of times they appear in the column

    • distinct_countinteger

      Number of distinct values in the column. NULL values are counted and treated as a single distinct value.

  • joinslist::
    • id : integer

    • left_table_id : integer

    • left_identifier : string

    • right_table_id : integer

    • right_identifier : string

    • on : string

    • left_join : boolean

    • created_at : string/time

    • updated_at : string/time

  • multipart_key : list

  • enhancementslist::
    • type : string

    • created_at : string/time

    • updated_at : string/time

    • join_id : integer

  • view_def : string

  • table_def : string

  • outgoing_table_matcheslist::
    • source_table_idinteger

      Source table

    • target_typestring

      Target type

    • target_idinteger

      Target ID

    • targetdict::
      • name : string

    • jobdict::
      • id : integer

      • name : string

      • type : string

      • from_template_id : integer

      • statestring

        Whether the job is idle, queued, running, cancelled, or failed.

      • created_at : string/date-time

      • updated_at : string/date-time

      • runslist::

        Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time

        The time that the run was queued.

        • started_atstring/time

          The time that the run started.

        • finished_atstring/time

          The time that the run completed.

        • errorstring

          The error message for this run, if present.

      • last_rundict::
        • id : integer

        • state : string

        • created_atstring/time

          The time that the run was queued.

        • started_atstring/time

          The time that the run started.

        • finished_atstring/time

          The time that the run completed.

        • errorstring

          The error message for this run, if present.

      • hiddenboolean

        The hidden status of the item.

      • match_optionsdict::
        • max_matches : integer

        • threshold : string

get_enhancements_cass_ncoa(id, source_table_id)

Warning: The tables/:source_table_id/enhancements/cass-ncoa/:id endpoint is deprecated and will be removed after January 1, 2021. View the status of a CASS / NCOA table enhancement

Parameters
idinteger

The ID of the enhancement.

source_table_idinteger

The ID of the table that was enhanced.

Returns
civis.response.Response
  • idinteger

    The ID of the enhancement.

  • source_table_idinteger

    The ID of the table that was enhanced.

  • statestring

    The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • enhanced_table_schemastring

    The schema name of the table created by the enhancement.

  • enhanced_table_namestring

    The name of the table created by the enhancement.

  • perform_ncoaboolean

    Whether to update addresses for records matching the National Change of Address (NCOA) database.

  • ncoa_credential_idinteger

    Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

  • output_levelstring

    The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

get_enhancements_geocodings(id, source_table_id)

Warning: The tables/:source_table_id/enhancements/geocodings/:id endpoint is deprecated and will be removed after January 1, 2021. View the status of a geocoding table enhancement

Parameters
idinteger

The ID of the enhancement.

source_table_idinteger

The ID of the table that was enhanced.

Returns
civis.response.Response
  • idinteger

    The ID of the enhancement.

  • source_table_idinteger

    The ID of the table that was enhanced.

  • statestring

    The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • enhanced_table_schemastring

    The schema name of the table created by the enhancement.

  • enhanced_table_namestring

    The name of the table created by the enhancement.

list(*, database_id='DEFAULT', schema='DEFAULT', name='DEFAULT', search='DEFAULT', table_tag_ids='DEFAULT', credential_id='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List tables

Parameters
database_idinteger, optional

The ID of the database.

schemastring, optional

If specified, will be used to filter the tables returned. Substring matching is supported with “%” and “*” wildcards (e.g., “schema=%census%” will return both “client_census.table” and “census_2010.table”).

namestring, optional

If specified, will be used to filter the tables returned. Substring matching is supported with “%” and “*” wildcards (e.g., “name=%table%” will return both “table1” and “my table”).

searchstring, optional

If specified, will be used to filter the tables returned. Will search across schema and name (in the full form schema.name) and will return any full name containing the search string.

table_tag_idsarray, optional

If specified, will be used to filter the tables returned. Will search across Table Tags and will return any tables that have one of the matching Table Tags.

credential_idinteger, optional

If specified, will be used instead of the default credential to filter the tables returned.

limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to schema. Must be one of: schema, name, search, table_tag_ids, credential_id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the table.

  • database_idinteger

    The ID of the database.

  • schemastring

    The name of the schema containing the table.

  • namestring

    Name of the table.

  • descriptionstring

    The description of the table, as specified by the table owner

  • is_viewboolean

    True if this table represents a view. False if it represents a regular table.

  • row_countinteger

    The number of rows in the table.

  • column_countinteger

    The number of columns in the table.

  • size_mbnumber/float

    The size of the table in megabytes.

  • ownerstring

    The database username of the table’s owner.

  • distkeystring

    The column used as the Amazon Redshift distkey.

  • sortkeysstring

    The column used as the Amazon Redshift sortkey.

  • refresh_statusstring

    How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.

  • last_refreshstring/date-time

    The time of the last statistics refresh.

  • refresh_idstring

    The ID of the most recent statistics refresh.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • table_tagslist::

    The table tags associated with this table. - id : integer

    Table Tag ID

    • namestring

      Table Tag Name

list_columns(id, *, name='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List columns in the specified table

Parameters
idinteger
namestring, optional

Search for columns with the given name, within the specified table.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • namestring

    Name of the column.

  • civis_data_typestring

    The generic data type of the column (ex. “string”). Since this is database-agnostic, it may be helpful when loading data to R/Python.

  • sql_typestring

    The database-specific SQL type of the column (ex. “varchar(30)”).

  • sample_valueslist

    A sample of values from the column.

  • encodingstring

    The compression encoding for this columnSee: http://docs.aws.amazon.com /redshift/latest/dg/c_Compression_encodings.html

  • descriptionstring

    The description of the column, as specified by the table owner

  • orderinteger

    Relative position of the column in the table.

  • min_valuestring

    Smallest value in the column.

  • max_valuestring

    Largest value in the column.

  • avg_valuenumber/float

    This parameter is deprecated.

  • stddevnumber/float

    This parameter is deprecated.

  • value_distribution_percentdict

    A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.

  • coverage_countinteger

    Number of non-null values in the column.

  • null_countinteger

    Number of null values in the column.

  • possible_dependent_variable_typeslist

    Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.

  • useable_as_independent_variableboolean

    Whether the column may be used as an independent variable to train a model.

  • useable_as_primary_keyboolean

    Whether the column may be used as an primary key to identify table rows.

  • value_distributiondict

    An object mapping distinct values in the column to the number of times they appear in the column

  • distinct_countinteger

    Number of distinct values in the column. NULL values are counted and treated as a single distinct value.

list_projects(id, *, hidden='DEFAULT')

List the projects a Table belongs to

Parameters
idinteger

The ID of the Table.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

patch(id, *, ontology_mapping='DEFAULT', description='DEFAULT', primary_keys='DEFAULT', last_modified_keys='DEFAULT')

Update a table

Parameters
idinteger

The ID of the table.

ontology_mappingdict, optional

The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.

descriptionstring, optional

The user-defined description of the table.

primary_keyslist, optional

A list of column(s) which together uniquely identify a row in the data.These columns must not contain NULL values.

last_modified_keyslist, optional

The columns indicating when a row was last modified.

Returns
civis.response.Response
  • idinteger

    The ID of the table.

  • database_idinteger

    The ID of the database.

  • schemastring

    The name of the schema containing the table.

  • namestring

    Name of the table.

  • descriptionstring

    The description of the table, as specified by the table owner

  • is_viewboolean

    True if this table represents a view. False if it represents a regular table.

  • row_countinteger

    The number of rows in the table.

  • column_countinteger

    The number of columns in the table.

  • size_mbnumber/float

    The size of the table in megabytes.

  • ownerstring

    The database username of the table’s owner.

  • distkeystring

    The column used as the Amazon Redshift distkey.

  • sortkeysstring

    The column used as the Amazon Redshift sortkey.

  • refresh_statusstring

    How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.

  • last_refreshstring/date-time

    The time of the last statistics refresh.

  • data_updated_atstring/date-time

    The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • schema_updated_atstring/date-time

    The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • refresh_idstring

    The ID of the most recent statistics refresh.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • primary_keyslist

    The primary keys for this table.

  • last_modified_keyslist

    The columns indicating an entry’s modification status for this table.

  • table_tagslist::

    The table tags associated with this table. - id : integer

    Table Tag ID

    • namestring

      Table Tag Name

  • ontology_mappingdict

    The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.

post_enhancements_cass_ncoa(source_table_id, *, perform_ncoa='DEFAULT', ncoa_credential_id='DEFAULT', output_level='DEFAULT')

Warning: The tables/:source_table_id/enhancements/cass-ncoa endpoint is deprecated and will be removed after January 1, 2021. Standardize addresses in a table

Parameters
source_table_idinteger

The ID of the table to be enhanced.

perform_ncoaboolean, optional

Whether to update addresses for records matching the National Change of Address (NCOA) database.

ncoa_credential_idinteger, optional

Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

output_levelstring, optional

The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

Returns
civis.response.Response
  • idinteger

    The ID of the enhancement.

  • source_table_idinteger

    The ID of the table that was enhanced.

  • statestring

    The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • enhanced_table_schemastring

    The schema name of the table created by the enhancement.

  • enhanced_table_namestring

    The name of the table created by the enhancement.

  • perform_ncoaboolean

    Whether to update addresses for records matching the National Change of Address (NCOA) database.

  • ncoa_credential_idinteger

    Credential to use when performing NCOA updates. Required if ‘performNcoa’ is true.

  • output_levelstring

    The set of fields persisted by a CASS or NCOA enhancement.For CASS enhancements, one of ‘cass’ or ‘all.’For NCOA enhancements, one of ‘cass’, ‘ncoa’ , ‘coalesced’ or ‘all’.By default, all fields will be returned.

post_enhancements_geocodings(source_table_id)

Warning: The tables/:source_table_id/enhancements/geocodings endpoint is deprecated and will be removed after January 1, 2021. Geocode a table

Parameters
source_table_idinteger

The ID of the table to be enhanced.

Returns
civis.response.Response
  • idinteger

    The ID of the enhancement.

  • source_table_idinteger

    The ID of the table that was enhanced.

  • statestring

    The state of the enhancement, one of ‘queued’ ‘running’ ‘succeeded’ ‘failed’ or ‘cancelled’.

  • enhanced_table_schemastring

    The schema name of the table created by the enhancement.

  • enhanced_table_namestring

    The name of the table created by the enhancement.

post_refresh(id)

Warning: The tables/:id/refresh endpoint is deprecated. Please use tables/scan from now on. Request a refresh for column and table statistics

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID of the table.

  • database_idinteger

    The ID of the database.

  • schemastring

    The name of the schema containing the table.

  • namestring

    Name of the table.

  • descriptionstring

    The description of the table, as specified by the table owner

  • is_viewboolean

    True if this table represents a view. False if it represents a regular table.

  • row_countinteger

    The number of rows in the table.

  • column_countinteger

    The number of columns in the table.

  • size_mbnumber/float

    The size of the table in megabytes.

  • ownerstring

    The database username of the table’s owner.

  • distkeystring

    The column used as the Amazon Redshift distkey.

  • sortkeysstring

    The column used as the Amazon Redshift sortkey.

  • refresh_statusstring

    How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.

  • last_refreshstring/date-time

    The time of the last statistics refresh.

  • data_updated_atstring/date-time

    The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • schema_updated_atstring/date-time

    The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • refresh_idstring

    The ID of the most recent statistics refresh.

  • last_rundict::
    • id : integer

    • state : string

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

    • errorstring

      The error message for this run, if present.

  • primary_keyslist

    The primary keys for this table.

  • last_modified_keyslist

    The columns indicating an entry’s modification status for this table.

  • table_tagslist::

    The table tags associated with this table. - id : integer

    Table Tag ID

    • namestring

      Table Tag Name

  • ontology_mappingdict

    The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.

  • columnslist::
    • namestring

      Name of the column.

    • civis_data_typestring

      The generic data type of the column (ex. “string”). Since this is database-agnostic, it may be helpful when loading data to R/Python.

    • sql_typestring

      The database-specific SQL type of the column (ex. “varchar(30)”).

    • sample_valueslist

      A sample of values from the column.

    • encodingstring

      The compression encoding for this columnSee: http://docs.aws.amazon .com/redshift/latest/dg/c_Compression_encodings.html

    • descriptionstring

      The description of the column, as specified by the table owner

    • orderinteger

      Relative position of the column in the table.

    • min_valuestring

      Smallest value in the column.

    • max_valuestring

      Largest value in the column.

    • avg_valuenumber/float

      This parameter is deprecated.

    • stddevnumber/float

      This parameter is deprecated.

    • value_distribution_percentdict

      A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.

    • coverage_countinteger

      Number of non-null values in the column.

    • null_countinteger

      Number of null values in the column.

    • possible_dependent_variable_typeslist

      Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.

    • useable_as_independent_variableboolean

      Whether the column may be used as an independent variable to train a model.

    • useable_as_primary_keyboolean

      Whether the column may be used as an primary key to identify table rows.

    • value_distributiondict

      An object mapping distinct values in the column to the number of times they appear in the column

    • distinct_countinteger

      Number of distinct values in the column. NULL values are counted and treated as a single distinct value.

  • joinslist::
    • id : integer

    • left_table_id : integer

    • left_identifier : string

    • right_table_id : integer

    • right_identifier : string

    • on : string

    • left_join : boolean

    • created_at : string/time

    • updated_at : string/time

  • multipart_key : list

  • enhancementslist::
    • type : string

    • created_at : string/time

    • updated_at : string/time

    • join_id : integer

  • view_def : string

  • table_def : string

  • outgoing_table_matcheslist::
    • source_table_idinteger

      Source table

    • target_typestring

      Target type

    • target_idinteger

      Target ID

    • targetdict::
      • name : string

    • jobdict::
      • id : integer

      • name : string

      • type : string

      • from_template_id : integer

      • statestring

        Whether the job is idle, queued, running, cancelled, or failed.

      • created_at : string/date-time

      • updated_at : string/date-time

      • runslist::

        Information about the most recent runs of the job. - id : integer - state : string - created_at : string/time

        The time that the run was queued.

        • started_atstring/time

          The time that the run started.

        • finished_atstring/time

          The time that the run completed.

        • errorstring

          The error message for this run, if present.

      • last_rundict::
        • id : integer

        • state : string

        • created_atstring/time

          The time that the run was queued.

        • started_atstring/time

          The time that the run started.

        • finished_atstring/time

          The time that the run completed.

        • errorstring

          The error message for this run, if present.

      • hiddenboolean

        The hidden status of the item.

      • match_optionsdict::
        • max_matches : integer

        • threshold : string

post_scan(database_id, schema, table_name, *, stats_priority='DEFAULT')

Creates and enqueues a single table scanner job on a new table

Parameters
database_idinteger

The ID of the database.

schemastring

The name of the schema containing the table.

table_namestring

The name of the table.

stats_prioritystring, optional

When to sync table statistics. Valid Options are the following. Option: ‘flag’ means to flag stats for the next scheduled run of a full table scan on the database. Option: ‘block’ means to block this job on stats syncing. Option: ‘queue’ means to queue a separate job for syncing stats and do not block this job on the queued job. Defaults to ‘flag’

Returns
civis.response.Response
  • job_idinteger

    The ID of the job created.

  • run_idinteger

    The ID of the run created.

put_projects(id, project_id)

Add a Table to a project

Parameters
idinteger

The ID of the Table.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_tags(id, table_tag_id)

Add a tag to a table

Parameters
idinteger

The ID of the table.

table_tag_idinteger

The ID of the tag.

Returns
civis.response.Response
  • idinteger

    The ID of the table.

  • table_tag_idinteger

    The ID of the tag.

Templates
class Templates(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.templates.list_reports_shares(...)

Methods

delete_reports_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_reports_shares_users(id, user_id)

Revoke the permissions a user has on this object

delete_scripts_projects(id, project_id)

Remove a Script Template from a project

delete_scripts_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_scripts_shares_users(id, user_id)

Revoke the permissions a user has on this object

get_reports(id)

Get a Report Template

get_scripts(id)

Get a Script Template

list_reports(*[, hidden, author, category, ...])

List Report Templates

list_reports_dependencies(id, *[, user_id])

List dependent objects for this object

list_reports_shares(id)

List users and groups permissioned on this object

list_scripts(*[, hidden, author, category, ...])

List Script Templates

list_scripts_dependencies(id, *[, user_id])

List dependent objects for this object

list_scripts_projects(id, *[, hidden])

List the projects a Script Template belongs to

list_scripts_shares(id)

List users and groups permissioned on this object

patch_reports(id, *[, name, category, ...])

Update some attributes of this Report Template

patch_scripts(id, *[, name, note, ...])

Update some attributes of this Script Template

post_reports(name, code_body, *[, category, ...])

Create a Report Template

post_reports_review(id, status)

Review a template for security vulnerability and correctness (admin-only)

post_scripts(script_id, name, *[, note, ...])

Create a Script Template

post_scripts_review(id, status)

Review a template for security vulnerability and correctness (admin-only)

put_reports(id, name, code_body, *[, ...])

Replace all attributes of this Report Template

put_reports_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_reports_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_reports_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

put_scripts(id, name, *[, note, ...])

Replace all attributes of this Script Template

put_scripts_projects(id, project_id)

Add a Script Template to a project

put_scripts_shares_groups(id, group_ids, ...)

Set the permissions groups has on this object

put_scripts_shares_users(id, user_ids, ...)

Set the permissions users have on this object

put_scripts_transfer(id, user_id, ...[, ...])

Transfer ownership of this object to another user

delete_reports_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_reports_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

delete_scripts_projects(id, project_id)

Remove a Script Template from a project

Parameters
idinteger

The ID of the Script Template.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_scripts_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_scripts_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get_reports(id)

Get a Report Template

Parameters
idinteger
Returns
civis.response.Response
  • id : integer

  • namestring

    The name of the template.

  • categorystring

    The category of this report template. Can be left blank. Acceptable values are: dataset-viz

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • archivedboolean

    Whether the template has been archived.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auth_code_urlstring

    A URL to the template’s stored code body.

  • provide_api_keyboolean

    Whether reports based on this template request an API Key from the report viewer.

  • hiddenboolean

    The hidden status of the item.

get_scripts(id)

Get a Script Template

Parameters
idinteger
Returns
civis.response.Response
  • id : integer

  • publicboolean

    If the template is public or not.

  • script_idinteger

    The id of the script that this template uses.

  • script_typestring

    The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)

  • user_contextstring

    The user context of the script that this template uses.

  • paramslist::

    A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • namestring

    The name of the template.

  • categorystring

    The category of this template.

  • notestring

    A note describing what this template is used for; custom scripts created off this template will display this description.

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • ui_report_idinteger

    The id of the report that this template uses.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • archivedboolean

    Whether the template has been archived.

  • hiddenboolean

    The hidden status of the item.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

list_reports(*, hidden='DEFAULT', author='DEFAULT', category='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Report Templates

Parameters
hiddenboolean, optional

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

authorstring, optional

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

categorystring, optional

A category to filter results by, one of: dataset-viz

limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • id : integer

  • namestring

    The name of the template.

  • categorystring

    The category of this report template. Can be left blank. Acceptable values are: dataset-viz

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • archivedboolean

    Whether the template has been archived.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

list_reports_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_reports_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

list_scripts(*, hidden='DEFAULT', author='DEFAULT', category='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Script Templates

Parameters
hiddenboolean, optional

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

authorstring, optional

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

categorystring, optional

A category to filter results by, one of: import, export, enhancement, model, and script

limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • id : integer

  • publicboolean

    If the template is public or not.

  • script_idinteger

    The id of the script that this template uses.

  • user_contextstring

    The user context of the script that this template uses.

  • namestring

    The name of the template.

  • categorystring

    The category of this template.

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • ui_report_idinteger

    The id of the report that this template uses.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • archivedboolean

    Whether the template has been archived.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

list_scripts_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_scripts_projects(id, *, hidden='DEFAULT')

List the projects a Script Template belongs to

Parameters
idinteger

The ID of the Script Template.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_scripts_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch_reports(id, *, name='DEFAULT', category='DEFAULT', archived='DEFAULT', code_body='DEFAULT', provide_api_key='DEFAULT')

Update some attributes of this Report Template

Parameters
idinteger
namestring, optional

The name of the template.

categorystring, optional

The category of this report template. Can be left blank. Acceptable values are: dataset-viz

archivedboolean, optional

Whether the template has been archived.

code_bodystring, optional

The code for the Template body.

provide_api_keyboolean, optional

Whether reports based on this template request an API Key from the report viewer.

Returns
civis.response.Response
  • id : integer

  • namestring

    The name of the template.

  • categorystring

    The category of this report template. Can be left blank. Acceptable values are: dataset-viz

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • archivedboolean

    Whether the template has been archived.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auth_code_urlstring

    A URL to the template’s stored code body.

  • provide_api_keyboolean

    Whether reports based on this template request an API Key from the report viewer.

  • hiddenboolean

    The hidden status of the item.

patch_scripts(id, *, name='DEFAULT', note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT')

Update some attributes of this Script Template

Parameters
idinteger
namestring, optional

The name of the template.

notestring, optional

A note describing what this template is used for; custom scripts created off this template will display this description.

ui_report_idinteger, optional

The id of the report that this template uses.

archivedboolean, optional

Whether the template has been archived.

Returns
civis.response.Response
  • id : integer

  • publicboolean

    If the template is public or not.

  • script_idinteger

    The id of the script that this template uses.

  • script_typestring

    The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)

  • user_contextstring

    The user context of the script that this template uses.

  • paramslist::

    A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • namestring

    The name of the template.

  • categorystring

    The category of this template.

  • notestring

    A note describing what this template is used for; custom scripts created off this template will display this description.

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • ui_report_idinteger

    The id of the report that this template uses.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • archivedboolean

    Whether the template has been archived.

  • hiddenboolean

    The hidden status of the item.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

post_reports(name, code_body, *, category='DEFAULT', archived='DEFAULT', provide_api_key='DEFAULT', hidden='DEFAULT')

Create a Report Template

Parameters
namestring

The name of the template.

code_bodystring

The code for the Template body.

categorystring, optional

The category of this report template. Can be left blank. Acceptable values are: dataset-viz

archivedboolean, optional

Whether the template has been archived.

provide_api_keyboolean, optional

Whether reports based on this template request an API Key from the report viewer.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • id : integer

  • namestring

    The name of the template.

  • categorystring

    The category of this report template. Can be left blank. Acceptable values are: dataset-viz

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • archivedboolean

    Whether the template has been archived.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auth_code_urlstring

    A URL to the template’s stored code body.

  • provide_api_keyboolean

    Whether reports based on this template request an API Key from the report viewer.

  • hiddenboolean

    The hidden status of the item.

post_reports_review(id, status)

Review a template for security vulnerability and correctness (admin-only)

Parameters
idinteger

The ID of the item.

statusboolean

Whether this item has been reviewed.

Returns
civis.response.Response
  • id : integer

  • namestring

    The name of the template.

  • categorystring

    The category of this report template. Can be left blank. Acceptable values are: dataset-viz

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • archivedboolean

    Whether the template has been archived.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auth_code_urlstring

    A URL to the template’s stored code body.

  • provide_api_keyboolean

    Whether reports based on this template request an API Key from the report viewer.

  • hiddenboolean

    The hidden status of the item.

post_scripts(script_id, name, *, note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT', hidden='DEFAULT')

Create a Script Template

Parameters
script_idinteger

The id of the script that this template uses.

namestring

The name of the template.

notestring, optional

A note describing what this template is used for; custom scripts created off this template will display this description.

ui_report_idinteger, optional

The id of the report that this template uses.

archivedboolean, optional

Whether the template has been archived.

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • id : integer

  • publicboolean

    If the template is public or not.

  • script_idinteger

    The id of the script that this template uses.

  • script_typestring

    The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)

  • user_contextstring

    The user context of the script that this template uses.

  • paramslist::

    A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • namestring

    The name of the template.

  • categorystring

    The category of this template.

  • notestring

    A note describing what this template is used for; custom scripts created off this template will display this description.

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • ui_report_idinteger

    The id of the report that this template uses.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • archivedboolean

    Whether the template has been archived.

  • hiddenboolean

    The hidden status of the item.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

post_scripts_review(id, status)

Review a template for security vulnerability and correctness (admin-only)

Parameters
idinteger

The ID of the item.

statusboolean

Whether this item has been reviewed.

Returns
civis.response.Response
  • id : integer

  • publicboolean

    If the template is public or not.

  • script_idinteger

    The id of the script that this template uses.

  • script_typestring

    The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)

  • user_contextstring

    The user context of the script that this template uses.

  • paramslist::

    A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • namestring

    The name of the template.

  • categorystring

    The category of this template.

  • notestring

    A note describing what this template is used for; custom scripts created off this template will display this description.

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • ui_report_idinteger

    The id of the report that this template uses.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • archivedboolean

    Whether the template has been archived.

  • hiddenboolean

    The hidden status of the item.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

put_reports(id, name, code_body, *, category='DEFAULT', archived='DEFAULT', provide_api_key='DEFAULT')

Replace all attributes of this Report Template

Parameters
idinteger
namestring

The name of the template.

code_bodystring

The code for the Template body.

categorystring, optional

The category of this report template. Can be left blank. Acceptable values are: dataset-viz

archivedboolean, optional

Whether the template has been archived.

provide_api_keyboolean, optional

Whether reports based on this template request an API Key from the report viewer.

Returns
civis.response.Response
  • id : integer

  • namestring

    The name of the template.

  • categorystring

    The category of this report template. Can be left blank. Acceptable values are: dataset-viz

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • archivedboolean

    Whether the template has been archived.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auth_code_urlstring

    A URL to the template’s stored code body.

  • provide_api_keyboolean

    Whether reports based on this template request an API Key from the report viewer.

  • hiddenboolean

    The hidden status of the item.

put_reports_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_reports_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_reports_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

put_scripts(id, name, *, note='DEFAULT', ui_report_id='DEFAULT', archived='DEFAULT')

Replace all attributes of this Script Template

Parameters
idinteger
namestring

The name of the template.

notestring, optional

A note describing what this template is used for; custom scripts created off this template will display this description.

ui_report_idinteger, optional

The id of the report that this template uses.

archivedboolean, optional

Whether the template has been archived.

Returns
civis.response.Response
  • id : integer

  • publicboolean

    If the template is public or not.

  • script_idinteger

    The id of the script that this template uses.

  • script_typestring

    The type of the template’s backing script (e.g SQL, Container, Python, R, JavaScript)

  • user_contextstring

    The user context of the script that this template uses.

  • paramslist::

    A definition of the parameters that this template’s backing script accepts in the arguments field. - name : string

    The variable’s name as used within your code.

    • labelstring

      The label to present to users when asking them for the value.

    • descriptionstring

      A short sentence or fragment describing this parameter to the end user.

    • typestring

      The type of parameter. Valid options: string, multi_line_string, integer, float, bool, file, table, database, credential_aws, credential_redshift, or credential_custom

    • requiredboolean

      Whether this param is required.

    • valuestring

      The value you would like to set this param to. Setting this value makes this parameter a fixed param.

    • defaultstring

      If an argument for this parameter is not defined, it will use this default value. Use true, True, t, y, yes, or 1 for true bool’s or false, False, f, n, no, or 0 for false bool’s. Cannot be used for parameters that are required or a credential type.

    • allowed_valueslist

      The possible values this parameter can take, effectively making this an enumerable parameter. Allowed values is an array of hashes of the following format: {label: ‘Import’, ‘value’: ‘import’}

  • namestring

    The name of the template.

  • categorystring

    The category of this template.

  • notestring

    A note describing what this template is used for; custom scripts created off this template will display this description.

  • created_at : string/time

  • updated_at : string/time

  • use_countinteger

    The number of uses of this template.

  • ui_report_idinteger

    The id of the report that this template uses.

  • tech_reviewedboolean

    Whether this template has been audited by Civis for security vulnerability and correctness.

  • archivedboolean

    Whether the template has been archived.

  • hiddenboolean

    The hidden status of the item.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

put_scripts_projects(id, project_id)

Add a Script Template to a project

Parameters
idinteger

The ID of the Script Template.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_scripts_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_scripts_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_scripts_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Users
class Users(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.users.list(...)

Methods

delete_api_keys(id, key_id)

Revoke the specified API key

delete_me_favorites(id)

Unfavorite an item

delete_me_superadmin()

Disables Superadmin Mode for the current user

delete_sessions(id)

Terminate all of the user's active sessions (must be an admin or client user admin)

get(id)

Show info about a user

get_api_keys(id, key_id)

Show the specified API key

list(*[, feature_flag, account_status, ...])

List users

list_api_keys(id, *[, limit, page_num, ...])

Show API keys belonging to the specified user

list_me()

Show info about the logged-in user

list_me_favorites(*[, object_id, ...])

List Favorites

list_me_ui()

UI configuration for logged-in user

patch(id, *[, name, email, active, ...])

Update info about a user (must be an admin or client user admin)

patch_me(*[, preferences, ...])

Update info about the logged-in user

post(name, email, primary_group_id, user, *)

Create a new user (must be an admin or client user admin)

post_api_keys(id, expires_in, name, *[, ...])

Create a new API key belonging to the logged-in user

post_me_favorites(object_id, object_type)

Favorite an item

post_me_superadmin()

Enables Superadmin Mode for the current user

post_unsuspend(id)

Unsuspends user

delete_api_keys(id, key_id)

Revoke the specified API key

Parameters
idstring

The ID of the user or ‘me’.

key_idinteger

The ID of the API key.

Returns
civis.response.Response
  • idinteger

    The ID of the API key.

  • namestring

    The name of the API key.

  • expires_atstring/date-time

    The date and time when the key expired.

  • created_atstring/date-time

    The date and time when the key was created.

  • revoked_atstring/date-time

    The date and time when the key was revoked.

  • last_used_atstring/date-time

    The date and time when the key was last used.

  • scopeslist

    The scopes which the key is permissioned on.

  • use_countinteger

    The number of times the key has been used.

  • expiredboolean

    True if the key has expired.

  • activeboolean

    True if the key has neither expired nor been revoked.

  • constraintslist::

    Constraints on the abilities of the created key - constraint : string

    The path matcher of the constraint.

    • constraint_typestring

      The type of constraint (exact/prefix/regex/verb).

    • get_allowedboolean

      Whether the constraint allows GET requests.

    • head_allowedboolean

      Whether the constraint allows HEAD requests.

    • post_allowedboolean

      Whether the constraint allows POST requests.

    • put_allowedboolean

      Whether the constraint allows PUT requests.

    • patch_allowedboolean

      Whether the constraint allows PATCH requests.

    • delete_allowedboolean

      Whether the constraint allows DELETE requests.

delete_me_favorites(id)

Unfavorite an item

Parameters
idinteger

The id of the favorite.

Returns
None

Response code 204: success

delete_me_superadmin()

Disables Superadmin Mode for the current user

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • namestring

    This user’s name.

  • emailstring

    This user’s email address.

  • usernamestring

    This user’s username.

  • initialsstring

    This user’s initials.

  • last_checked_announcementsstring/date-time

    The date and time at which the user last checked their announcements.

  • feature_flagsdict

    The feature flag settings for this user.

  • roleslist

    The roles this user has, listed by slug.

  • preferencesdict

    This user’s preferences.

  • custom_brandingstring

    The branding of Platform for this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • organization_namestring

    The name of the organization the user belongs to.

  • organization_slugstring

    The slug of the organization the user belongs to.

  • organization_default_theme_idinteger

    The ID of the organizations’s default theme.

  • created_atstring/date-time

    The date and time when the user was created.

  • sign_in_countinteger

    The number of times the user has signed in.

  • assuming_roleboolean

    Whether the user is assuming a role or not.

  • assuming_adminboolean

    Whether the user is assuming admin.

  • assuming_admin_expirationstring/date-time

    When the user’s admin role is set to expire.

  • superadmin_mode_expirationstring/date-time

    The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.

  • disable_non_compliant_fedramp_featuresboolean

    Whether to disable non-compliant fedramp features.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

delete_sessions(id)

Terminate all of the user’s active sessions (must be an admin or client user admin)

Parameters
idinteger

The ID of this user.

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • userstring

    The username of this user.

  • namestring

    The name of this user.

  • emailstring

    The email of this user.

  • activeboolean

    The account status of this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • citystring

    The city of this user.

  • statestring

    The state of this user.

  • time_zonestring

    The time zone of this user.

  • initialsstring

    The initials of this user.

  • departmentstring

    The department of this user.

  • titlestring

    The title of this user.

  • github_usernamestring

    The GitHub username of this user.

  • prefers_sms_otpboolean

    The preference for phone authorization of this user

  • vpn_enabledboolean

    The availability of vpn for this user.

  • sso_disabledboolean

    The availability of SSO for this user.

  • otp_required_for_loginboolean

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledboolean

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedboolean

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotboolean

    Whether the user is a robot.

  • phonestring

    The phone number of this user.

  • organization_slugstring

    The slug of the organization the user belongs to.

  • organization_sso_disable_capableboolean

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestring

    The user’s organization’s login type.

  • organization_sms_otp_disabledboolean

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstring/date-time

    The date and time when the user was created.

  • updated_atstring/date-time

    The date and time when the user was last updated.

  • last_seen_atstring/date-time

    The date and time when the user last visited Platform.

  • suspendedboolean

    Whether the user is suspended due to inactivity.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

get(id)

Show info about a user

Parameters
idinteger

The ID of this user.

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • userstring

    The username of this user.

  • namestring

    The name of this user.

  • emailstring

    The email of this user.

  • activeboolean

    The account status of this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • citystring

    The city of this user.

  • statestring

    The state of this user.

  • time_zonestring

    The time zone of this user.

  • initialsstring

    The initials of this user.

  • departmentstring

    The department of this user.

  • titlestring

    The title of this user.

  • github_usernamestring

    The GitHub username of this user.

  • prefers_sms_otpboolean

    The preference for phone authorization of this user

  • vpn_enabledboolean

    The availability of vpn for this user.

  • sso_disabledboolean

    The availability of SSO for this user.

  • otp_required_for_loginboolean

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledboolean

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedboolean

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotboolean

    Whether the user is a robot.

  • phonestring

    The phone number of this user.

  • organization_slugstring

    The slug of the organization the user belongs to.

  • organization_sso_disable_capableboolean

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestring

    The user’s organization’s login type.

  • organization_sms_otp_disabledboolean

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstring/date-time

    The date and time when the user was created.

  • updated_atstring/date-time

    The date and time when the user was last updated.

  • last_seen_atstring/date-time

    The date and time when the user last visited Platform.

  • suspendedboolean

    Whether the user is suspended due to inactivity.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

get_api_keys(id, key_id)

Show the specified API key

Parameters
idstring

The ID of the user or ‘me’.

key_idinteger

The ID of the API key.

Returns
civis.response.Response
  • idinteger

    The ID of the API key.

  • namestring

    The name of the API key.

  • expires_atstring/date-time

    The date and time when the key expired.

  • created_atstring/date-time

    The date and time when the key was created.

  • revoked_atstring/date-time

    The date and time when the key was revoked.

  • last_used_atstring/date-time

    The date and time when the key was last used.

  • scopeslist

    The scopes which the key is permissioned on.

  • use_countinteger

    The number of times the key has been used.

  • expiredboolean

    True if the key has expired.

  • activeboolean

    True if the key has neither expired nor been revoked.

  • constraintslist::

    Constraints on the abilities of the created key - constraint : string

    The path matcher of the constraint.

    • constraint_typestring

      The type of constraint (exact/prefix/regex/verb).

    • get_allowedboolean

      Whether the constraint allows GET requests.

    • head_allowedboolean

      Whether the constraint allows HEAD requests.

    • post_allowedboolean

      Whether the constraint allows POST requests.

    • put_allowedboolean

      Whether the constraint allows PUT requests.

    • patch_allowedboolean

      Whether the constraint allows PATCH requests.

    • delete_allowedboolean

      Whether the constraint allows DELETE requests.

list(*, feature_flag='DEFAULT', account_status='DEFAULT', query='DEFAULT', group_id='DEFAULT', group_ids='DEFAULT', organization_id='DEFAULT', exclude_groups='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List users

Parameters
feature_flagstring, optional

Return users that have a feature flag enabled.

account_statusstring, optional

The account status by which to filter users. May be one of “active”, “inactive”, or “all”. Defaults to active.

querystring, optional

Return users who match the given query, based on name, user, email, and id.

group_idinteger, optional

The ID of the group by which to filter users. Cannot be present if group_ids is.

group_idsarray, optional

The IDs of the groups by which to filter users. Cannot be present if group_id is.

organization_idinteger, optional

The ID of the organization by which to filter users.

exclude_groupsboolean, optional

Whether or to exclude users’ groups. Default: false.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 10000.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of this user.

  • userstring

    The username of this user.

  • namestring

    The name of this user.

  • emailstring

    The email of this user.

  • activeboolean

    The account status of this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • created_atstring/date-time

    The date and time when the user was created.

  • current_sign_in_atstring/date-time

    The date and time when the user’s current session began.

  • updated_atstring/date-time

    The date and time when the user was last updated.

  • last_seen_atstring/date-time

    The date and time when the user last visited Platform.

  • suspendedboolean

    Whether the user is suspended due to inactivity.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

list_api_keys(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

Show API keys belonging to the specified user

Parameters
idstring

The ID of the user or ‘me’.

limitinteger, optional

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

page_numinteger, optional

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

orderstring, optional

The field on which to order the result set. Defaults to id. Must be one of: id.

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID of the API key.

  • namestring

    The name of the API key.

  • expires_atstring/date-time

    The date and time when the key expired.

  • created_atstring/date-time

    The date and time when the key was created.

  • revoked_atstring/date-time

    The date and time when the key was revoked.

  • last_used_atstring/date-time

    The date and time when the key was last used.

  • scopeslist

    The scopes which the key is permissioned on.

  • use_countinteger

    The number of times the key has been used.

  • expiredboolean

    True if the key has expired.

  • activeboolean

    True if the key has neither expired nor been revoked.

  • constraint_countinteger

    The number of constraints on the created key

list_me()

Show info about the logged-in user

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • namestring

    This user’s name.

  • emailstring

    This user’s email address.

  • usernamestring

    This user’s username.

  • initialsstring

    This user’s initials.

  • last_checked_announcementsstring/date-time

    The date and time at which the user last checked their announcements.

  • feature_flagsdict

    The feature flag settings for this user.

  • roleslist

    The roles this user has, listed by slug.

  • preferencesdict

    This user’s preferences.

  • custom_brandingstring

    The branding of Platform for this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • organization_namestring

    The name of the organization the user belongs to.

  • organization_slugstring

    The slug of the organization the user belongs to.

  • organization_default_theme_idinteger

    The ID of the organizations’s default theme.

  • created_atstring/date-time

    The date and time when the user was created.

  • sign_in_countinteger

    The number of times the user has signed in.

  • assuming_roleboolean

    Whether the user is assuming a role or not.

  • assuming_adminboolean

    Whether the user is assuming admin.

  • assuming_admin_expirationstring/date-time

    When the user’s admin role is set to expire.

  • superadmin_mode_expirationstring/date-time

    The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.

  • disable_non_compliant_fedramp_featuresboolean

    Whether to disable non-compliant fedramp features.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

list_me_favorites(*, object_id='DEFAULT', object_type='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Favorites

Parameters
object_idinteger, optional

The id of the object. If specified as a query parameter, must also specify object_type parameter.

object_typestring, optional

The type of the object that is favorited. Valid options: Project

limitinteger, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The id of the favorite.

  • object_idinteger

    The id of the object. If specified as a query parameter, must also specify object_type parameter.

  • object_typestring

    The type of the object that is favorited. Valid options: Project

  • object_namestring

    The name of the object that is favorited.

  • created_atstring/time

    The time this favorite was created.

list_me_ui()

UI configuration for logged-in user

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • navigation_menusdict

    Navigation menus visible to this user.

  • user_menusdict

    User profile menu items available to this user.

  • user_typedict::
    • vendorboolean

      This attribute is deprecated

    • mediaboolean

      True if user has access to the Media Optimizer job type.

    • main_appstring

      This attribute is deprecated

    • app_countinteger

      This attribute is deprecated

    • reports_onlyboolean

      True if user is a reports-only user.

    • reports_creatorboolean

      True if this user is allowed to create HTML reports.

  • zendesk_tokenstring

    JSON web token for this user’s Zendesk widget.

patch(id, *, name='DEFAULT', email='DEFAULT', active='DEFAULT', primary_group_id='DEFAULT', city='DEFAULT', state='DEFAULT', time_zone='DEFAULT', initials='DEFAULT', department='DEFAULT', title='DEFAULT', prefers_sms_otp='DEFAULT', group_ids='DEFAULT', vpn_enabled='DEFAULT', sso_disabled='DEFAULT', otp_required_for_login='DEFAULT', exempt_from_org_sms_otp_disabled='DEFAULT', robot='DEFAULT', phone='DEFAULT', password='DEFAULT')

Update info about a user (must be an admin or client user admin)

Parameters
idinteger

The ID of this user.

namestring, optional

The name of this user.

emailstring, optional

The email of this user.

activeboolean, optional

The account status of this user.

primary_group_idinteger, optional

The ID of the primary group of this user.

citystring, optional

The city of this user.

statestring, optional

The state of this user.

time_zonestring, optional

The time zone of this user.

initialsstring, optional

The initials of this user.

departmentstring, optional

The department of this user.

titlestring, optional

The title of this user.

prefers_sms_otpboolean, optional

The preference for phone authorization of this user

group_idslist, optional

An array of ids of all the groups this user is in.

vpn_enabledboolean, optional

The availability of vpn for this user.

sso_disabledboolean, optional

The availability of SSO for this user.

otp_required_for_loginboolean, optional

The two factor authentication requirement for this user.

exempt_from_org_sms_otp_disabledboolean, optional

Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

robotboolean, optional

Whether the user is a robot.

phonestring, optional

The phone number of this user.

passwordstring, optional

The password of this user.

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • userstring

    The username of this user.

  • namestring

    The name of this user.

  • emailstring

    The email of this user.

  • activeboolean

    The account status of this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • citystring

    The city of this user.

  • statestring

    The state of this user.

  • time_zonestring

    The time zone of this user.

  • initialsstring

    The initials of this user.

  • departmentstring

    The department of this user.

  • titlestring

    The title of this user.

  • github_usernamestring

    The GitHub username of this user.

  • prefers_sms_otpboolean

    The preference for phone authorization of this user

  • vpn_enabledboolean

    The availability of vpn for this user.

  • sso_disabledboolean

    The availability of SSO for this user.

  • otp_required_for_loginboolean

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledboolean

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedboolean

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotboolean

    Whether the user is a robot.

  • phonestring

    The phone number of this user.

  • organization_slugstring

    The slug of the organization the user belongs to.

  • organization_sso_disable_capableboolean

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestring

    The user’s organization’s login type.

  • organization_sms_otp_disabledboolean

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstring/date-time

    The date and time when the user was created.

  • updated_atstring/date-time

    The date and time when the user was last updated.

  • last_seen_atstring/date-time

    The date and time when the user last visited Platform.

  • suspendedboolean

    Whether the user is suspended due to inactivity.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

patch_me(*, preferences='DEFAULT', last_checked_announcements='DEFAULT')

Update info about the logged-in user

Parameters
preferencesdict, optional::
  • app_index_order_fieldstring

    This attribute is deprecated

  • app_index_order_dirstring

    This attribute is deprecated

  • result_index_order_fieldstring

    Order field for the results index page.

  • result_index_order_dirstring

    Order direction for the results index page.

  • result_index_type_filterstring

    Type filter for the results index page.

  • result_index_author_filterstring

    Author filter for the results index page.

  • result_index_archived_filterstring

    Archived filter for the results index page.

  • import_index_order_fieldstring

    Order field for the imports index page.

  • import_index_order_dirstring

    Order direction for the imports index page.

  • import_index_type_filterstring

    Type filter for the imports index page.

  • import_index_author_filterstring

    Author filter for the imports index page.

  • import_index_dest_filterstring

    Destination filter for the imports index page.

  • import_index_status_filterstring

    Status filter for the imports index page.

  • import_index_archived_filterstring

    Archived filter for the imports index page.

  • export_index_order_fieldstring

    Order field for the exports index page.

  • export_index_order_dirstring

    Order direction for the exports index page.

  • export_index_type_filterstring

    Type filter for the exports index page.

  • export_index_author_filterstring

    Author filter for the exports index page.

  • export_index_status_filterstring

    Status filter for the exports index page.

  • model_index_order_fieldstring

    Order field for the models index page.

  • model_index_order_dirstring

    Order direction for the models index page.

  • model_index_author_filterstring

    Author filter for the models index page.

  • model_index_status_filterstring

    Status filter for the models index page.

  • model_index_archived_filterstring

    Archived filter for the models index page.

  • model_index_thumbnail_viewstring

    Thumbnail view for the models index page.

  • script_index_order_fieldstring

    Order field for the scripts index page.

  • script_index_order_dirstring

    Order direction for the scripts index page.

  • script_index_type_filterstring

    Type filter for the scripts index page.

  • script_index_author_filterstring

    Author filter for the scripts index page.

  • script_index_status_filterstring

    Status filter for the scripts index page.

  • script_index_archived_filterstring

    Archived filter for the scripts index page.

  • project_index_order_fieldstring

    Order field for the projects index page.

  • project_index_order_dirstring

    Order direction for the projects index page.

  • project_index_author_filterstring

    Author filter for the projects index page.

  • project_index_archived_filterstring

    Archived filter for the projects index page.

  • report_index_thumbnail_viewstring

    Thumbnail view for the reports index page.

  • project_detail_order_fieldstring

    Order field for projects detail pages.

  • project_detail_order_dirstring

    Order direction for projects detail pages.

  • project_detail_author_filterstring

    Author filter for projects detail pages.

  • project_detail_type_filterstring

    Type filter for projects detail pages.

  • project_detail_archived_filterstring

    Archived filter for the projects detail pages.

  • enhancement_index_order_fieldstring

    Order field for the enhancements index page.

  • enhancement_index_order_dirstring

    Order direction for the enhancements index page.

  • enhancement_index_author_filterstring

    Author filter for the enhancements index page.

  • enhancement_index_archived_filterstring

    Archived filter for the enhancements index page.

  • preferred_server_idinteger

    ID of preferred server.

  • civis_explore_skip_introboolean

    Whether the user is shown steps for each exploration.

  • registration_index_order_fieldstring

    Order field for the registrations index page.

  • registration_index_order_dirstring

    Order direction for the registrations index page.

  • registration_index_status_filterstring

    Status filter for the registrations index page.

  • upgrade_requestedstring

    Whether a free trial upgrade has been requested.

  • welcome_order_fieldstring

    Order direction for the welcome page.

  • welcome_order_dirstring

    Order direction for the welcome page.

  • welcome_author_filterstring

    Status filter for the welcome page.

  • welcome_status_filterstring

    Status filter for the welcome page.

  • welcome_archived_filterstring

    Status filter for the welcome page.

  • data_pane_widthstring

    Width of the data pane when expanded.

  • data_pane_collapsedstring

    Whether the data pane is collapsed.

  • notebook_order_fieldstring

    Order field for the notebooks page.

  • notebook_order_dirstring

    Order direction for the notebooks page.

  • notebook_author_filterstring

    Author filter for the notebooks page.

  • notebook_archived_filterstring

    Archived filter for the notebooks page.

  • notebook_status_filterstring

    Status filter for the notebooks page.

  • workflow_index_order_fieldstring

    Order field for the workflows page.

  • workflow_index_order_dirstring

    Order direction for the workflows page.

  • workflow_index_author_filterstring

    Author filter for the workflows page.

  • workflow_index_archived_filterstring

    Archived filter for the workflows page.

  • service_order_fieldstring

    Order field for the services page.

  • service_order_dirstring

    Order direction for the services page.

  • service_author_filterstring

    Author filter for the services page.

  • service_archived_filterstring

    Archived filter for the services page.

  • assume_role_historystring

    JSON string of previously assumed roles.

last_checked_announcementsstring/date-time, optional

The date and time at which the user last checked their announcements.

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • namestring

    This user’s name.

  • emailstring

    This user’s email address.

  • usernamestring

    This user’s username.

  • initialsstring

    This user’s initials.

  • last_checked_announcementsstring/date-time

    The date and time at which the user last checked their announcements.

  • feature_flagsdict

    The feature flag settings for this user.

  • roleslist

    The roles this user has, listed by slug.

  • preferencesdict

    This user’s preferences.

  • custom_brandingstring

    The branding of Platform for this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • organization_namestring

    The name of the organization the user belongs to.

  • organization_slugstring

    The slug of the organization the user belongs to.

  • organization_default_theme_idinteger

    The ID of the organizations’s default theme.

  • created_atstring/date-time

    The date and time when the user was created.

  • sign_in_countinteger

    The number of times the user has signed in.

  • assuming_roleboolean

    Whether the user is assuming a role or not.

  • assuming_adminboolean

    Whether the user is assuming admin.

  • assuming_admin_expirationstring/date-time

    When the user’s admin role is set to expire.

  • superadmin_mode_expirationstring/date-time

    The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.

  • disable_non_compliant_fedramp_featuresboolean

    Whether to disable non-compliant fedramp features.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

post(name, email, primary_group_id, user, *, active='DEFAULT', city='DEFAULT', state='DEFAULT', time_zone='DEFAULT', initials='DEFAULT', department='DEFAULT', title='DEFAULT', prefers_sms_otp='DEFAULT', group_ids='DEFAULT', vpn_enabled='DEFAULT', sso_disabled='DEFAULT', otp_required_for_login='DEFAULT', exempt_from_org_sms_otp_disabled='DEFAULT', robot='DEFAULT', send_email='DEFAULT')

Create a new user (must be an admin or client user admin)

Parameters
namestring

The name of this user.

emailstring

The email of this user.

primary_group_idinteger

The ID of the primary group of this user.

userstring

The username of this user.

activeboolean, optional

The account status of this user.

citystring, optional

The city of this user.

statestring, optional

The state of this user.

time_zonestring, optional

The time zone of this user.

initialsstring, optional

The initials of this user.

departmentstring, optional

The department of this user.

titlestring, optional

The title of this user.

prefers_sms_otpboolean, optional

The preference for phone authorization of this user

group_idslist, optional

An array of ids of all the groups this user is in.

vpn_enabledboolean, optional

The availability of vpn for this user.

sso_disabledboolean, optional

The availability of SSO for this user.

otp_required_for_loginboolean, optional

The two factor authentication requirement for this user.

exempt_from_org_sms_otp_disabledboolean, optional

Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

robotboolean, optional

Whether the user is a robot.

send_emailboolean, optional

Whether the user will receive a welcome email.

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • userstring

    The username of this user.

  • namestring

    The name of this user.

  • emailstring

    The email of this user.

  • activeboolean

    The account status of this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • citystring

    The city of this user.

  • statestring

    The state of this user.

  • time_zonestring

    The time zone of this user.

  • initialsstring

    The initials of this user.

  • departmentstring

    The department of this user.

  • titlestring

    The title of this user.

  • github_usernamestring

    The GitHub username of this user.

  • prefers_sms_otpboolean

    The preference for phone authorization of this user

  • vpn_enabledboolean

    The availability of vpn for this user.

  • sso_disabledboolean

    The availability of SSO for this user.

  • otp_required_for_loginboolean

    The two factor authentication requirement for this user.

  • exempt_from_org_sms_otp_disabledboolean

    Whether the user has SMS OTP enabled on an individual level. This field does not matter if the org does not have SMS OTP disabled.

  • sms_otp_allowedboolean

    Whether the user is allowed to receive two factor authentication codes via SMS.

  • robotboolean

    Whether the user is a robot.

  • phonestring

    The phone number of this user.

  • organization_slugstring

    The slug of the organization the user belongs to.

  • organization_sso_disable_capableboolean

    The user’s organization’s ability to disable sso for their users.

  • organization_login_typestring

    The user’s organization’s login type.

  • organization_sms_otp_disabledboolean

    Whether the user’s organization has SMS OTP disabled.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_atstring/date-time

    The date and time when the user was created.

  • updated_atstring/date-time

    The date and time when the user was last updated.

  • last_seen_atstring/date-time

    The date and time when the user last visited Platform.

  • suspendedboolean

    Whether the user is suspended due to inactivity.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

post_api_keys(id, expires_in, name, *, constraints='DEFAULT')

Create a new API key belonging to the logged-in user

Parameters
idstring

The ID of the user or ‘me’.

expires_ininteger

The number of seconds the key should last for.

namestring

The name of the API key.

constraintslist, optional::

Constraints on the abilities of the created key. - constraint : string

The path matcher of the constraint.

  • constraint_typestring

    The type of constraint (exact/prefix/regex/verb).

  • get_allowedboolean

    Whether the constraint allows GET requests.

  • head_allowedboolean

    Whether the constraint allows HEAD requests.

  • post_allowedboolean

    Whether the constraint allows POST requests.

  • put_allowedboolean

    Whether the constraint allows PUT requests.

  • patch_allowedboolean

    Whether the constraint allows PATCH requests.

  • delete_allowedboolean

    Whether the constraint allows DELETE requests.

Returns
civis.response.Response
  • idinteger

    The ID of the API key.

  • namestring

    The name of the API key.

  • expires_atstring/date-time

    The date and time when the key expired.

  • created_atstring/date-time

    The date and time when the key was created.

  • revoked_atstring/date-time

    The date and time when the key was revoked.

  • last_used_atstring/date-time

    The date and time when the key was last used.

  • scopeslist

    The scopes which the key is permissioned on.

  • use_countinteger

    The number of times the key has been used.

  • expiredboolean

    True if the key has expired.

  • activeboolean

    True if the key has neither expired nor been revoked.

  • constraintslist::

    Constraints on the abilities of the created key - constraint : string

    The path matcher of the constraint.

    • constraint_typestring

      The type of constraint (exact/prefix/regex/verb).

    • get_allowedboolean

      Whether the constraint allows GET requests.

    • head_allowedboolean

      Whether the constraint allows HEAD requests.

    • post_allowedboolean

      Whether the constraint allows POST requests.

    • put_allowedboolean

      Whether the constraint allows PUT requests.

    • patch_allowedboolean

      Whether the constraint allows PATCH requests.

    • delete_allowedboolean

      Whether the constraint allows DELETE requests.

  • tokenstring

    The API key.

post_me_favorites(object_id, object_type)

Favorite an item

Parameters
object_idinteger

The id of the object. If specified as a query parameter, must also specify object_type parameter.

object_typestring

The type of the object that is favorited. Valid options: Project

Returns
civis.response.Response
  • idinteger

    The id of the favorite.

  • object_idinteger

    The id of the object. If specified as a query parameter, must also specify object_type parameter.

  • object_typestring

    The type of the object that is favorited. Valid options: Project

  • object_namestring

    The name of the object that is favorited.

  • created_atstring/time

    The time this favorite was created.

post_me_superadmin()

Enables Superadmin Mode for the current user

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • namestring

    This user’s name.

  • emailstring

    This user’s email address.

  • usernamestring

    This user’s username.

  • initialsstring

    This user’s initials.

  • last_checked_announcementsstring/date-time

    The date and time at which the user last checked their announcements.

  • feature_flagsdict

    The feature flag settings for this user.

  • roleslist

    The roles this user has, listed by slug.

  • preferencesdict

    This user’s preferences.

  • custom_brandingstring

    The branding of Platform for this user.

  • primary_group_idinteger

    The ID of the primary group of this user.

  • groupslist::

    An array of all the groups this user is in. - id : integer

    The ID of this group.

    • namestring

      The name of this group.

    • organization_idinteger

      The ID of the organization associated with this group.

    • organization_namestring

      The name of the organization associated with this group.

  • organization_namestring

    The name of the organization the user belongs to.

  • organization_slugstring

    The slug of the organization the user belongs to.

  • organization_default_theme_idinteger

    The ID of the organizations’s default theme.

  • created_atstring/date-time

    The date and time when the user was created.

  • sign_in_countinteger

    The number of times the user has signed in.

  • assuming_roleboolean

    Whether the user is assuming a role or not.

  • assuming_adminboolean

    Whether the user is assuming admin.

  • assuming_admin_expirationstring/date-time

    When the user’s admin role is set to expire.

  • superadmin_mode_expirationstring/date-time

    The user is in superadmin mode when set to a DateTime. The user is not in superadmin mode when set to null.

  • disable_non_compliant_fedramp_featuresboolean

    Whether to disable non-compliant fedramp features.

  • created_by_idinteger

    The ID of the user who created this user.

  • last_updated_by_idinteger

    The ID of the user who last updated this user.

post_unsuspend(id)

Unsuspends user

Parameters
idinteger

The ID of this user.

Returns
civis.response.Response
  • idinteger

    The ID of this user.

  • userstring

    The username of this user.

  • unlocked_atstring/date-time

    The time the user’s account was unsuspended

Workflows
class Workflows(session_kwargs, client, return_type='civis')

Examples

>>> import civis
>>> client = civis.APIClient()
>>> client.workflows.list(...)

Methods

delete_projects(id, project_id)

Remove a Workflow from a project

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

get(id)

Get a Workflow

get_executions(id, execution_id)

Get a workflow execution

get_executions_tasks(id, execution_id, task_name)

Get a task of a workflow execution

get_git_commits(id, commit_hash)

Get file contents at git ref

list(*[, hidden, archived, author, state, ...])

List Workflows

list_dependencies(id, *[, user_id])

List dependent objects for this object

list_executions(id, *[, limit, page_num, ...])

List workflow executions

list_git(id)

Get the git metadata attached to an item

list_git_commits(id)

Get the git commits for an item on the current branch

list_projects(id, *[, hidden])

List the projects a Workflow belongs to

list_shares(id)

List users and groups permissioned on this object

patch(id, *[, name, description, ...])

Update some attributes of this Workflow

patch_git(id, *[, git_ref, git_branch, ...])

Update an attached git file

post(name, *[, description, from_job_chain, ...])

Create a Workflow

post_clone(id, *[, clone_schedule, ...])

Clone this Workflow

post_executions(id, *[, target_task, input, ...])

Execute a workflow

post_executions_cancel(id, execution_id)

Cancel a workflow execution

post_executions_resume(id, execution_id)

Resume a paused workflow execution

post_executions_retry(id, execution_id, *[, ...])

Retry a failed task, or all failed tasks in an execution

post_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

post_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

post_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

put(id, name, *[, description, definition, ...])

Replace all attributes of this Workflow

put_archive(id, status)

Update the archive status of this object

put_git(id, *[, git_ref, git_branch, ...])

Attach an item to a file in a git repo

put_projects(id, project_id)

Add a Workflow to a project

put_shares_groups(id, group_ids, ...[, ...])

Set the permissions groups has on this object

put_shares_users(id, user_ids, ...[, ...])

Set the permissions users have on this object

put_transfer(id, user_id, ...[, email_body, ...])

Transfer ownership of this object to another user

delete_projects(id, project_id)

Remove a Workflow from a project

Parameters
idinteger

The ID of the Workflow.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

delete_shares_groups(id, group_id)

Revoke the permissions a group has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idinteger

The ID of the group.

Returns
None

Response code 204: success

delete_shares_users(id, user_id)

Revoke the permissions a user has on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

The ID of the user.

Returns
None

Response code 204: success

get(id)

Get a Workflow

Parameters
idinteger
Returns
civis.response.Response
  • idinteger

    The ID for this workflow.

  • namestring

    The name of this workflow.

  • descriptionstring

    A description of the workflow.

  • definitionstring

    The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

  • validboolean

    The validity of the workflow definition.

  • validation_errorsstring

    The errors encountered when validating the workflow definition.

  • file_idstring

    The file id for the s3 file containing the workflow configuration.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • allow_concurrent_executionsboolean

    Whether the workflow can execute when already running.

  • time_zonestring

    The time zone of this workflow.

  • next_execution_atstring/time

    The time of the next scheduled execution.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on

    • failure_onboolean

      If failure email notifications are on

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_at : string/time

  • updated_at : string/time

get_executions(id, execution_id)

Get a workflow execution

Parameters
idinteger

The ID for the workflow.

execution_idinteger

The ID for the workflow execution.

Returns
civis.response.Response
  • idinteger

    The ID for this workflow execution.

  • statestring

    The state of this workflow execution.

  • mistral_statestring

    The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled

  • mistral_state_infostring

    The state info of this workflow as reported by mistral.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • definitionstring

    The definition of the workflow for this execution.

  • inputdict

    Key-value pairs defined for this execution.

  • included_taskslist

    The subset of workflow tasks selected to execute.

  • taskslist::

    The tasks associated with this execution. - name : string

    The name of the task.

    • mistral_statestring

      The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled

    • mistral_state_infostring

      Extra info associated with the state of the task.

    • runslist::

      The runs associated with this task, in descending order by id. - id : integer

      The ID of the run.

      • job_idinteger

        The ID of the job associated with the run.

      • statestring

        The state of the run.

    • executionslist::

      The executions run by this task, in descending order by id. - id : integer

      The ID of the execution.

      • workflow_idinteger

        The ID of the workflow associated with the execution.

  • started_atstring/time

    The time this execution started.

  • finished_atstring/time

    The time this execution finished.

  • created_atstring/time

    The time this execution was created.

  • updated_atstring/time

    The time this execution was last updated.

get_executions_tasks(id, execution_id, task_name)

Get a task of a workflow execution

Parameters
idinteger

The ID for the workflow.

execution_idinteger

The ID for the workflow execution.

task_namestring

The URL-encoded name of the task.

Returns
civis.response.Response
  • namestring

    The name of the task.

  • mistral_statestring

    The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled

  • mistral_state_infostring

    Extra info associated with the state of the task.

  • runslist::

    The runs associated with this task, in descending order by id. - id : integer

    The ID of the run.

    • job_idinteger

      The ID of the job associated with the run.

    • statestring

      The state of the run.

    • created_atstring/time

      The time that the run was queued.

    • started_atstring/time

      The time that the run started.

    • finished_atstring/time

      The time that the run completed.

  • executionslist::

    The executions run by this task, in descending order by id. - id : integer

    The ID of the execution.

    • workflow_idinteger

      The ID of the workflow associated with the execution.

    • statestring

      The state of this workflow execution.

    • created_atstring/time

      The time this execution was created.

    • started_atstring/time

      The time this execution started.

    • finished_atstring/time

      The time this execution finished.

get_git_commits(id, commit_hash)

Get file contents at git ref

Parameters
idinteger

The ID of the file.

commit_hashstring

The SHA (full or shortened) of the desired git commit.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

list(*, hidden='DEFAULT', archived='DEFAULT', author='DEFAULT', state='DEFAULT', scheduled='DEFAULT', limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List Workflows

Parameters
hiddenboolean, optional

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

archivedstring, optional

The archival status of the requested item(s).

authorstring, optional

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

statearray, optional

State of the most recent execution.One or more of queued, running, succeeded, failed, cancelled, idle, and scheduled.

scheduledboolean, optional

If the workflow is scheduled.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for this workflow.

  • namestring

    The name of this workflow.

  • descriptionstring

    A description of the workflow.

  • validboolean

    The validity of the workflow definition.

  • file_idstring

    The file id for the s3 file containing the workflow configuration.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • allow_concurrent_executionsboolean

    Whether the workflow can execute when already running.

  • time_zonestring

    The time zone of this workflow.

  • next_execution_atstring/time

    The time of the next scheduled execution.

  • archivedstring

    The archival status of the requested item(s).

  • created_at : string/time

  • updated_at : string/time

list_dependencies(id, *, user_id='DEFAULT')

List dependent objects for this object

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger, optional

ID of target user

Returns
civis.response.Response
  • object_typestring

    Dependent object type

  • fco_typestring

    Human readable dependent object type

  • idinteger

    Dependent object ID

  • namestring

    Dependent object name, or nil if the requesting user cannot read this object

  • permission_levelstring

    Permission level of target user (not user’s groups) for dependent object, or null if no target user

  • shareableboolean

    Whether or not the requesting user can share this object.

list_executions(id, *, limit='DEFAULT', page_num='DEFAULT', order='DEFAULT', order_dir='DEFAULT', iterator='DEFAULT')

List workflow executions

Parameters
idinteger

The ID for this workflow.

limitinteger, optional

Number of results to return. Defaults to 20. Maximum allowed is 50.

page_numinteger, optional

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

orderstring, optional

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

order_dirstring, optional

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

iteratorbool, optional

If True, return a generator to iterate over all responses. Use when more results than the maximum allowed by limit are needed. When True, limit and page_num are ignored. Defaults to False.

Returns
civis.response.PaginatedResponse
  • idinteger

    The ID for this workflow execution.

  • statestring

    The state of this workflow execution.

  • mistral_statestring

    The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled

  • mistral_state_infostring

    The state info of this workflow as reported by mistral.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • started_atstring/time

    The time this execution started.

  • finished_atstring/time

    The time this execution finished.

  • created_atstring/time

    The time this execution was created.

  • updated_atstring/time

    The time this execution was last updated.

list_git(id)

Get the git metadata attached to an item

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

list_git_commits(id)

Get the git commits for an item on the current branch

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • commit_hashstring

    The SHA of the commit.

  • author_namestring

    The name of the commit’s author.

  • datestring/time

    The commit’s timestamp.

  • messagestring

    The commit message.

list_projects(id, *, hidden='DEFAULT')

List the projects a Workflow belongs to

Parameters
idinteger

The ID of the Workflow.

hiddenboolean, optional

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

Returns
civis.response.Response
  • idinteger

    The ID for this project.

  • authordict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • namestring

    The name of this project.

  • descriptionstring

    A description of the project.

  • userslist::

    Users who can see the project. - id : integer

    The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • auto_share : boolean

  • created_at : string/time

  • updated_at : string/time

  • archivedstring

    The archival status of the requested item(s).

list_shares(id)

List users and groups permissioned on this object

Parameters
idinteger

The ID of the resource that is shared.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

patch(id, *, name='DEFAULT', description='DEFAULT', definition='DEFAULT', schedule='DEFAULT', allow_concurrent_executions='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT')

Update some attributes of this Workflow

Parameters
idinteger

The ID for this workflow.

namestring, optional

The name of this workflow.

descriptionstring, optional

A description of the workflow.

definitionstring, optional

The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

allow_concurrent_executionsboolean, optional

Whether the workflow can execute when already running.

time_zonestring, optional

The time zone of this workflow.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on

  • failure_onboolean

    If failure email notifications are on

Returns
civis.response.Response
  • idinteger

    The ID for this workflow.

  • namestring

    The name of this workflow.

  • descriptionstring

    A description of the workflow.

  • definitionstring

    The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

  • validboolean

    The validity of the workflow definition.

  • validation_errorsstring

    The errors encountered when validating the workflow definition.

  • file_idstring

    The file id for the s3 file containing the workflow configuration.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • allow_concurrent_executionsboolean

    Whether the workflow can execute when already running.

  • time_zonestring

    The time zone of this workflow.

  • next_execution_atstring/time

    The time of the next scheduled execution.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on

    • failure_onboolean

      If failure email notifications are on

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_at : string/time

  • updated_at : string/time

patch_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Update an attached git file

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

post(name, *, description='DEFAULT', from_job_chain='DEFAULT', definition='DEFAULT', schedule='DEFAULT', allow_concurrent_executions='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT', hidden='DEFAULT')

Create a Workflow

Parameters
namestring

The name of this workflow.

descriptionstring, optional

A description of the workflow.

from_job_chaininteger, optional

If specified, create a workflow from the job chain this job is in, and inherit the schedule from the root of the chain.

definitionstring, optional

The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

allow_concurrent_executionsboolean, optional

Whether the workflow can execute when already running.

time_zonestring, optional

The time zone of this workflow.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on

  • failure_onboolean

    If failure email notifications are on

hiddenboolean, optional

The hidden status of the item.

Returns
civis.response.Response
  • idinteger

    The ID for this workflow.

  • namestring

    The name of this workflow.

  • descriptionstring

    A description of the workflow.

  • definitionstring

    The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

  • validboolean

    The validity of the workflow definition.

  • validation_errorsstring

    The errors encountered when validating the workflow definition.

  • file_idstring

    The file id for the s3 file containing the workflow configuration.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • allow_concurrent_executionsboolean

    Whether the workflow can execute when already running.

  • time_zonestring

    The time zone of this workflow.

  • next_execution_atstring/time

    The time of the next scheduled execution.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on

    • failure_onboolean

      If failure email notifications are on

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_at : string/time

  • updated_at : string/time

post_clone(id, *, clone_schedule='DEFAULT', clone_notifications='DEFAULT')

Clone this Workflow

Parameters
idinteger

The ID for the workflow.

clone_scheduleboolean, optional

If true, also copy the schedule to the new workflow.

clone_notificationsboolean, optional

If true, also copy the notifications to the new workflow.

Returns
civis.response.Response
  • idinteger

    The ID for this workflow.

  • namestring

    The name of this workflow.

  • descriptionstring

    A description of the workflow.

  • definitionstring

    The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

  • validboolean

    The validity of the workflow definition.

  • validation_errorsstring

    The errors encountered when validating the workflow definition.

  • file_idstring

    The file id for the s3 file containing the workflow configuration.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • allow_concurrent_executionsboolean

    Whether the workflow can execute when already running.

  • time_zonestring

    The time zone of this workflow.

  • next_execution_atstring/time

    The time of the next scheduled execution.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on

    • failure_onboolean

      If failure email notifications are on

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_at : string/time

  • updated_at : string/time

post_executions(id, *, target_task='DEFAULT', input='DEFAULT', included_tasks='DEFAULT')

Execute a workflow

Parameters
idinteger

The ID for the workflow.

target_taskstring, optional

For a reverse workflow, the name of the task to target.

inputdict, optional

Key-value pairs to send to this execution as inputs.

included_taskslist, optional

If specified, executes only the subset of workflow tasks included as specified by task name.

Returns
civis.response.Response
  • idinteger

    The ID for this workflow execution.

  • statestring

    The state of this workflow execution.

  • mistral_statestring

    The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled

  • mistral_state_infostring

    The state info of this workflow as reported by mistral.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • definitionstring

    The definition of the workflow for this execution.

  • inputdict

    Key-value pairs defined for this execution.

  • included_taskslist

    The subset of workflow tasks selected to execute.

  • taskslist::

    The tasks associated with this execution. - name : string

    The name of the task.

    • mistral_statestring

      The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled

    • mistral_state_infostring

      Extra info associated with the state of the task.

    • runslist::

      The runs associated with this task, in descending order by id. - id : integer

      The ID of the run.

      • job_idinteger

        The ID of the job associated with the run.

      • statestring

        The state of the run.

    • executionslist::

      The executions run by this task, in descending order by id. - id : integer

      The ID of the execution.

      • workflow_idinteger

        The ID of the workflow associated with the execution.

  • started_atstring/time

    The time this execution started.

  • finished_atstring/time

    The time this execution finished.

  • created_atstring/time

    The time this execution was created.

  • updated_atstring/time

    The time this execution was last updated.

post_executions_cancel(id, execution_id)

Cancel a workflow execution

Parameters
idinteger

The ID for the workflow.

execution_idinteger

The ID for the workflow execution.

Returns
civis.response.Response
  • idinteger

    The ID for this workflow execution.

  • statestring

    The state of this workflow execution.

  • mistral_statestring

    The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled

  • mistral_state_infostring

    The state info of this workflow as reported by mistral.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • definitionstring

    The definition of the workflow for this execution.

  • inputdict

    Key-value pairs defined for this execution.

  • included_taskslist

    The subset of workflow tasks selected to execute.

  • taskslist::

    The tasks associated with this execution. - name : string

    The name of the task.

    • mistral_statestring

      The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled

    • mistral_state_infostring

      Extra info associated with the state of the task.

    • runslist::

      The runs associated with this task, in descending order by id. - id : integer

      The ID of the run.

      • job_idinteger

        The ID of the job associated with the run.

      • statestring

        The state of the run.

    • executionslist::

      The executions run by this task, in descending order by id. - id : integer

      The ID of the execution.

      • workflow_idinteger

        The ID of the workflow associated with the execution.

  • started_atstring/time

    The time this execution started.

  • finished_atstring/time

    The time this execution finished.

  • created_atstring/time

    The time this execution was created.

  • updated_atstring/time

    The time this execution was last updated.

post_executions_resume(id, execution_id)

Resume a paused workflow execution

Parameters
idinteger

The ID for the workflow.

execution_idinteger

The ID for the workflow execution.

Returns
civis.response.Response
  • idinteger

    The ID for this workflow execution.

  • statestring

    The state of this workflow execution.

  • mistral_statestring

    The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled

  • mistral_state_infostring

    The state info of this workflow as reported by mistral.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • definitionstring

    The definition of the workflow for this execution.

  • inputdict

    Key-value pairs defined for this execution.

  • included_taskslist

    The subset of workflow tasks selected to execute.

  • taskslist::

    The tasks associated with this execution. - name : string

    The name of the task.

    • mistral_statestring

      The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled

    • mistral_state_infostring

      Extra info associated with the state of the task.

    • runslist::

      The runs associated with this task, in descending order by id. - id : integer

      The ID of the run.

      • job_idinteger

        The ID of the job associated with the run.

      • statestring

        The state of the run.

    • executionslist::

      The executions run by this task, in descending order by id. - id : integer

      The ID of the execution.

      • workflow_idinteger

        The ID of the workflow associated with the execution.

  • started_atstring/time

    The time this execution started.

  • finished_atstring/time

    The time this execution finished.

  • created_atstring/time

    The time this execution was created.

  • updated_atstring/time

    The time this execution was last updated.

post_executions_retry(id, execution_id, *, task_name='DEFAULT')

Retry a failed task, or all failed tasks in an execution

Parameters
idinteger

The ID for the workflow.

execution_idinteger

The ID for the workflow execution.

task_namestring, optional

If specified, the name of the task to be retried. If not specified, all failed tasks in the execution will be retried.

Returns
civis.response.Response
  • idinteger

    The ID for this workflow execution.

  • statestring

    The state of this workflow execution.

  • mistral_statestring

    The state of this workflow as reported by mistral. One of running, paused, success, error, or cancelled

  • mistral_state_infostring

    The state info of this workflow as reported by mistral.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • definitionstring

    The definition of the workflow for this execution.

  • inputdict

    Key-value pairs defined for this execution.

  • included_taskslist

    The subset of workflow tasks selected to execute.

  • taskslist::

    The tasks associated with this execution. - name : string

    The name of the task.

    • mistral_statestring

      The state of this task. One of idle, waiting, running, delayed, success, error, or cancelled

    • mistral_state_infostring

      Extra info associated with the state of the task.

    • runslist::

      The runs associated with this task, in descending order by id. - id : integer

      The ID of the run.

      • job_idinteger

        The ID of the job associated with the run.

      • statestring

        The state of the run.

    • executionslist::

      The executions run by this task, in descending order by id. - id : integer

      The ID of the execution.

      • workflow_idinteger

        The ID of the workflow associated with the execution.

  • started_atstring/time

    The time this execution started.

  • finished_atstring/time

    The time this execution finished.

  • created_atstring/time

    The time this execution was created.

  • updated_atstring/time

    The time this execution was last updated.

post_git_checkout(id)

Checkout content that the existing git_ref points to and save to the object

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_git_checkout_latest(id)

Checkout latest commit on the current branch of a script or workflow

Parameters
idinteger

The ID of the file.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

post_git_commits(id, content, message, file_hash)

Commit and push a new version of the file

Parameters
idinteger

The ID of the file.

contentstring

The contents to commit to the file.

messagestring

A commit message describing the changes being made.

file_hashstring

The full SHA of the file being replaced.

Returns
civis.response.Response
  • contentstring

    The file’s contents.

  • typestring

    The file’s type.

  • sizeinteger

    The file’s size.

  • file_hashstring

    The SHA of the file.

put(id, name, *, description='DEFAULT', definition='DEFAULT', schedule='DEFAULT', allow_concurrent_executions='DEFAULT', time_zone='DEFAULT', notifications='DEFAULT')

Replace all attributes of this Workflow

Parameters
idinteger

The ID for this workflow.

namestring

The name of this workflow.

descriptionstring, optional

A description of the workflow.

definitionstring, optional

The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

scheduledict, optional::
  • scheduledboolean

    If the item is scheduled.

  • scheduled_dayslist

    Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

  • scheduled_hourslist

    Hours of the day it is scheduled on.

  • scheduled_minuteslist

    Minutes of the day it is scheduled on.

  • scheduled_runs_per_hourinteger

    Alternative to scheduled minutes, number of times to run per hour.

  • scheduled_days_of_monthlist

    Days of the month it is scheduled on, mutually exclusive with scheduledDays.

allow_concurrent_executionsboolean, optional

Whether the workflow can execute when already running.

time_zonestring, optional

The time zone of this workflow.

notificationsdict, optional::
  • urlslist

    URLs to receive a POST request at job completion

  • success_email_subjectstring

    Custom subject line for success e-mail.

  • success_email_bodystring

    Custom body text for success e-mail, written in Markdown.

  • success_email_addresseslist

    Addresses to notify by e-mail when the job completes successfully.

  • failure_email_addresseslist

    Addresses to notify by e-mail when the job fails.

  • stall_warning_minutesinteger

    Stall warning emails will be sent after this amount of minutes.

  • success_onboolean

    If success email notifications are on

  • failure_onboolean

    If failure email notifications are on

Returns
civis.response.Response
  • idinteger

    The ID for this workflow.

  • namestring

    The name of this workflow.

  • descriptionstring

    A description of the workflow.

  • definitionstring

    The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

  • validboolean

    The validity of the workflow definition.

  • validation_errorsstring

    The errors encountered when validating the workflow definition.

  • file_idstring

    The file id for the s3 file containing the workflow configuration.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • allow_concurrent_executionsboolean

    Whether the workflow can execute when already running.

  • time_zonestring

    The time zone of this workflow.

  • next_execution_atstring/time

    The time of the next scheduled execution.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on

    • failure_onboolean

      If failure email notifications are on

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_at : string/time

  • updated_at : string/time

put_archive(id, status)

Update the archive status of this object

Parameters
idinteger

The ID of the object.

statusboolean

The desired archived status of the object.

Returns
civis.response.Response
  • idinteger

    The ID for this workflow.

  • namestring

    The name of this workflow.

  • descriptionstring

    A description of the workflow.

  • definitionstring

    The definition of the workflow in YAML format. Must not be specified if fromJobChain is specified.

  • validboolean

    The validity of the workflow definition.

  • validation_errorsstring

    The errors encountered when validating the workflow definition.

  • file_idstring

    The file id for the s3 file containing the workflow configuration.

  • userdict::
    • idinteger

      The ID of this user.

    • namestring

      This user’s name.

    • usernamestring

      This user’s username.

    • initialsstring

      This user’s initials.

    • onlineboolean

      Whether this user is online.

  • statestring

    The state of the workflow. State is “running” if any execution is running, otherwise reflects most recent execution state.

  • scheduledict::
    • scheduledboolean

      If the item is scheduled.

    • scheduled_dayslist

      Days of the week, based on numeric value starting at 0 for Sunday. Mutually exclusive with scheduledDaysOfMonth

    • scheduled_hourslist

      Hours of the day it is scheduled on.

    • scheduled_minuteslist

      Minutes of the day it is scheduled on.

    • scheduled_runs_per_hourinteger

      Alternative to scheduled minutes, number of times to run per hour.

    • scheduled_days_of_monthlist

      Days of the month it is scheduled on, mutually exclusive with scheduledDays.

  • allow_concurrent_executionsboolean

    Whether the workflow can execute when already running.

  • time_zonestring

    The time zone of this workflow.

  • next_execution_atstring/time

    The time of the next scheduled execution.

  • notificationsdict::
    • urlslist

      URLs to receive a POST request at job completion

    • success_email_subjectstring

      Custom subject line for success e-mail.

    • success_email_bodystring

      Custom body text for success e-mail, written in Markdown.

    • success_email_addresseslist

      Addresses to notify by e-mail when the job completes successfully.

    • failure_email_addresseslist

      Addresses to notify by e-mail when the job fails.

    • stall_warning_minutesinteger

      Stall warning emails will be sent after this amount of minutes.

    • success_onboolean

      If success email notifications are on

    • failure_onboolean

      If failure email notifications are on

  • archivedstring

    The archival status of the requested item(s).

  • hiddenboolean

    The hidden status of the item.

  • my_permission_levelstring

    Your permission level on the object. One of “read”, “write”, or “manage”.

  • created_at : string/time

  • updated_at : string/time

put_git(id, *, git_ref='DEFAULT', git_branch='DEFAULT', git_path='DEFAULT', git_repo_url='DEFAULT', git_ref_type='DEFAULT', pull_from_git='DEFAULT')

Attach an item to a file in a git repo

Parameters
idinteger

The ID of the file.

git_refstring, optional

A git reference specifying an unambiguous version of the file. Can be a branch name, or the full or shortened SHA of a commit.

git_branchstring, optional

The git branch that the file is on.

git_pathstring, optional

The path of the file in the repository.

git_repo_urlstring, optional

The URL of the git repository.

git_ref_typestring, optional

Specifies if the file is versioned by branch or tag.

pull_from_gitboolean, optional

Automatically pull latest commit from git. Only works for scripts.

Returns
civis.response.Response
  • git_refstring

    A git reference specifying an unambiguous version of the file. Can be a branch name, tag or the full or shortened SHA of a commit.

  • git_branchstring

    The git branch that the file is on.

  • git_pathstring

    The path of the file in the repository.

  • git_repodict::
    • idinteger

      The ID for this git repository.

    • repo_urlstring

      The URL for this git repository.

    • created_at : string/time

    • updated_at : string/time

  • git_ref_typestring

    Specifies if the file is versioned by branch or tag.

  • pull_from_gitboolean

    Automatically pull latest commit from git. Only works for scripts and workflows (assuming you have the feature enabled)

put_projects(id, project_id)

Add a Workflow to a project

Parameters
idinteger

The ID of the Workflow.

project_idinteger

The ID of the project.

Returns
None

Response code 204: success

put_shares_groups(id, group_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions groups has on this object

Parameters
idinteger

The ID of the resource that is shared.

group_idslist

An array of one or more group IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_shares_users(id, user_ids, permission_level, *, share_email_body='DEFAULT', send_shared_email='DEFAULT')

Set the permissions users have on this object

Parameters
idinteger

The ID of the resource that is shared.

user_idslist

An array of one or more user IDs.

permission_levelstring

Options are: “read”, “write”, or “manage”.

share_email_bodystring, optional

Custom body text for e-mail sent on a share.

send_shared_emailboolean, optional

Send email to the recipients of a share.

Returns
civis.response.Response
  • readersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • writersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • ownersdict::
    • userslist::
      • id : integer

      • name : string

    • groupslist::
      • id : integer

      • name : string

  • total_user_sharesinteger

    For owners, the number of total users shared. For writers and readers, the number of visible users shared.

  • total_group_sharesinteger

    For owners, the number of total groups shared. For writers and readers, the number of visible groups shared.

put_transfer(id, user_id, include_dependencies, *, email_body='DEFAULT', send_email='DEFAULT')

Transfer ownership of this object to another user

Parameters
idinteger

The ID of the resource that is shared.

user_idinteger

ID of target user

include_dependenciesboolean

Whether or not to give manage permissions on all dependencies

email_bodystring, optional

Custom body text for e-mail sent on transfer.

send_emailboolean, optional

Send email to the target user of the transfer?

Returns
civis.response.Response
  • dependencieslist::

    Dependent objects for this object - object_type : string

    Dependent object type

    • fco_typestring

      Human readable dependent object type

    • idinteger

      Dependent object ID

    • namestring

      Dependent object name, or nil if the requesting user cannot read this object

    • permission_levelstring

      Permission level of target user (not user’s groups) for dependent object, or null if no target user

    • sharedboolean

      Whether dependent object was successfully shared with target user

Command Line Interface

A command line interface (CLI) to Civis is provided. This can be invoked by typing the command civis in the shell (sh, bash, zsh, etc.). It can also be used in Civis container scripts where the Docker image has this client installed. Here’s a simple example of printing the types of scripts.

> civis scripts list-types
- name: sql
- name: python3
- name: javascript
- name: r
- name: containers

Not all API endpoints are available through the CLI since some take complex data types (e.g., arrays, objects/dictionaries) as input. However, functionality is available for getting information about scripts, logs, etc., as well as executing already created scripts.

There are a few extra, CLI-only commands that wrap the Files API endpoints to make uploading and downloading files easier: civis files upload $PATH and civis files download $FILEID $PATH.

The default output format is YAML, but the --json-output allows you to get output in JSON.

You can find out more information about a command by adding a --help option, like civis scripts list --help.

Job Logs

These commands show job run logs in the format: “datetime message\n” where datetime is in ISO8601 format, like “2020-02-14T20:28:18.722Z”. If the job is still running, this command will continue outputting logs until the run is done and then exit. If the run is already finished, it will output all the logs from that run and then exit.

NOTE: These commands could miss some log entries from a currently-running job. It does not re-fetch logs that might have been saved out of order, to preserve the chronological order of the logs and without duplication.

  • civis jobs follow-log $JOB_ID

    Output live log from the most recent job run for the given job ID.

  • civis jobs follow-run-log $JOB_ID $RUN_ID

    Output live log from the given job and run ID.

Notebooks

The following CLI-only commands make it easier to use Civis Platform as a backend for your Jupyter notebooks.

  • civis notebooks download $NOTEBOOK_ID $PATH

    Download a notebook from Civis Platform to the requested file on the local filesystem.

  • civis notebooks new [$LANGUAGE] [--mem $MEMORY] [--cpu $CPU]

    Create a new notebook, allocate resources for it, and open it in a tab of your default web browser. This command is the most similar to jupyter notebook. By default, Civis Platform will create a Python 3 notebook, but you can request any other language. Optional resource parameters let you allocate more memory or CPU to your notebook.

  • civis notebooks up $NOTEBOOK_ID [--mem $MEMORY] [--cpu $CPU]

    Allocate resources for a notebook which already exists in Civis Platform and open it in a tab of your default browser. Optional resource arguments allow you to change resources allocated to your notebook (default to using the same resources as the previous run).

  • civis notebooks down $NOTEBOOK_ID

    Stop a running notebook and free up the resources allocated to it.

  • civis notebooks open $NOTEBOOK_ID

    Open an existing notebook (which may or may not be running) in your default browser.

SQL

The Civis CLI allows for easy running of SQL queries on Civis Platform through the following commands:

  • civis sql [-n $MAX_LINES] -d $DATABASE_NAME -f $FILE_NAME

    Read a SQL query from a text file and run it on the specified database. The results of the query, if any, will be shown after it completes (up to a maximum of $MAX_LINES rows, defaulting to 100).

  • civis sql [-n $MAX_LINES] -d $DATABASE_NAME -c [$SQL_QUERY]

    Instead of reading from a file, read query text from a command line argument. If you do not provide a query on the command line, the query text will be taken from stdin.

  • civis sql -d $DATABASE_NAME [-f $SQL_FILE_NAME] -o $OUTPUT_FILE_NAME

    With the -o or –output option specified, the complete results of the query will be downloaded to a CSV file at the requested location after the query completes.

Running Jobs and Templates

The civis.utils namespace provides several functions for running jobs and templates on the Civis Platform.

run_job(job_id[, api_key, client, ...])

Run a job.

run_template(id, arguments[, JSONValue, client])

Run a template and return the results.

Indices and tables