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

# Create a Web Archive destination

> Save an S3, GCS, Azure Blob, OCI or Alibaba OSS bucket as a Web Archive destination. POST /webarchive/destinations validates it with a test upload.

`POST /webarchive/destinations` saves a bucket, an optional prefix and the credentials to write to it, validates the bucket with a real test upload and returns the destination with its `id`.

> [!NOTE]
>
> **What create does depends on `auth_mode`:**
>
> * `access_keys`, `service_account_key`, `shared_key`, `sas_token`: validated before it is stored. On failure nothing is stored: `422 destination_validation_failed`, `503 destination_validation_unavailable` or `429 destination_validation_busy`.
> * `assume_role`: stored first, then validated in the same request (up to about 75 seconds). Always `200`; check `validation.status`.

> [!WARNING]
>
> Each create makes a new destination, even with an identical body. Don't retry a create blindly after a timeout: [list your destinations](https://docs.brightdata.com/api-reference/archive-api/list-destinations.md) first.

> [!NOTE]
>
> To use an IAM role, allow `arn:aws:iam::422310177405:role/brd.ec2.zs-dca-delivery` to call `sts:AssumeRole` in the trust policy of the role, and require your Bright Data **Account ID** from [Account Settings](https://brightdata.com/cp/setting/customer_details) as the external ID:
>
> ```json theme={null}
> {
>   "Version": "2012-10-17",
>   "Statement": [{
>     "Effect": "Allow",
>     "Principal": {"AWS": "arn:aws:iam::422310177405:role/brd.ec2.zs-dca-delivery"},
>     "Action": "sts:AssumeRole",
>     "Condition": {"StringEquals": {"sts:ExternalId": "YOUR_ACCOUNT_ID"}}
>   }]
> }
> ```
>
> The role needs `s3:PutObject` and `s3:AbortMultipartUpload` on the bucket.

An account can hold up to 100 destinations. Create is limited to 10 requests per minute and 60 per hour.


## OpenAPI

````yaml api-reference/web-archive-api POST /webarchive/destinations
openapi: 3.1.0
info:
  title: BrightData Web Archive API
  version: 1.0.0
  description: API to search and retrieve archived web pages.
servers:
  - url: https://api.brightdata.com
security:
  - bearerAuth: []
paths:
  /webarchive/destinations:
    post:
      summary: Create a destination
      description: >-
        Saves a delivery bucket and its credentials, validates it with a test
        upload and returns the destination. With `access_keys`,
        `service_account_key`, `shared_key` or `sas_token`, the destination is
        validated before it is stored; when validation fails nothing is stored.
        With `assume_role`, the destination is stored first and then validated
        in the same request; check `validation.status`. Each request creates a
        new destination, even with an identical body. Limited to 10 requests per
        minute and 60 per hour.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DestinationCreateRequest'
            examples:
              S3AccessKeys:
                summary: Amazon S3 with access keys
                value:
                  name: archive snapshots
                  bucket: my-bucket
                  prefix: brightdata/archive
                  credentials:
                    access_key_id: AKIA...
                    secret_access_key: ...
              S3AssumeRole:
                summary: Amazon S3 with an IAM role
                value:
                  name: archive via role
                  bucket: my-bucket
                  auth_mode: assume_role
                  role_arn: arn:aws:iam::123456789012:role/brightdata-delivery
                  region_hint: eu-west-1
              GCS:
                summary: Google Cloud Storage with a service account key
                value:
                  name: archive gcs
                  provider: gcs
                  auth_mode: service_account_key
                  bucket: my-gcs-bucket
                  credentials:
                    project_id: my-project
                    client_email: delivery@my-project.iam.gserviceaccount.com
                    private_key: |
                      -----BEGIN PRIVATE KEY-----
                      ...
                      -----END PRIVATE KEY-----
              AzureSasToken:
                summary: Azure Blob Storage with a SAS token
                value:
                  name: archive azure
                  provider: azure
                  auth_mode: sas_token
                  account: mystorageaccount
                  bucket: archive-container
                  credentials:
                    sas_token: sv=2024-11-04&ss=b&srt=co&sp=cw&se=...&sig=...
              OCI:
                summary: Oracle Cloud (OCI) Object Storage
                value:
                  name: archive oci
                  provider: oci
                  namespace: mytenancyns
                  region: us-ashburn-1
                  bucket: archive-bucket
                  credentials:
                    access_key_id: ...
                    secret_access_key: ...
              AlibabaOSS:
                summary: Alibaba Cloud OSS
                value:
                  name: archive oss
                  provider: ali_oss
                  region: oss-cn-hangzhou
                  bucket: archive-bucket
                  credentials:
                    access_key_id: LTAI...
                    secret_access_key: ...
      responses:
        '200':
          description: >-
            Destination created. For `assume_role`, a 200 response does not mean
            the bucket is valid: check `validation.status`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Destination'
              examples:
                Valid:
                  summary: S3 destination validated on create
                  value:
                    id: dst_0123456789abcdef0123456789abcdef
                    customer_id: YOUR_ACCOUNT_ID
                    name: archive snapshots
                    target:
                      provider: s3
                      auth_mode: access_keys
                      bucket: my-bucket
                      prefix: brightdata/archive
                    validation:
                      status: valid
                      checks:
                        location: true
                        multipart_abort: true
                        multipart_write: true
                        list: true
                        read: true
                      probe_key: brightdata/archive/.brd-destination-probe/...
                      probe_deleted: true
                      location:
                        provider: s3
                        regions:
                          - eu-west-1
                        type: single
                        source: GetBucketLocation
                        checked_at: '2026-11-20T10:00:00.000Z'
                      checked_at: '2026-11-20T10:00:00.000Z'
                      expires_at: '2026-11-21T10:00:00.000Z'
                    target_revision: 1
                    auth_revision: 1
                    next_validation_at: '2026-11-20T10:05:00.000Z'
                    created_at: '2026-11-20T10:00:00.000Z'
                    updated_at: '2026-11-20T10:00:00.000Z'
        '400':
          description: '`invalid_destination`: a field is missing or malformed.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DestinationError'
        '401':
          description: Missing or invalid API key.
        '409':
          description: >-
            `destination_limit_reached`: the account already has 100
            destinations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DestinationError'
        '422':
          description: >-
            `destination_validation_failed`: Bright Data can't write to the
            bucket with these credentials. Nothing was stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DestinationError'
        '429':
          description: >-
            `destination_validation_busy`: too many validations at once; retry
            shortly. Also returned when the rate limit is exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DestinationError'
        '503':
          description: >-
            `destination_validation_unavailable`: the storage provider didn't
            answer; nothing was stored. `destination_unavailable`: temporary
            error. Retry both.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DestinationError'
components:
  schemas:
    DestinationCreateRequest:
      type: object
      required:
        - name
        - bucket
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
          description: Printable ASCII, up to 80 characters.
          example: archive snapshots
        provider:
          type: string
          enum:
            - s3
            - gcs
            - azure
            - oci
            - ali_oss
          default: s3
          description: Storage provider.
        auth_mode:
          type: string
          enum:
            - access_keys
            - assume_role
            - service_account_key
            - shared_key
            - sas_token
          description: >-
            `s3`: `access_keys` (default) or `assume_role`. `gcs`:
            `service_account_key` (required). `azure`: `shared_key` or
            `sas_token` (required). `oci` and `ali_oss`: `access_keys`
            (default).
        bucket:
          type: string
          pattern: ^[^/]+$
          description: Bucket name only, without `/`. For Azure, the container name.
          example: my-bucket
        account:
          type: string
          description: >-
            Azure only, required. Storage account name: the `<account>` of
            `https://<account>.blob.core.windows.net`.
          example: mystorageaccount
        namespace:
          type: string
          description: OCI only, required. Object Storage namespace of your tenancy.
          example: mytenancyns
        region:
          type: string
          description: >-
            OCI and Alibaba Cloud OSS only, required. OCI region identifier, for
            example `us-ashburn-1`, or OSS region ID with its `oss-` prefix, for
            example `oss-cn-hangzhou`.
          example: us-ashburn-1
        prefix:
          type: string
          maxLength: 1024
          description: >-
            Default folder of the deliveries. Must not end with `/`. Can't be
            changed later.
          example: brightdata/archive
        role_arn:
          type: string
          pattern: ^arn:aws:iam::[0-9]{12}:role/.+$
          description: >-
            `assume_role` only, required. The IAM role Bright Data assumes, with
            your Bright Data Account ID as the external ID.
          example: arn:aws:iam::123456789012:role/brightdata-delivery
        region_hint:
          type: string
          description: >-
            S3 only. With `access_keys`, where the region lookup starts. With
            `assume_role`, the bucket region until a validation finds the real
            one; it sets the price of deliveries until then.
          example: eu-west-1
        credentials:
          $ref: '#/components/schemas/DestinationCredentials'
    Destination:
      type: object
      properties:
        id:
          type: string
          description: Destination ID
          example: dst_0123456789abcdef0123456789abcdef
        customer_id:
          type: string
          description: Your Bright Data Account ID
        name:
          type: string
        target:
          type: object
          description: Where Bright Data writes. Credentials are never returned.
          properties:
            provider:
              type: string
              enum:
                - s3
                - gcs
                - azure
                - oci
                - ali_oss
            auth_mode:
              type: string
            bucket:
              type: string
            prefix:
              type: string
            account:
              type: string
            namespace:
              type: string
            region:
              type: string
            role_arn:
              type: string
            region_hint:
              type: string
        validation:
          $ref: '#/components/schemas/DestinationValidation'
        firehose_validation:
          $ref: '#/components/schemas/DestinationValidation'
          description: >-
            `assume_role` only. Result of the same test with the Bright Data
            Data Firehose role. For information only: it doesn't change
            `validation.status`.
        target_revision:
          type: integer
          description: Increases when the target changes
        auth_revision:
          type: integer
          description: Increases when the credentials or role change
        next_validation_at:
          type: string
          format: date-time
          description: Earliest time of the next validation
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    DestinationError:
      type: object
      required:
        - error_code
      properties:
        error_code:
          type: string
          enum:
            - invalid_destination
            - invalid_destination_request
            - destination_not_found
            - destination_in_use
            - destination_changed
            - destination_limit_reached
            - destination_validation_superseded
            - destination_validation_failed
            - destination_validation_cooldown
            - destination_validation_busy
            - destination_validation_unavailable
            - destination_unavailable
    DestinationCredentials:
      description: >-
        Required for every `auth_mode` except `assume_role`. Up to 8 KiB. Stored
        encrypted and never returned. On update, replaced as a whole.
      oneOf:
        - title: Access keys (S3, OCI, Alibaba OSS)
          type: object
          required:
            - access_key_id
            - secret_access_key
          properties:
            access_key_id:
              type: string
              maxLength: 128
              description: >-
                AWS access key ID, OCI Customer Secret Key access key or Alibaba
                Cloud AccessKey ID.
            secret_access_key:
              type: string
              maxLength: 256
              description: The matching secret.
        - title: Service account key (GCS)
          type: object
          required:
            - project_id
            - client_email
            - private_key
          properties:
            project_id:
              type: string
              description: '`project_id` from the service account JSON key file.'
            client_email:
              type: string
              description: '`client_email` from the service account JSON key file.'
            private_key:
              type: string
              description: >-
                `private_key` from the service account JSON key file, with its
                `\n` line breaks JSON-escaped once.
        - title: Shared key (Azure)
          type: object
          required:
            - key
          properties:
            key:
              type: string
              description: Storage account access key.
        - title: SAS token (Azure)
          type: object
          required:
            - sas_token
          properties:
            sas_token:
              type: string
              maxLength: 4096
              description: >-
                Query string of a SAS URL without the leading `?`. Needs create
                and write permissions on the container.
    DestinationValidation:
      type: object
      description: Result of the last test upload.
      properties:
        status:
          type: string
          enum:
            - valid
            - expired
            - invalid
            - unavailable
            - unverified
            - validating
          description: >-
            `valid`: Bright Data can write to the bucket. `expired`: was valid
            more than 24 hours ago; deliveries are not blocked. `invalid`:
            Bright Data can't write; see `error_code`, `stage` and `checks`.
            `unavailable`: validation couldn't run; try again. `unverified`:
            stored but not validated yet. `validating`: a validation is running.
        error_code:
          type: string
          description: >-
            Why validation failed, for example `s3_access_denied`,
            `s3_assume_role_denied` or `region_mismatch`.
        stage:
          type: string
          description: Test step that failed.
        checks:
          type: object
          description: >-
            One key per test step. `true`: passed. `false`: ran and was denied.
            A missing key: the step was not reached.
          additionalProperties:
            type: boolean
        probe_key:
          type: string
          description: Path of the test object, under `<prefix>/.brd-destination-probe/`.
        probe_deleted:
          type: boolean
          description: >-
            `false` when the credentials can't delete and the test object stays
            in the bucket.
        location:
          type: object
          description: Bucket region found by validation.
          properties:
            provider:
              type: string
            regions:
              type: array
              items:
                type: string
            type:
              type: string
            source:
              type: string
            checked_at:
              type: string
              format: date-time
        checked_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
          description: >-
            When a `valid` result shows as `expired`: 24 hours after
            `checked_at`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use your Bright Data API Key as a Bearer token in the Authorization
        header.


        **How to authenticate:**

        1. Obtain your API Key from the Bright Data account settings at
        https://brightdata.com/cp/setting/users

        2. Include the API Key in the Authorization header of your requests

        3. Format: `Authorization: Bearer YOUR_API_KEY`


        **Example:**

        ```

        Authorization: Bearer
        b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df

        ```


        Learn how to get your Bright Data API key:
        https://docs.brightdata.com/api-reference/authentication
      bearerFormat: API Key

````