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
slug
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
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
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
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
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.
Was this helpful?