跳转到内容
AsterDrive Developer Docs开发者

create_team_offline_download_task

POST
/api/v1/teams/{team_id}/tasks/offline-download
curl --request POST \
--url https://example.com/api/v1/teams/1/tasks/offline-download \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "expected_sha256": "example", "filename": "example", "target_folder_id": 1, "url": "example" }'
team_id
required
integer format: int64

Team ID

Media typeapplication/json

Parameters for creating an offline download task.

object
expected_sha256

Optional expected SHA-256 checksum. Values are trimmed, lowercased, and must be a 64-character hexadecimal string without a 0x prefix, for example 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.

string | null
filename

Optional target filename. Empty values are ignored; non-empty values must pass normalize_validate_name, so path separators and unsafe Windows device names are rejected.

string | null
target_folder_id

Optional destination folder. None imports into the workspace root.

integer | null format: int64
url
required

Source URL validated by parse_and_validate_source_url; only http:// and https:// URLs with a host are accepted. Local or executable schemes such as file://, javascript:, and data: are rejected. Credentials in the URL userinfo component are rejected so they are not persisted in task payloads; query parameters are accepted, but display paths are derived through redact_url_for_display.

string

Example generated

{
"expected_sha256": "example",
"filename": "example",
"target_folder_id": 1,
"url": "example"
}

Team offline download task created

