Capsule
Prerequisites
Generated Access Token with Capsule scope
The Capsule ID
You can find the Capsule's ID in metadata.

id
stringCapsule ID
created
int64Capsule creation timename
stringCapsule display name
status
enumStatus of the Capsule
non_release, release
owner
stringCapsule owner’s ID
owner_email
stringCapsule owner's email addressslug
stringAlternate Capsule ID
last_accessed
int64Last time capsule was accessed by anyone
description
stringCapsule description
field
stringCapsule research field
original_capsule
dictionary(Optional)Original Capsule Info
id
stringOriginal Capsule id
major_version
integerOriginal Capsule major version
minor_version
integerOriginal Capsule minor versionname
stringOriginal Capsule name
created
int64Original Capsule creation data
public
booleanIndicates whether the original Capsule is public
release_capsule
string(Optional)Release Capsule ID
submission
dictionary(Optional)timestamp
int64Submission time
commit
stringSubmission commit hash
verification_capsule
stringVerification Capsule ID
verified
booleanIndicates whether the Capsule was verified
verified_timestamp
int64Verification time
versions
dictionary(Optional)Capsule versions
major_version
integerThe Capsule major version
minor_version
integerThe Capsule minor version
release_time
int64The version publishing time
doi
stringVersion DOI
tags
list<string>(Optional)article
dictionary(Optional)Capsule article info
url
stringArticle URL
id
stringArticle ID
doi
stringArticle DOI
citation
stringArticle citation
state
enumArticle state
in_review, published
name
stringArticle name
journal_name
stringArticles journal name
publish_time
int64Article publish time
cloned_from_url
stringURL to external Git repository linked to Capsule
Get Capsule
GET https://{codeocean-domain}/api/v1/capsules/{capsule_id}
This API allows for the retrieval of the metadata for your Capsule.
Path Parameters
capsule_id*
string
Scope
Capsule
Read
Delete Capsule
DELETE https://{codeocean-domain}/api/v1/capsules/{capsule_id}
This API allows deletion of an archived capsule/pipeline.
Path Parameters
capsule_id*
string
Scope
Capsule
Write
Response
204 - No Content
Returned upon successful deletion of the Capsule/Pipeline.
403 - Forbidden
Returned in the following cases:
Target Capsule/Pipeline is not archived
User is not an either an owner of the Capsule/Pipeline or an Admin
Capsule/Pipeline has been Released
Get Capsule App Panel
GET https://{codeocean-domain}/api/v1/capsules/{capsule_id}/app_panel
Path Parameters
capsule_id*
string
Request Body (optional)
version
integer
Version of the release capsule, latest if unspecified.
Scope
Capsule
Read
Response
general (optional)
general information
title
string(optional)instructions
string(optional)help_text
string(optional)
data_assets
array(optional)input data assets
id
stringdata asset IDmount
stringdata asset mount within the capsule’s/pipeline’sdatafoldername
stringdata asset namedescription
string(optional) data asset descriptionhelp_text
string(optional) additional help textkind - data assets type -
internal,externalorcombinedaccessible -
boolean- indicates whether the data asset is accessible to the user
categories
array(optional) parameter categories (N/A for pipelines of capsules)id
stringcategory IDname
stringcategory namedescription
string(optional) category descriptionhelp_text
string(optional) additional help text
parameters
array(optional) input parameters (N/A for pipelines of capsules)category
string(optional) category id from the category list, in case parameters are divided into categoriesname
stringparameter labelparam_name
string(optional) parameter namedescription
string(optional) category descriptionhelp_text
string(optional) additional help texttype
stringparameter typetext,listorfilevalue_type
string(optional) the type of the parameter valuedefault_value
string(optional) default parameter valuerequired
boolean(optional) indicates a required parameterhidden
boolean(optional) indicates a hidden parameterminimum
float64(optional) minimum numeric valuemaximum
float64(optional) maximum numeric valuepattern
string(optional) value validation patternvalue_options
array(optional) list of value options forlistparameters
results
array(optional) selected result filesfile_name
stringresult file name
processes
array(optional) pipeline process names and their corresponding app panels (for pipelines of capsules only)name
stringprocess namecategories
array(optional) parameter categoriesparameters
array(optional) input parameters
List Capsule Computations
GET https://{codeocean-domain}/api/v1/capsules/{capsule_id}/computations
This API allows for the retrieval of Computations from a Capsule.
Path Parameters
capsule_id*
string
Scope
Capsule
Read
Response
List of Computation Object
Attach Data Assets
POST https://{codeocean-domain}/api/v1/capsules/{capsule_id}/data_assets
Path Parameters
capsule_id*
string
Request Body
List of DataAssetAttachParams:
id*
string
Data Asset ID
mount
string
(Optional)
Folder to mount data
Scope
Capsule
Read and Write
Data Asset
Read and Write
Response
List of DataAssetAttachResults:
external
booleanindicates whether the data asset is external
id
stringdata asset ID
job_id
stringfor internal use
mount
stringname of folder to mount the data asset
mount_state
stringfor internal use
ready
booleandata asset is attached and ready for use in capsule
Detach Data Assets
DELETE https://{codeocean-domain}/api/v1/capsules/{capsule_id}/data_assets
This API detaches one or many Data Assets from a Capsule/Pipeline.
Prerequisite
Before using this API call, you may need AWS Cloud Credentials configured as Secrets or an Assumable Role, if you are using Data Assets from Cloud Sources.
Path Parameters
capsule_id*
string
Request Body
List of Data Asset IDs to detach.
Scope
Capsule
Read and Write
Data Asset
Read and Write
Archive Capsule
PATCH https://{codeocean-domain}/api/v1/capsules/{capsule_id}/archive
This API allows for archiving of a capsule/pipeline.
Path Parameters
capsule_id*
string
Request Body (optional)
archive
bool
If true will archive the capsule/pipeline, otherwise will unarchive it.
Scope
Capsule
Write
Search Capsules/Pipelines
POST https://{codeocean-domain}/api/v1/capsules/search
POST https://{codeocean-domain}/api/v1/pipelines/search
This API allows for the searching of Capsules and Pipelines in your deployment.
Request Body (all fields optional)
offset
int
Specifies the starting index for the search.
limit
int
Specifies how many items to return (up to 1000, defaults to 100).
next_token
string
Represents the token for the next page of results as provided in the previous response. If both from and next_token are set, the from parameter is ignored.
sort_order
asc, desc
Determines the result sort order. Must be provided with sort_field, otherwise ignored.
sort_field
created, name, last_accessed
Determines the field to sort by. Default when searching via filters is name. When searching via query, results are ordered by relevance to the query.
query
string
Determines the search query. Can be a free text or in the form of “name:... tag:...”
ownership
created, shared
Search Capsules by ownership. created - Only Capsules created by the user.
shared - Capsules shared with the user
** Defaults to all accessible, admins will have access to all Capsules in the system.
status
release, non_release
By default all are returned.
favorite
boolean
Search only favorite Capsules.
archived
boolean
Search only archived Capsules.
filters
list
key
string
Field key can be each of name, description, tags, any custom field key defined by the admin.
value
Field value to be included/excluded (optional).
values
Field values in case of multiple values (optional).
range
Field range to be included/excluded (only one of min/max must be set).
min
number
max
number
exclude
boolean
Whether to include/exclude the field value.
Response
has_more
boolean
Indicates if there are more results.
next_token
number
Specifies the next page token for the next request.
results
array
Array of Capsules found.
Sync Git
POST https://{codeocean-domain}/api/v1/capsules/<capsule_id>/sync
POST https://{codeocean-domain}/api/v1/pipelines/<pipeline_id>/sync
Perform a Git sync with the external Git remote of the Capsule or Pipeline.
Prerequisites
Capsule/Pipeline must be linked to an external Git repository.
User must have valid Git credentials configured.
User must have access to both the Capsule/Pipeline and the linked Git repository.
Capsule/Pipeline workspace must not be locked (e.g. when a CW session is running).
Capsule/Pipeline must have no uncommitted changes.
Path Parameters
capsule_id* or pipeline_id*
string
Response
pushed
integer
Number of commits pushed to the external git remote.
pulled
integer
Number of commits pulled from the external git remote.
new_branch
boolean
Indicates if the current branch did not yet exist on the external git remote branch and was created by this sync.
Last updated
Was this helpful?