> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nimbleway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Media Download Async

> Download media from a URL asynchronously. Returns a task ID immediately.



## OpenAPI

````yaml /api-reference/openapi.json post /v2/media/async
openapi: 3.1.0
info:
  title: Nimble SDK
  version: 1.0.0
  description: The AI-Native SDK for Real-Time Web Data at scale
servers:
  - url: https://sdk.nimbleway.com
security: []
paths:
  /v2/media/async:
    post:
      tags:
        - Media
      summary: Media Download Async
      description: Download media from a URL asynchronously. Returns a task ID immediately.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MediaAsyncPayload'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaAsyncResponse'
          description: Task created successfully
      security:
        - BearerAuth: []
components:
  schemas:
    MediaAsyncPayload:
      allOf:
        - properties:
            country:
              type: string
            expected_mime_types:
              items:
                type: string
              type: array
            locale:
              type: string
            storage:
              properties:
                object_name:
                  type: string
                type:
                  default: s3
                  enum:
                    - s3
                    - gcs
                    - do
                    - oci
                  type: string
                url:
                  type: string
              required:
                - url
              type: object
            url:
              format: uri
              type: string
          required:
            - url
          type: object
        - properties:
            callback_url:
              description: URL to call back when async operation completes
              examples:
                - https://example.com/webhook/callback
              type: string
            storage_compress:
              description: Whether to compress stored data
              examples:
                - true
              type: boolean
            storage_object_name:
              description: Custom name for the stored object
              examples:
                - result-2024-01-15.json
              type: string
            storage_type:
              description: Type of storage to use for results
              examples:
                - s3
              type: string
            storage_url:
              description: URL for storage location
              examples:
                - s3://bucket-name/path/to/object
              type: string
          type: object
    MediaAsyncResponse:
      $ref: '#/components/schemas/ExtractAsyncResponse'
      description: Response when an async media download task is created successfully.
    ExtractAsyncResponse:
      additionalProperties: false
      description: Response when an async extract task is created successfully.
      properties:
        status:
          const: success
          description: Status indicating the async task was created successfully.
          type: string
        task:
          additionalProperties: false
          description: The created async task details.
          properties:
            _query: {}
            account_name:
              description: Account name that owns the task.
              type: string
            api_type:
              enum:
                - web
                - serp
                - ecommerce
                - social
                - media
                - agent
                - extract
                - fast-serp
                - labs
              type: string
            batch_id:
              anyOf:
                - type: string
                - type: 'null'
              description: Batch ID if this task is part of a batch.
              examples:
                - 4b0a90bf-c951-42e4-95b3-a95a65ba69fc
            created_at:
              description: Timestamp when the task was created.
              examples:
                - '2024-01-15T10:30:00Z'
              type: string
            download_url:
              anyOf:
                - format: uri
                  type: string
                - type: 'null'
              description: URL for downloading the task results.
              examples:
                - >-
                  https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000/results
            error:
              anyOf:
                - type: string
                - type: 'null'
              description: Error message if the task failed.
              examples:
                - Connection timeout
            error_type:
              anyOf:
                - type: string
                - type: 'null'
              description: Classification of the error type.
              examples:
                - timeout_error
            id:
              description: Unique task identifier.
              examples:
                - 123e4567-e89b-12d3-a456-426614174000
              minLength: 1
              type: string
            input:
              description: Original input data for the task.
            modified_at:
              description: Timestamp when the task was last modified.
              examples:
                - '2024-01-15T10:35:00Z'
              type: string
            output_url:
              anyOf:
                - type: string
                - type: 'null'
              description: Storage location of the output data.
            queue:
              description: Queue name the task was submitted to.
              type: string
            state:
              description: Current state of the task.
              enum:
                - pending
                - queued
                - in_progress
                - success
                - error
              examples:
                - pending
              type: string
            status_code:
              description: HTTP status code from the task execution.
              examples:
                - 200
              type: number
            status_url:
              description: URL for checking the task status.
              examples:
                - >-
                  https://api.webit.live/api/v2/tasks/123e4567-e89b-12d3-a456-426614174000
              format: uri
              type: string
          required:
            - id
            - state
            - status_url
            - created_at
            - input
            - _query
          type: object
      required:
        - status
        - task
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.