Media typeapplication/json
object
code
required
string
Allowed values: success bad_request not_found internal_server_error database.error config.error endpoint.not_found rate_limited operation.resource_limit_exceeded mail.not_configured mail.delivery_failed conflict config.public_site_url_required config.public_site_url_invalid admin.content_access_disabled admin.content_context_required admin.content_context_invalid admin.content_target_unavailable admin.content_reason_required admin.content_audit_unavailable auth.failed auth.token_expired auth.token_invalid forbidden auth.pending_activation auth.contact_verification_invalid auth.contact_verification_expired auth.token_missing auth.credentials_failed auth.mfa_failed auth.refresh_token_stale auth.refresh_token_reuse_detected file.not_found file.too_large file.type_not_allowed file.upload_failed upload.session_not_found upload.session_expired upload.chunk_failed upload.assembly_failed upload.target_capacity_insufficient upload.capacity_unavailable upload.staging_capacity_insufficient thumbnail.failed resource.locked precondition_failed upload.assembling storage.policy_not_found storage.driver_error storage.quota_exceeded storage.unsupported_driver storage.auth_failed storage.permission_denied storage.misconfigured storage.object_not_found storage.rate_limited storage.transient_failure storage.precondition_failed storage.operation_unsupported policy.blob_references_exist folder.not_found share.not_found share.expired share.password_required share.download_limit_reached archive_preview.disabled archive_preview.user_disabled archive_preview.share_disabled archive_preview.source_too_large archive_preview.invalid_archive archive_preview.manifest_too_large archive_preview.unsupported_type archive_preview.rejected archive_preview.source_size_mismatch archive_compress.disabled archive_download.user_disabled archive_download.share_disabled auth.username_exists auth.email_exists auth.identifier_exists auth.admin_required auth.account_disabled auth.request_source_untrusted auth.request_origin_untrusted auth.request_referer_untrusted auth.request_source_missing auth.session_user_mismatch auth.csrf_cookie_missing auth.csrf_header_missing auth.csrf_token_invalid auth.passkey_login_disabled auth.password_login_disabled auth.registration_disabled auth.email_blocked auth.email_not_allowlisted auth.mfa_flow_invalid auth.mfa_flow_expired auth.mfa_code_invalid auth.mfa_attempts_exceeded auth.mfa_factor_required auth.mfa_factor_already_exists auth.mfa_recovery_code_used auth.mfa_email_code_required auth.mfa_email_code_expired auth.invitation_invalid auth.invitation_expired auth.invitation_revoked auth.invitation_accepted auth.password_change_required avatar.file_required avatar.upload_read_failed avatar.processor_unavailable avatar.empty_image avatar.render_failed avatar.output_invalid file.name_conflict file.etag_mismatch file.modified_during_write folder.name_conflict trash.purge_in_progress lock.not_owner share.scope_denied remote_storage_target.binding_mismatch remote_storage_target.unavailable remote_storage_target.not_applied remote_storage_target.connector_unsupported remote_storage_target.local_path_invalid remote_storage_target.required remote_storage_target.referenced remote_storage_target.single_primary_required remote_storage_target.not_found master_binding.disabled passkey.name_invalid passkey.name_too_long passkey.not_discoverable team.not_member team.owner_required team.admin_or_owner_required policy.upload_sessions_exist policy.storage_access_key_required policy.storage_secret_key_required policy.storage_bucket_required policy.storage_endpoint_invalid policy.remote_node_required policy.remote_node_unexpected policy.remote_storage_target_required policy.remote_storage_location_immutable policy.remote_node_disabled policy.remote_node_base_url_required policy.remote_node_transfer_strategy_unsupported policy.onedrive_options_unsupported policy.sftp_options_unsupported policy.onedrive_account_mode_required policy.onedrive_personal_china_cloud_unsupported policy.onedrive_sharepoint_site_required policy.onedrive_group_required policy.native_thumbnail_unsupported policy.native_media_metadata_unsupported policy.action_unsupported policy.action_parameter_required policy.action_parameter_invalid policy.promotion_source_unsupported policy.promotion_source_config_unsupported policy.promotion_target_unsupported workspace.scope_denied external_auth.provider_disabled external_auth.policy_denied external_auth.callback_redirect_uri_required offline_download.aria2_rpc_auth_failed offline_download.aria2_rpc_probe_failed remote_node.disabled remote_node.enrollment_required remote_node.unique_conflict storage.auth storage.not_found storage.permission storage.precondition storage.transient storage.unsupported storage.unknown task.cancellation_requested task.cancel_not_allowed task.lease_lost task.lease_renewal_timed_out task.worker_shutdown_requested task.retry_status_conflict task.retry_not_allowed team.member_exists thumbnail.format_guess_failed thumbnail.decode_failed thumbnail.encode_failed thumbnail.source_open_failed thumbnail.source_stream_failed thumbnail.task_panicked thumbnail.source_too_large thumbnail.processor_unavailable thumbnail.render_failed thumbnail.output_invalid thumbnail.source_temp_create_failed thumbnail.source_temp_flush_failed thumbnail.source_temp_copy_failed wopi.public_site_url_required wopi.app_disabled wopi.request_origin_untrusted wopi.request_referer_untrusted upload.temp_dir_create_failed upload.temp_file_create_failed upload.temp_file_write_failed upload.temp_file_flush_failed upload.request_body_incomplete upload.request_body_read_failed upload.request_body_size_overflow upload.request_size_mismatch upload.hash_temp_open_failed upload.hash_temp_read_failed upload.field_read_failed upload.local_staging_path_resolve_failed upload.local_staging_dir_create_failed upload.local_staging_file_create_failed upload.local_staging_write_failed upload.local_staging_flush_failed upload.direct_relay_write_failed upload.direct_relay_shutdown_failed upload.direct_relay_task_failed upload.body_size_overflow upload.declared_size_invalid upload.empty_file upload.chunk_persist_failed upload.chunk_relay_failed upload.chunk_pending upload.chunk_transport_mismatch upload.chunk_session_invalid upload.chunk_number_out_of_range upload.chunk_size_mismatch upload.chunk_too_large upload.chunk_size_overflow upload.status_conflict upload.completed_file_missing upload.previous_failure upload.parts_required upload.incomplete_chunks upload.incomplete_parts upload.missing_part upload.temp_object_missing upload.temp_object_size_mismatch upload.final_object_size_mismatch upload.session_corrupted upload.part_numbers_empty upload.part_numbers_too_many upload.part_number_out_of_range upload.assembly_io_failed upload.assembly_size_overflow webdav.username_exists wopi.max_expected_size_exceeded validation.request_origin_invalid validation.request_referer_invalid validation.request_host_invalid validation.request_scheme_invalid validation.request_header_value_invalid validation.system_already_initialized validation.system_not_initialized search.query_empty search.type_invalid search.tag_match_invalid search.size_range_invalid search.file_filter_type_conflict search.mime_type_empty search.category_invalid search.extensions_invalid search.tag_ids_invalid search.date_invalid search.date_range_invalid internal_storage.range_length_invalid internal_storage.range_empty_object internal_storage.range_offset_out_of_bounds internal_storage.range_header_invalid internal_storage.range_multiple_unsupported internal_storage.range_bounds_invalid internal_storage.content_length_required internal_storage.content_length_invalid internal_storage.compose_parts_required internal_storage.compose_expected_size_invalid
data
object
attempt_count
required
integer format: int32
can_cancel
required

