--- title: 'Low-level API' linkTitle: 'Low-level API' weight: 3 description: '' --- ## Overview Low-level API is useful if you need to work directly with REST API, but want to have data validation and syntax assistance from your code editor. The code on this layer is autogenerated. Code of this component is located in `cvat_sdk.api_client`. ## Example Let's see how a task with local files can be created. We will use the basic auth to make things simpler. ```python from time import sleep from cvat_sdk.api_client import Configuration, ApiClient, models, apis, exceptions configuration = Configuration( host="http://localhost", username='YOUR_USERNAME', password='YOUR_PASSWORD', ) # Enter a context with an instance of the API client with ApiClient(configuration) as api_client: # Parameters can be passed as a plain dict with JSON-serialized data # or as model objects (from cvat_sdk.api_client.models), including # mixed variants. # # In case of dicts, keys must be the same as members of models.I # interfaces and values must be convertible to the corresponding member # value types (e.g. a date or string enum value can be parsed from a string). # # In case of model objects, data must be of the corresponding # models. types. # # Let's use a dict here. It should look like models.ITaskWriteRequest task_spec = { 'name': 'example task', "labels": [{ "name": "car", "color": "#ff00ff", "attributes": [ { "name": "a", "mutable": True, "input_type": "number", "default_value": "5", "values": ["4", "5", "6"] } ] }], } try: # Apis can be accessed as ApiClient class members # We use different models for input and output data. For input data, # models are typically called like "*Request". Output data models have # no suffix. (task, response) = api_client.tasks_api.create(task_spec) except exceptions.ApiException as e: # We can catch the basic exception type, or a derived type print("Exception when trying to create a task: %s\n" % e) # Here we will use models instead of a dict task_data = models.DataRequest( image_quality=75, client_files=[ open('image1.jpg', 'rb'), open('image2.jpg', 'rb'), ], ) # If we pass binary file objects, we need to specify content type. # For this endpoint, we don't have response data (_, response) = api_client.tasks_api.create_data(task.id, data_request=task_data, _content_type="multipart/form-data", # we can choose to check the response status manually # and disable the response data parsing _check_status=False, _parse_response=False ) assert response.status == 202, response.msg # Wait till task data is processed for _ in range(100): (status, _) = api_client.tasks_api.retrieve_status(task.id) if status.state.value in ['Finished', 'Failed']: break sleep(0.1) assert status.state.value == 'Finished', status.message # Update the task object and check the task size (task, _) = api_client.tasks_api.retrieve(task.id) assert task.size == 4 ``` ## Available API Endpoints All URIs are relative to _`http://localhost`_ APIs can be instanted directly like this: ```python from cvat_sdk.api_client import ApiClient, apis api_client = ApiClient(...) auth_api = apis.AuthApi(api_client) auth_api.(...) ``` Or they can be accessed as `ApiClient` object members: ``` from cvat_sdk.api_client import ApiClient api_client = ApiClient(...) api_client.auth_api.(...) ``` Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- _AuthApi_ | **auth_create_login** | **POST** /api/auth/login | _AuthApi_ | **auth_create_logout** | **POST** /api/auth/logout | _AuthApi_ | **auth_create_password_change** | **POST** /api/auth/password/change | _AuthApi_ | **auth_create_password_reset** | **POST** /api/auth/password/reset | _AuthApi_ | **auth_create_password_reset_confirm** | **POST** /api/auth/password/reset/confirm | _AuthApi_ | **auth_create_register** | **POST** /api/auth/register | _AuthApi_ | **auth_create_signing** | **POST** /api/auth/signing | This method signs URL for access to the server _CloudstoragesApi_ | **cloudstorages_create** | **POST** /api/cloudstorages | Method creates a cloud storage with a specified characteristics _CloudstoragesApi_ | **cloudstorages_destroy** | **DELETE** /api/cloudstorages/{id} | Method deletes a specific cloud storage _CloudstoragesApi_ | **cloudstorages_list** | **GET** /api/cloudstorages | Returns a paginated list of storages according to query parameters _CloudstoragesApi_ | **cloudstorages_partial_update** | **PATCH** /api/cloudstorages/{id} | Methods does a partial update of chosen fields in a cloud storage instance _CloudstoragesApi_ | **cloudstorages_retrieve** | **GET** /api/cloudstorages/{id} | Method returns details of a specific cloud storage _CloudstoragesApi_ | **cloudstorages_retrieve_actions** | **GET** /api/cloudstorages/{id}/actions | Method returns allowed actions for the cloud storage _CloudstoragesApi_ | **cloudstorages_retrieve_content** | **GET** /api/cloudstorages/{id}/content | Method returns a manifest content _CloudstoragesApi_ | **cloudstorages_retrieve_preview** | **GET** /api/cloudstorages/{id}/preview | Method returns a preview image from a cloud storage _CloudstoragesApi_ | **cloudstorages_retrieve_status** | **GET** /api/cloudstorages/{id}/status | Method returns a cloud storage status _CommentsApi_ | **comments_create** | **POST** /api/comments | Method creates a comment _CommentsApi_ | **comments_destroy** | **DELETE** /api/comments/{id} | Method deletes a comment _CommentsApi_ | **comments_list** | **GET** /api/comments | Method returns a paginated list of comments according to query parameters _CommentsApi_ | **comments_partial_update** | **PATCH** /api/comments/{id} | Methods does a partial update of chosen fields in a comment _CommentsApi_ | **comments_retrieve** | **GET** /api/comments/{id} | Method returns details of a comment _InvitationsApi_ | **invitations_create** | **POST** /api/invitations | Method creates an invitation _InvitationsApi_ | **invitations_destroy** | **DELETE** /api/invitations/{key} | Method deletes an invitation _InvitationsApi_ | **invitations_list** | **GET** /api/invitations | Method returns a paginated list of invitations according to query parameters _InvitationsApi_ | **invitations_partial_update** | **PATCH** /api/invitations/{key} | Methods does a partial update of chosen fields in an invitation _InvitationsApi_ | **invitations_retrieve** | **GET** /api/invitations/{key} | Method returns details of an invitation _IssuesApi_ | **issues_create** | **POST** /api/issues | Method creates an issue _IssuesApi_ | **issues_destroy** | **DELETE** /api/issues/{id} | Method deletes an issue _IssuesApi_ | **issues_list** | **GET** /api/issues | Method returns a paginated list of issues according to query parameters _IssuesApi_ | **issues_list_comments** | **GET** /api/issues/{id}/comments | The action returns all comments of a specific issue _IssuesApi_ | **issues_partial_update** | **PATCH** /api/issues/{id} | Methods does a partial update of chosen fields in an issue _IssuesApi_ | **issues_retrieve** | **GET** /api/issues/{id} | Method returns details of an issue _JobsApi_ | **jobs_create_annotations** | **POST** /api/jobs/{id}/annotations/ | Method allows to upload job annotations _JobsApi_ | **jobs_destroy_annotations** | **DELETE** /api/jobs/{id}/annotations/ | Method deletes all annotations for a specific job _JobsApi_ | **jobs_list** | **GET** /api/jobs | Method returns a paginated list of jobs according to query parameters _JobsApi_ | **jobs_list_commits** | **GET** /api/jobs/{id}/commits | The action returns the list of tracked changes for the job _JobsApi_ | **jobs_list_issues** | **GET** /api/jobs/{id}/issues | Method returns list of issues for the job _JobsApi_ | **jobs_partial_update** | **PATCH** /api/jobs/{id} | Methods does a partial update of chosen fields in a job _JobsApi_ | **jobs_partial_update_annotations** | **PATCH** /api/jobs/{id}/annotations/ | Method performs a partial update of annotations in a specific job _JobsApi_ | **jobs_partial_update_annotations_file** | **PATCH** /api/jobs/{id}/annotations/{file_id} | Allows to upload an annotation file chunk. Implements TUS file uploading protocol. _JobsApi_ | **jobs_retrieve** | **GET** /api/jobs/{id} | Method returns details of a job _JobsApi_ | **jobs_retrieve_annotations** | **GET** /api/jobs/{id}/annotations/ | Method returns annotations for a specific job as a JSON document. If format is specified a zip archive is returned. _JobsApi_ | **jobs_retrieve_data** | **GET** /api/jobs/{id}/data | Method returns data for a specific job _JobsApi_ | **jobs_retrieve_data_meta** | **GET** /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job _JobsApi_ | **jobs_retrieve_dataset** | **GET** /api/jobs/{id}/dataset | Export job as a dataset in a specific format _JobsApi_ | **jobs_update_annotations** | **PUT** /api/jobs/{id}/annotations/ | Method performs an update of all annotations in a specific job _LambdaApi_ | **lambda_create_functions** | **POST** /api/lambda/functions/{func_id} | _LambdaApi_ | **lambda_create_requests** | **POST** /api/lambda/requests | Method calls the function _LambdaApi_ | **lambda_list_functions** | **GET** /api/lambda/functions | Method returns a list of functions _LambdaApi_ | **lambda_list_requests** | **GET** /api/lambda/requests | Method returns a list of requests _LambdaApi_ | **lambda_retrieve_functions** | **GET** /api/lambda/functions/{func_id} | Method returns the information about the function _LambdaApi_ | **lambda_retrieve_requests** | **GET** /api/lambda/requests/{id} | Method returns the status of the request _MembershipsApi_ | **memberships_destroy** | **DELETE** /api/memberships/{id} | Method deletes a membership _MembershipsApi_ | **memberships_list** | **GET** /api/memberships | Method returns a paginated list of memberships according to query parameters _MembershipsApi_ | **memberships_partial_update** | **PATCH** /api/memberships/{id} | Methods does a partial update of chosen fields in a membership _MembershipsApi_ | **memberships_retrieve** | **GET** /api/memberships/{id} | Method returns details of a membership _OrganizationsApi_ | **organizations_create** | **POST** /api/organizations | Method creates an organization _OrganizationsApi_ | **organizations_destroy** | **DELETE** /api/organizations/{id} | Method deletes an organization _OrganizationsApi_ | **organizations_list** | **GET** /api/organizations | Method returns a paginated list of organizatins according to query parameters _OrganizationsApi_ | **organizations_partial_update** | **PATCH** /api/organizations/{id} | Methods does a partial update of chosen fields in an organization _OrganizationsApi_ | **organizations_retrieve** | **GET** /api/organizations/{id} | Method returns details of an organization _ProjectsApi_ | **projects_create** | **POST** /api/projects | Method creates a new project _ProjectsApi_ | **projects_create_backup** | **POST** /api/projects/backup/ | Methods create a project from a backup _ProjectsApi_ | **projects_create_dataset** | **POST** /api/projects/{id}/dataset/ | Import dataset in specific format as a project _ProjectsApi_ | **projects_destroy** | **DELETE** /api/projects/{id} | Method deletes a specific project _ProjectsApi_ | **projects_list** | **GET** /api/projects | Returns a paginated list of projects according to query parameters (12 projects per page) _ProjectsApi_ | **projects_list_tasks** | **GET** /api/projects/{id}/tasks | Method returns information of the tasks of the project with the selected id _ProjectsApi_ | **projects_partial_update** | **PATCH** /api/projects/{id} | Methods does a partial update of chosen fields in a project _ProjectsApi_ | **projects_partial_update_backup_file** | **PATCH** /api/projects/backup/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol _ProjectsApi_ | **projects_partial_update_dataset_file** | **PATCH** /api/projects/{id}/dataset/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. _ProjectsApi_ | **projects_retrieve** | **GET** /api/projects/{id} | Method returns details of a specific project _ProjectsApi_ | **projects_retrieve_annotations** | **GET** /api/projects/{id}/annotations | Method allows to download project annotations _ProjectsApi_ | **projects_retrieve_backup** | **GET** /api/projects/{id}/backup | Methods creates a backup copy of a project _ProjectsApi_ | **projects_retrieve_dataset** | **GET** /api/projects/{id}/dataset/ | Export project as a dataset in a specific format _RestrictionsApi_ | **restrictions_retrieve_terms_of_use** | **GET** /api/restrictions/terms-of-use | Method provides CVAT terms of use _RestrictionsApi_ | **restrictions_retrieve_user_agreements** | **GET** /api/restrictions/user-agreements | Method provides user agreements that the user must accept to register _SchemaApi_ | **schema_retrieve** | **GET** /api/schema/ | _ServerApi_ | **server_create_exception** | **POST** /api/server/exception | Method saves an exception from a client on the server _ServerApi_ | **server_create_logs** | **POST** /api/server/logs | Method saves logs from a client on the server _ServerApi_ | **server_list_share** | **GET** /api/server/share | Returns all files and folders that are on the server along specified path _ServerApi_ | **server_retrieve_about** | **GET** /api/server/about | Method provides basic CVAT information _ServerApi_ | **server_retrieve_annotation_formats** | **GET** /api/server/annotation/formats | Method provides the list of supported annotations formats _ServerApi_ | **server_retrieve_plugins** | **GET** /api/server/plugins | Method provides allowed plugins _TasksApi_ | **jobs_partial_update_data_meta** | **PATCH** /api/jobs/{id}/data/meta | Method provides a meta information about media files which are related with the job _TasksApi_ | **tasks_create** | **POST** /api/tasks | Method creates a new task in a database without any attached images and videos _TasksApi_ | **tasks_create_annotations** | **POST** /api/tasks/{id}/annotations/ | Method allows to upload task annotations from a local file or a cloud storage _TasksApi_ | **tasks_create_backup** | **POST** /api/tasks/backup/ | Method recreates a task from an attached task backup file _TasksApi_ | **tasks_create_data** | **POST** /api/tasks/{id}/data/ | Method permanently attaches images or video to a task. Supports tus uploads, see more _TasksApi_ | **tasks_destroy** | **DELETE** /api/tasks/{id} | Method deletes a specific task, all attached jobs, annotations, and data _TasksApi_ | **tasks_destroy_annotations** | **DELETE** /api/tasks/{id}/annotations/ | Method deletes all annotations for a specific task _TasksApi_ | **tasks_list** | **GET** /api/tasks | Returns a paginated list of tasks according to query parameters (10 tasks per page) _TasksApi_ | **tasks_list_jobs** | **GET** /api/tasks/{id}/jobs | Method returns a list of jobs for a specific task _TasksApi_ | **tasks_partial_update** | **PATCH** /api/tasks/{id} | Methods does a partial update of chosen fields in a task _TasksApi_ | **tasks_partial_update_annotations** | **PATCH** /api/tasks/{id}/annotations/ | Method performs a partial update of annotations in a specific task _TasksApi_ | **tasks_partial_update_annotations_file** | **PATCH** /api/tasks/{id}/annotations/{file_id} | Allows to upload an annotation file chunk. Implements TUS file uploading protocol. _TasksApi_ | **tasks_partial_update_backup_file** | **PATCH** /api/tasks/backup/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. _TasksApi_ | **tasks_partial_update_data_file** | **PATCH** /api/tasks/{id}/data/{file_id} | Allows to upload a file chunk. Implements TUS file uploading protocol. _TasksApi_ | **tasks_partial_update_data_meta** | **PATCH** /api/tasks/{id}/data/meta | Method provides a meta information about media files which are related with _he_task _TasksApi_ | **tasks_retrieve** | **GET** /api/tasks/{id} | Method returns details of a specific task _TasksApi_ | **tasks_retrieve_annotations** | **GET** /api/tasks/{id}/annotations/ | Method allows to download task annotations _TasksApi_ | **tasks_retrieve_backup** | **GET** /api/tasks/{id}/backup | Method backup a specified task _TasksApi_ | **tasks_retrieve_data** | **GET** /api/tasks/{id}/data/ | Method returns data for a specific task _TasksApi_ | **tasks_retrieve_data_meta** | **GET** /api/tasks/{id}/data/meta | Method provides a meta information about media files which are related with the task _TasksApi_ | **tasks_retrieve_dataset** | **GET** /api/tasks/{id}/dataset | Export task as a dataset in a specific format _TasksApi_ | **tasks_retrieve_status** | **GET** /api/tasks/{id}/status | When task is being created the method returns information about a status of the creation process _TasksApi_ | **tasks_update_annotations** | **PUT** /api/tasks/{id}/annotations/ | Method allows to upload task annotations _UsersApi_ | **users_destroy** | **DELETE** /api/users/{id} | Method deletes a specific user from the server _UsersApi_ | **users_list** | **GET** /api/users | Method provides a paginated list of users registered on the server _UsersApi_ | **users_partial_update** | **PATCH** /api/users/{id} | Method updates chosen fields of a user _UsersApi_ | **users_retrieve** | **GET** /api/users/{id} | Method provides information of a specific user _UsersApi_ | **users_retrieve_self** | **GET** /api/users/self | Method returns an instance of a user who is currently authorized ## Available Models Models can be instantiated like this: ```python from cvat_sdk.api_client import models user_model = models.User(...) ``` - About - AnnotationFileRequest - AnnotationsRead - Attribute - AttributeRequest - AttributeVal - AttributeValRequest - BackupWriteRequest - BasicUser - BasicUserRequest - ChunkType - CloudStorageRead - CloudStorageWriteRequest - CommentRead - CommentReadOwner - CommentWriteRequest - CredentialsTypeEnum - DataMetaRead - DataRequest - DatasetFileRequest - DatasetFormat - DatasetFormats - DatasetWriteRequest - Exception - ExceptionRequest - FileInfo - FileInfoTypeEnum - FrameMeta - InputTypeEnum - InvitationRead - InvitationWrite - InvitationWriteRequest - IssueRead - IssueWriteRequest - JobAnnotationsUpdateRequest - JobCommit - JobRead - JobStage - JobStatus - Label - LabeledData - LabeledDataRequest - LabeledImage - LabeledImageRequest - LabeledShape - LabeledShapeRequest - LabeledTrack - LabeledTrackRequest - LocationEnum - LogEvent - LogEventRequest - LoginRequest - Manifest - ManifestRequest - MembershipRead - MembershipWrite - MetaUser - OperationStatus - OrganizationRead - OrganizationWrite - OrganizationWriteRequest - PaginatedCloudStorageReadList - PaginatedCommentReadList - PaginatedInvitationReadList - PaginatedIssueReadList - PaginatedJobCommitList - PaginatedJobReadList - PaginatedMembershipReadList - PaginatedMetaUserList - PaginatedPolymorphicProjectList - PaginatedTaskReadList - PasswordChangeRequest - PasswordResetConfirmRequest - PasswordResetSerializerExRequest - PatchedCloudStorageWriteRequest - PatchedCommentWriteRequest - PatchedDataMetaWriteRequest - PatchedInvitationWriteRequest - PatchedIssueWriteRequest - PatchedJobWriteRequest - PatchedLabelRequest - PatchedLabeledDataRequest - PatchedMembershipWriteRequest - PatchedOrganizationWriteRequest - PatchedProjectWriteRequest - PatchedProjectWriteRequestTargetStorage - PatchedTaskWriteRequest - PatchedTaskWriteRequestTargetStorage - PatchedUserRequest - Plugins - PolymorphicProject - ProjectFileRequest - ProjectRead - ProjectReadAssignee - ProjectReadOwner - ProjectReadTargetStorage - ProjectSearch - ProjectWriteRequest - ProviderTypeEnum - RestAuthDetail - RestrictedRegister - RestrictedRegisterRequest - RoleEnum - RqStatus - RqStatusStateEnum - Segment - ShapeType - SigningRequest - SimpleJob - SortingMethod - Storage - StorageMethod - StorageRequest - StorageType - SubLabeledShape - SubLabeledShapeRequest - SubLabeledTrack - SubLabeledTrackRequest - Sublabel - SublabelRequest - TaskAnnotationsUpdateRequest - TaskAnnotationsWriteRequest - TaskFileRequest - TaskRead - TaskReadTargetStorage - TaskWriteRequest - Token - TrackedShape - TrackedShapeRequest - User - UserAgreement - UserAgreementRequest