Skip to content

DatasetApi

All URIs are relative to https://app.coactive.ai

Method HTTP request Description
add_assets_to_dataset POST /api/v0/datasets/{dataset_id}/assets Add assets to an existing dataset
create_dataset POST /api/v0/datasets Create a new dataset
delete_dataset DELETE /api/v0/datasets/{dataset_id} Delete dataset by id
get_available_encoders GET /api/v0/encoders Get all available encoders
get_dataset GET /api/v0/datasets/{dataset_id} Get dataset by id
get_dataset_images GET /api/v0/datasets/{dataset_id}/images Get images by dataset id
get_dataset_videos GET /api/v0/datasets/{dataset_id}/videos Get videos by dataset id
get_datasets GET /api/v0/datasets Get all datasets paginated
update_dataset PATCH /api/v0/datasets/{dataset_id} Update dataset by id
update_metadata_for_assets POST /api/v0/datasets/{dataset_id}/assets_metadata Update asset metadata in an existing dataset

add_assets_to_dataset

DatasetResponse add_assets_to_dataset(dataset_id, add_assets_to_dataset_request)

Add assets to an existing dataset

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.add_assets_to_dataset_request import AddAssetsToDatasetRequest
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.dataset_response import DatasetResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    dataset_id = "556f4d52-a557-461e-a204-69236fd9c1e2"
    add_assets_to_dataset_request = AddAssetsToDatasetRequest(
        asset_paths=["s3://your-s3-bucket/path/to/img.png","s3://your-s3-bucket/path/to/img2.jpeg"],
        items=[
            AddAssetItem(
                path="s3://your-s3-bucket/path/to/img.png",
                metadata={
                    "key": "key_example",
                },
            ),
        ],
    )

    # example passing only required values which don't have defaults set
    try:
        # Add assets to an existing dataset
        api_response = api_instance.add_assets_to_dataset(dataset_id, add_assets_to_dataset_request)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->add_assets_to_dataset: %s\n" % e)

Parameters

Name Type Description Notes
dataset_id str The unique identifier for the dataset
add_assets_to_dataset_request AddAssetsToDatasetRequest

Return type

DatasetResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The dataset assets were added to -
403 Authentication error -
401 Unauthorized -
404 Dataset not found -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

create_dataset

DatasetResponse create_dataset(create_dataset_request)

Create a new dataset. The dataset will not be available to query until the status is 'ready'.

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.create_dataset_request import CreateDatasetRequest
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.dataset_response import DatasetResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    create_dataset_request = CreateDatasetRequest(
        name="GameOfThrones",
        description="A dataset containing screenshots and clips from the tv show Game of Thrones",
        storage_type=StorageTypeEnum("local"),
        data_path="s3://your-s3-bucket/path/prefix",
        csv_path="path/to/file.csv",
        metadata_path="s3://your-s3-bucket/metadata.csv",
        encoder="name_of_encoder_to_use",
        credentials_id="382cc760-8e8e-4b97-abab-84438282cb9a",
        ocr=True,
        keyframe_sampling_method=KeyframeSamplingMethodEnum("intelligent"),
        keyframe_uniform_fps_sampling_rate=1.5,
    )

    # example passing only required values which don't have defaults set
    try:
        # Create a new dataset
        api_response = api_instance.create_dataset(create_dataset_request)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->create_dataset: %s\n" % e)

Parameters

Name Type Description Notes
create_dataset_request CreateDatasetRequest

Return type

DatasetResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The created dataset -
403 Authentication error -
401 Unauthorized -
404 Not found -
400 Dataset name is invalid -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

delete_dataset

bool, date, datetime, dict, float, int, list, str, none_type delete_dataset(dataset_id)

Delete dataset by id

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    dataset_id = "556f4d52-a557-461e-a204-69236fd9c1e2"

    # example passing only required values which don't have defaults set
    try:
        # Delete dataset by id
        api_response = api_instance.delete_dataset(dataset_id)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->delete_dataset: %s\n" % e)

Parameters

