Capsule API
Prerequisites
Generated Token with Capsule Scope
The Capsule ID
You can find the Capsule's ID in metadata.
id
string
the Capsule ID
created
int64
Capsule creation time
name
string
the Capsule display name
status
string
non_published, submitted, publishing, published, verified
owner
string
the Capsule owner’s ID
slug
string
alternate Capsule ID
original_capsule
Optional
original Capsule Info
id - string
original Capsule id
major_version - integer
original Capsule major version
minor_version - integer
original Capsule minor version
name - string
original Capsule name
created - int64
original Capsule creation data
public - boolean
indicates whether the original Capsule is public
published_capsule
Optional - string
published Capsule ID
submission
Optional
timestamp - int64
submission time
commit - string
submission commit hash
verification_capsule - string
verification Capsule ID
verified - boolean
indicates whether the Capsule was verified
verified_timestamp - int64
verification time
versions
Optional - Array
Capsule versions
major_version - int
the Capsule major version
minor_version - int
the Capsule minor version
publish_time - int64
the version publishing time
doi - string
version DOI
description
Optional - string
Capsule description
field
Optional - string
the Capsule research field
keywords
Optional - string of arrays
article
Optional
the Capsule article info.
url - string
article URL
id - string
article ID
doi - string
article DOI
citation - string
article citation
state
in_review, published
name - string
article name
journal_name - string
articles journal name
publish_time - int64
article publish time
Get Capsule
GET
https://{domain}/api/v1/capsules/{capsule_id}
This API allows for the retrieval of the metadata for your capsule.
Path Parameters
Name | Type | Description |
---|---|---|
GET* |
| /capsules/:capsule_id Your VPC domain |
Headers
Name | Type | Description |
---|---|---|
-u* |
| Authorize with Code Ocean API Secret: -u $API_SECRET This is setting the "Authorization Basic" base64string header |
-H* |
| Set this to: Content - Type: application/json |
Listing Capsule Computations
GET
https://{domain}/api/v1/capsules/{capsule_id}/computations
This API allows for the retrieval of Computations from a Capsule.
Path Parameters
Name | Type | Description |
---|---|---|
GET* |
| /capsules/:capsule_id/computations |
Headers
Name | Type | Description |
---|---|---|
-u* |
| Authorize with Code Ocean API Secret: -u $API_SECRET This is setting the "Authorization Basic" base64string header |
-H |
| Set this to: Content - Type: application/json |
Attach/Detach Data Asset Capsules
POST
https://{domain}/api/v1/capsules/{capsule_id}/data_assets
This API attaches one or many Data Assets to 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
Name | Type | Description |
---|---|---|
POST* |
| /capsules/:capsule_id/data_assets |
Headers
Name | Type | Description |
---|---|---|
-u* |
| Authorize with Code Ocean API Secret: -u $API_SECRET : |
-H* |
| Set this to: Content - Type: application/json |
--data-raw* |
| JSON parameters |
Request Body
Name | Type | Description |
---|---|---|
id* | string | data assets id |
mount | string | Folder to mount data |
Detach Data Asset Capsules
DELETE
https://{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
Name | Type | Description |
---|---|---|
POST* |
| /capsules/:capsule_id/data_assets |
Headers
Name | Type | Description |
---|---|---|
-u* |
| Authorize with Code Ocean API Secret: -u $API_SECRET : |
-H* |
| Set this to: Content - Type: application/json |
--data-raw* |
| JSON parameters |
Request Body
Name | Type | Description |
---|---|---|
id* | string | data assets id |
mount | string | Folder to mount data |
Last updated