Whether this scoped user task can accept a cancellation request.

boolean
can_retry
required
boolean
created_at
required
string
creator
One of:

Lightweight user identity for embedding in admin list/detail responses.

object
id
required
integer format: int64
profile
required
object
avatar
required
object
source
required

用户头像来源

string
Allowed values: none gravatar upload
url_1024
string | null
url_512
string | null
version
required
integer format: int32
display_name
string | null
username
required
string
display_name
required
string
expires_at
required
string
finished_at
string | null
id
required
integer format: int64
kind
required

后台任务类型

string
Allowed values: archive_extract archive_compress archive_preview_generate thumbnail_generate image_preview_generate media_metadata_extract trash_purge_all folder_tree_mutation storage_policy_temp_cleanup storage_policy_migration storage_policy_forced_purge blob_maintenance offline_download system_runtime
last_error
string | null
lease_expires_at
string | null
max_attempts
required
integer format: int32
payload
required
One of:
object
archive_name
required
string
file_ids
required
Array<integer>
folder_ids
required
Array<integer>
target_folder_id
integer | null format: int64
kind
required
string
Allowed values: archive_compress
presentation
One of:
object
status
One of:
object
code
required
string
Allowed values: blob_maintenance_integrity_check_name blob_maintenance_orphan_cleanup_name blob_maintenance_ref_count_reconcile_name runtime_system_health_issue_detail runtime_task_audit_cleanup runtime_task_auth_session_cleanup runtime_task_background_task_dispatch runtime_task_blob_reconcile runtime_task_completed_upload_cleanup runtime_task_external_auth_flow_cleanup runtime_task_lock_cleanup runtime_task_mail_outbox_dispatch runtime_task_mfa_flow_cleanup runtime_task_remote_node_health_test runtime_task_system_health_check runtime_task_task_cleanup runtime_task_team_archive_cleanup runtime_task_trash_cleanup runtime_task_upload_cleanup runtime_task_wopi_session_cleanup status_text_archive_extracted status_text_archive_preview_ready status_text_archive_ready status_text_blob_maintenance_finished status_text_folder_tree_delete_finished status_text_folder_tree_mutation_scanning status_text_folder_tree_restore_finished status_text_image_preview_already_available status_text_image_preview_ready status_text_media_metadata_failed status_text_media_metadata_ready status_text_media_metadata_unsupported status_text_offline_download_imported status_text_offline_download_downloaded status_text_offline_download_verified status_text_storage_migration_completed status_text_storage_policy_forced_purge_completed status_text_system_healthy status_text_temporary_upload_cleanup_finished status_text_thumbnail_already_available status_text_thumbnail_ready status_text_trash_purged status_text_waiting_presigned_url_expiry task_name_archive_compress task_name_archive_extract task_name_archive_preview_generate task_name_archive_preview_generate_file_id task_name_folder_tree_delete task_name_folder_tree_restore task_name_image_preview_generate task_name_image_preview_generate_blob_with_processor task_name_media_metadata_extract_blob task_name_media_metadata_extract_source task_name_offline_download_source task_name_offline_download_source_with_engine task_name_offline_download_target_folder task_name_offline_download_target_folder_with_engine task_name_offline_download_url task_name_offline_download_url_with_engine task_name_storage_policy_migration task_name_storage_policy_forced_purge task_name_storage_policy_temp_cleanup task_name_storage_policy_temp_cleanup_policy_id task_name_thumbnail_generate task_name_thumbnail_generate_blob_with_processor task_name_trash_purge_all
params
object
key
additional properties
title
One of:
object
code
required
string
Allowed values: blob_maintenance_integrity_check_name blob_maintenance_orphan_cleanup_name blob_maintenance_ref_count_reconcile_name runtime_system_health_issue_detail runtime_task_audit_cleanup runtime_task_auth_session_cleanup runtime_task_background_task_dispatch runtime_task_blob_reconcile runtime_task_completed_upload_cleanup runtime_task_external_auth_flow_cleanup runtime_task_lock_cleanup runtime_task_mail_outbox_dispatch runtime_task_mfa_flow_cleanup runtime_task_remote_node_health_test runtime_task_system_health_check runtime_task_task_cleanup runtime_task_team_archive_cleanup runtime_task_trash_cleanup runtime_task_upload_cleanup runtime_task_wopi_session_cleanup status_text_archive_extracted status_text_archive_preview_ready status_text_archive_ready status_text_blob_maintenance_finished status_text_folder_tree_delete_finished status_text_folder_tree_mutation_scanning status_text_folder_tree_restore_finished status_text_image_preview_already_available status_text_image_preview_ready status_text_media_metadata_failed status_text_media_metadata_ready status_text_media_metadata_unsupported status_text_offline_download_imported status_text_offline_download_downloaded status_text_offline_download_verified status_text_storage_migration_completed status_text_storage_policy_forced_purge_completed status_text_system_healthy status_text_temporary_upload_cleanup_finished status_text_thumbnail_already_available status_text_thumbnail_ready status_text_trash_purged status_text_waiting_presigned_url_expiry task_name_archive_compress task_name_archive_extract task_name_archive_preview_generate task_name_archive_preview_generate_file_id task_name_folder_tree_delete task_name_folder_tree_restore task_name_image_preview_generate task_name_image_preview_generate_blob_with_processor task_name_media_metadata_extract_blob task_name_media_metadata_extract_source task_name_offline_download_source task_name_offline_download_source_with_engine task_name_offline_download_target_folder task_name_offline_download_target_folder_with_engine task_name_offline_download_url task_name_offline_download_url_with_engine task_name_storage_policy_migration task_name_storage_policy_forced_purge task_name_storage_policy_temp_cleanup task_name_storage_policy_temp_cleanup_policy_id task_name_thumbnail_generate task_name_thumbnail_generate_blob_with_processor task_name_trash_purge_all
params
object
key
additional properties
progress_current
required
integer format: int64
progress_percent
required
integer format: int32
progress_total
required
integer format: int64
result
One of:
One of:
object
target_file_id
required
integer format: int64
target_file_name
required
string
target_folder_id
integer | null format: int64
target_path
required
string
kind
required
string
Allowed values: archive_compress
share_id
integer | null format: int64
started_at
string | null
status
required