Name Type Description Notes
dataset_id str The unique identifier for the dataset

Return type

bool, date, datetime, dict, float, int, list, str, none_type

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The process to delete the dataset was initiated -
403 Authentication error -
401 Unauthorized -
404 Dataset not found -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

get_available_encoders

EncoderListResponse get_available_encoders()

Get all available encoders

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.encoder_list_response import EncoderListResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    offset = 0 # (optional) if omitted the server will use the default value of 0
    limit = 100 # (optional) if omitted the server will use the default value of 100

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get all available encoders
        api_response = api_instance.get_available_encoders(offset=offset, limit=limit)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->get_available_encoders: %s\n" % e)

Parameters

Name Type Description Notes
offset int, none_type Starting index to return [optional] if omitted the server will use the default value of 0
limit int, none_type Max number of items to return [optional] if omitted the server will use the default value of 100

Return type

EncoderListResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 All available encoders -
403 Authentication error -
401 Unauthorized -
404 Not found -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

get_dataset

DatasetResponse get_dataset(dataset_id)

Get dataset by id

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.dataset_response import DatasetResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    dataset_id = "556f4d52-a557-461e-a204-69236fd9c1e2"

    # example passing only required values which don't have defaults set
    try:
        # Get dataset by id
        api_response = api_instance.get_dataset(dataset_id)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->get_dataset: %s\n" % e)

Parameters

Name Type Description Notes
dataset_id str The unique identifier for the dataset

Return type

DatasetResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The dataset -
403 Authentication error -
401 Unauthorized -
404 Dataset not found -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

get_dataset_images

PagedAssetsResponse get_dataset_images(dataset_id)

Get images by dataset id

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.paged_assets_response import PagedAssetsResponse
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    dataset_id = "556f4d52-a557-461e-a204-69236fd9c1e2"
    offset = 0 # (optional) if omitted the server will use the default value of 0
    limit = 100 # (optional) if omitted the server will use the default value of 100

    # example passing only required values which don't have defaults set
    try:
        # Get images by dataset id
        api_response = api_instance.get_dataset_images(dataset_id)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->get_dataset_images: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get images by dataset id
        api_response = api_instance.get_dataset_images(dataset_id, offset=offset, limit=limit)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->get_dataset_images: %s\n" % e)

Parameters

Name Type Description Notes
dataset_id str The unique identifier for the dataset
offset int, none_type Starting index to return [optional] if omitted the server will use the default value of 0
limit int, none_type Max number of items to return [optional] if omitted the server will use the default value of 100

Return type

PagedAssetsResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Paginated list of images in the dataset -
403 Authentication error -
401 Unauthorized -
404 Dataset not found -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

get_dataset_videos

PagedAssetsResponse get_dataset_videos(dataset_id)

Get videos by dataset id

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.paged_assets_response import PagedAssetsResponse
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    dataset_id = "556f4d52-a557-461e-a204-69236fd9c1e2"
    offset = 0 # (optional) if omitted the server will use the default value of 0
    limit = 100 # (optional) if omitted the server will use the default value of 100

    # example passing only required values which don't have defaults set
    try:
        # Get videos by dataset id
        api_response = api_instance.get_dataset_videos(dataset_id)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->get_dataset_videos: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get videos by dataset id
        api_response = api_instance.get_dataset_videos(dataset_id, offset=offset, limit=limit)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->get_dataset_videos: %s\n" % e)

Parameters

Name Type Description Notes
dataset_id str The unique identifier for the dataset
offset int, none_type Starting index to return [optional] if omitted the server will use the default value of 0
limit int, none_type Max number of items to return [optional] if omitted the server will use the default value of 100

Return type

PagedAssetsResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Paginated list of videos in the dataset -
403 Authentication error -
401 Unauthorized -
404 Dataset not found -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

get_datasets

DatasetListResponse get_datasets()