后台任务状态

string
Allowed values: pending processing canceling retry succeeded failed canceled
status_text
string | null
steps
required
Array<object>

Serialized task step shown in task APIs.

object
detail

Optional detail text.

string | null
finished_at

Step finish time.

string | null
key
required

Stable step key.

string
progress_current
required

Current progress amount.

integer format: int64
progress_total
required

Total progress amount.

integer format: int64
started_at

Step start time.

string | null
status
required

Current step status.

string
Allowed values: pending active succeeded failed skipped canceled
title
required

Human-readable step title.

string
team_id
integer | null format: int64
updated_at
required
string
error
object
diagnostic
object
field

Connector-owned field that caused a configuration validation failure.

This is intentionally optional so existing diagnostics remain wire-compatible.

string | null
kind
required
string
message
required
string
scope

Connector field scope, for example connector_config or static_credential.

string | null
retryable
required
boolean
msg
required
string

Example

{
"code": "success",
"data": {
"creator": {
"profile": {
"avatar": {
"source": "none"
}
}
},
"kind": "archive_extract",
"payload": {
"kind": "archive_compress"
},
"presentation": {
"status": {
"code": "blob_maintenance_integrity_check_name"
},
"title": {
"code": "blob_maintenance_integrity_check_name"
}
},
"result": {
"kind": "archive_compress"
},
"status": "pending",
"steps": [
{
"status": "pending"
}
]
}
}

Invalid offline download request

Unauthorized

Forbidden