Get all datasets paginated, optionally filtered by status

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.dataset_list_response import DatasetListResponse
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.dataset_status_enum import DatasetStatusEnum

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    offset = 0 # (optional) if omitted the server will use the default value of 0
    limit = 100 # (optional) if omitted the server will use the default value of 100
    statuses_to_include = [
        DatasetStatusEnum("["Ready"]"),
    ] # (optional)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get all datasets paginated
        api_response = api_instance.get_datasets(offset=offset, limit=limit, statuses_to_include=statuses_to_include)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->get_datasets: %s\n" % e)

Parameters

Name Type Description Notes
offset int, none_type Starting index to return [optional] if omitted the server will use the default value of 0
limit int, none_type Max number of items to return [optional] if omitted the server will use the default value of 100
statuses_to_include [DatasetStatusEnum], none_type Dataset status to include in the list response [optional]

Return type

DatasetListResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The paginated list of datasets -
403 Authentication error -
401 Unauthorized -
404 Not found -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

update_dataset

DatasetResponse update_dataset(dataset_id, update_dataset_request)

Update dataset by id

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.update_dataset_request import UpdateDatasetRequest
from coactive.model.error_response import ErrorResponse
from coactive.model.dataset_response import DatasetResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    dataset_id = "556f4d52-a557-461e-a204-69236fd9c1e2"
    update_dataset_request = UpdateDatasetRequest(
        name="GameOfThrones",
        description="A dataset containing screenshots and clips from the tv show Game of Thrones",
    )

    # example passing only required values which don't have defaults set
    try:
        # Update dataset by id
        api_response = api_instance.update_dataset(dataset_id, update_dataset_request)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->update_dataset: %s\n" % e)

Parameters

Name Type Description Notes
dataset_id str The unique identifier for the dataset
update_dataset_request UpdateDatasetRequest

Return type

DatasetResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The updated dataset -
403 Authentication error -
401 Unauthorized -
404 Dataset not found -
400 Dataset name is invalid -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]

update_metadata_for_assets

DatasetResponse update_metadata_for_assets(dataset_id, update_asset_metadata_request)

Update asset metadata in an existing dataset

Example

  • Bearer Authentication (HTTPBearer):
import time
import coactive
from coactive.apis import DatasetApi
from coactive.model.update_asset_metadata_request import UpdateAssetMetadataRequest
from coactive.model.http_validation_error import HTTPValidationError
from coactive.model.error_response import ErrorResponse
from coactive.model.dataset_response import DatasetResponse

# Defining the host is optional and defaults to https://app.coactive.ai.

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Example with auth is provided below, use the example that
# satisfies your auth use case.


# Configure Bearer authorization: HTTPBearer


# See configuration.py for a list of all supported configuration parameters.

from YOUR_ENV import CLIENT_ID, CLIENT_SECRET


configuration = coactive.Configuration(
    host = "https://app.coactive.ai",
    access_token = f"{CLIENT_ID}:{CLIENT_SECRET}",
)

# Enter a context with an instance of the API client
with coactive.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = DatasetApi(api_client)
    dataset_id = "556f4d52-a557-461e-a204-69236fd9c1e2"
    update_asset_metadata_request = UpdateAssetMetadataRequest(
        items=[
            UpdateAssetMetadataItem(
                path="s3://your-s3-bucket/path/to/img.png",
                metadata={
                    "key": "key_example",
                },
            ),
        ],
    )

    # example passing only required values which don't have defaults set
    try:
        # Update asset metadata in an existing dataset
        api_response = api_instance.update_metadata_for_assets(dataset_id, update_asset_metadata_request)
        print(api_response)
    except coactive.ApiException as e:
        print("Exception when calling DatasetApi->update_metadata_for_assets: %s\n" % e)

Parameters

Name Type Description Notes
dataset_id str The unique identifier for the dataset
update_asset_metadata_request UpdateAssetMetadataRequest

Return type

DatasetResponse

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The metadata was updated successfully -
403 Authentication error -
401 Unauthorized -
404 Dataset not found -
422 Validation Error -

[Back to top] [Back to API list] [Back to Model list] [Back to home]