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

# Apify

> Actors, runs, datasets, key-value stores, and request queues.

Apify is included in Archal's environment catalog. Use it in a sandbox for actors, runs, datasets, key-value stores, and request queues.

|                 |                                              |
| --------------- | -------------------------------------------- |
| Environment ID  | `apify`                                      |
| Transport       | REST                                         |
| State           | JSON                                         |
| Contract        | `archal.environment-state.apify` version `1` |
| Channel         | Preview                                      |
| Curated samples | 5                                            |

Preview means the environment is included for testing, but its upstream coverage is incomplete. Verify the operations your test depends on.

## Compatibility boundary

**Local catalog validation:** All five published samples passed. Checks cover the state contract, relationships, artifact hash, secret scan, and size limit.

<Note>
  Local catalog validation is not hosted proof. Archal checks current certification, reset, and isolation evidence before admitting new sandboxes. Use the authenticated environment catalog for live availability.
</Note>

* Does not claim complete Apify actor execution or platform parity.

## Curated starting states

List the five samples with `archal sample list apify`. Each sample is a versioned starting state with a representative read, mutation, expected diff, reset expectation, and verified artifact hash.

<AccordionGroup>
  <Accordion title="Apify request queue baseline">
    List one deterministic request queue and create a second queue without actor-run noise.

    **Sample ID:** `apify.request-queue-baseline.v1`

    **Category:** `minimal`

    **Starting state:** 1 record across `requestQueues`: 1

    **Supported surface:** Stateful actor storage, dataset, key-value-store, and request-queue operations.

    **Required capabilities:** `state.read`, `state.load`, `state.reset`, `rest.request-queues`

    **First read:** `GET /v2/request-queues`. Expected result: HTTP 200.

    **Representative mutation:** `POST /v2/request-queues`. Expected result: HTTP 200, 201, 204.

    **Mutation input**

    ```json theme={null}
    {
      "name": "priority-docs-recrawl"
    }
    ```

    **Expected diff:** changes include `requestQueues`. Exact match required: no. Hosted promotion must observe every listed path after the provider-native mutation; dynamic provider ids and timestamps are excluded from exact matching.

    **Expected reset:** restores loaded sample.

    **Known limits**

    * Does not claim complete Apify actor execution or platform parity.

    **Start this sample**

    ```bash theme={null}
    archal sample show apify.request-queue-baseline.v1 --raw > archal-apify-request-queue-baseline.json
    archal state validate apify archal-apify-request-queue-baseline.json
    archal session create apify \
      --state apify=archal-apify-request-queue-baseline.json
    ```

    **Inspect the raw state**

    ```bash theme={null}
    archal sample show apify.request-queue-baseline.v1 --raw
    ```

    The packaged JSON artifact is `samples/states/apify/request-queue-baseline/state.json` and is 463 bytes. The CLI verifies SHA-256 `2bf2c930b365808711bf608ccabb78848a946d317b496701414737baf01ef914` before printing it.

    Catalog validation: **Passed**. Hosted availability is determined by Archal's live certification and admission system, not this static page.
  </Accordion>

  <Accordion title="Apify actor storage team">
    Inspect six provider audit outcomes, retained run inputs and outputs, and a three-item follow-up queue before adding another exact provider check.

    **Sample ID:** `apify.actor-storage-team.v1`

    **Category:** `small-team`

    **Starting state:** 4 records across `actors`: 1, `datasets`: 1, `keyValueStores`: 1, `requestQueues`: 1

    **Supported surface:** Stateful actor storage, dataset, key-value-store, and request-queue operations.

    **Required capabilities:** `state.read`, `state.load`, `state.reset`, `rest.request-queues`

    **First read:** `GET /v2/datasets/q8tJp3cNk7vL2sXwZ/items?offset=0&limit=4&clean=1`. Expected result: HTTP 200.

    **Representative mutation:** `POST /v2/request-queues/r4Vm8pQa2nK7sTcL9/requests`. Expected result: HTTP 201.

    **Mutation input**

    ```json theme={null}
    {
      "method": "GET",
      "uniqueKey": "verify:stripe:refund-idempotency",
      "url": "https://example.test/providers/stripe/refund-idempotency"
    }
    ```

    **Expected diff:** changes include `requestQueues`. Exact match required: no. Hosted promotion must observe every listed path after the provider-native mutation; dynamic provider ids and timestamps are excluded from exact matching.

    **Expected reset:** restores loaded sample.

    **Known limits**

    * Does not claim complete Apify actor execution or platform parity.

    **Start this sample**

    ```bash theme={null}
    archal sample show apify.actor-storage-team.v1 --raw > archal-apify-actor-storage-team.json
    archal state validate apify archal-apify-actor-storage-team.json
    archal session create apify \
      --state apify=archal-apify-actor-storage-team.json
    ```

    **Inspect the raw state**

    ```bash theme={null}
    archal sample show apify.actor-storage-team.v1 --raw
    ```

    The packaged JSON artifact is `samples/states/apify/actor-storage-team/state.json` and is 18,545 bytes. The CLI verifies SHA-256 `868034f634258dbb4f71a217cfe9fd6f8e173c5c2cdf3a333d82bb92d259a98f` before printing it.

    Catalog validation: **Passed**. Hosted availability is determined by Archal's live certification and admission system, not this static page.
  </Accordion>

  <Accordion title="Apify populated storage catalog">
    Exercise a production-shaped nightly fidelity workspace with two actors, four populated datasets, checkpoint stores, four work queues, and two schedules.

    **Sample ID:** `apify.storage-catalog.v1`

    **Category:** `populated`

    **Starting state:** 15 records across `actors`: 2, `datasets`: 4, `keyValueStores`: 3, `requestQueues`: 4, `schedules`: 2

    **Supported surface:** Stateful actor storage, dataset, key-value-store, and request-queue operations.

    **Required capabilities:** `state.read`, `state.load`, `state.reset`, `rest.request-queues`

    **First read:** `GET /v2/datasets/n7Yx4mQa9pL2vTcK8/items?offset=0&limit=5&clean=1`. Expected result: HTTP 200.

    **Representative mutation:** `POST /v2/request-queues/g7Up2sTd5qN1vWyP4/requests`. Expected result: HTTP 201.

    **Mutation input**

    ```json theme={null}
    {
      "method": "GET",
      "uniqueKey": "verify:customerio:campaigns.trigger",
      "url": "https://example.test/providers/customerio/campaigns/trigger"
    }
    ```

    **Expected diff:** changes include `requestQueues`. Exact match required: no. Hosted promotion must observe every listed path after the provider-native mutation; dynamic provider ids and timestamps are excluded from exact matching.

    **Expected reset:** restores loaded sample.

    **Known limits**

    * Does not claim complete Apify actor execution or platform parity.

    **Start this sample**

    ```bash theme={null}
    archal sample show apify.storage-catalog.v1 --raw > archal-apify-storage-catalog.json
    archal state validate apify archal-apify-storage-catalog.json
    archal session create apify \
      --state apify=archal-apify-storage-catalog.json
    ```

    **Inspect the raw state**

    ```bash theme={null}
    archal sample show apify.storage-catalog.v1 --raw
    ```

    The packaged JSON artifact is `samples/states/apify/storage-catalog/state.json` and is 69,598 bytes. The CLI verifies SHA-256 `63c1450e7e3170ff9e6e409ea08b856786bdc9bfb56d1998a2434a0e64b48397` before printing it.

    Catalog validation: **Passed**. Hosted availability is determined by Archal's live certification and admission system, not this static page.
  </Accordion>

  <Accordion title="Apify duplicate request key">
    Verify that adding the same unique request key twice remains idempotent in one queue.

    **Sample ID:** `apify.duplicate-request-key.v1`

    **Category:** `edge-case`

    **Starting state:** 1 record across `requestQueues`: 1

    **Supported surface:** Stateful actor storage, dataset, key-value-store, and request-queue operations.

    **Required capabilities:** `state.read`, `state.load`, `state.reset`, `rest.request-queues`

    **First read:** `GET /v2/request-queues`. Expected result: HTTP 200.

    **Representative mutation:** `POST /v2/request-queues/DupKeyQueue000001/requests`. Expected result: HTTP 201.

    **Mutation input**

    ```json theme={null}
    {
      "method": "GET",
      "uniqueKey": "sample-duplicate-key",
      "url": "https://example.test/duplicate"
    }
    ```

    **Expected diff:** no state change is expected. Exact match required: yes. The provider-native operation is intentionally idempotent and must produce no state diff.

    **Expected reset:** restores loaded sample.

    **Known limits**

    * Does not claim complete Apify actor execution or platform parity.

    **Start this sample**

    ```bash theme={null}
    archal sample show apify.duplicate-request-key.v1 --raw > archal-apify-duplicate-request-key.json
    archal state validate apify archal-apify-duplicate-request-key.json
    archal session create apify \
      --state apify=archal-apify-duplicate-request-key.json
    ```

    **Inspect the raw state**

    ```bash theme={null}
    archal sample show apify.duplicate-request-key.v1 --raw
    ```

    The packaged JSON artifact is `samples/states/apify/duplicate-request-key/state.json` and is 2,204 bytes. The CLI verifies SHA-256 `c1138fe70d7dfa713bb70798002c6d67e8bae7f583def2933254f5259d46130e` before printing it.

    Catalog validation: **Passed**. Hosted availability is determined by Archal's live certification and admission system, not this static page.
  </Accordion>

  <Accordion title="Apify actor output workflow">
    Start from an actor with populated dataset and key-value outputs plus a pending request queue, then enqueue and reset one connector check.

    **Sample ID:** `apify.actor-output-workflow.v1`

    **Category:** `workflow`

    **Starting state:** 4 records across `actors`: 1, `datasets`: 1, `keyValueStores`: 1, `requestQueues`: 1

    **Supported surface:** Stateful actor storage, dataset, key-value-store, and request-queue operations.

    **Required capabilities:** `state.read`, `state.load`, `state.reset`, `rest.request-queues`

    **First read:** `GET /v2/datasets/w6Hk2rPs9cQm4zXa7/items?offset=0&limit=10&clean=1`. Expected result: HTTP 200.

    **Representative mutation:** `POST /v2/request-queues/u3Vm7pQa9nK2sTcL8/requests`. Expected result: HTTP 201.

    **Mutation input**

    ```json theme={null}
    {
      "method": "GET",
      "uniqueKey": "customerio-provider-health",
      "url": "https://example.test/connectors/customerio/health"
    }
    ```

    **Expected diff:** changes include `requestQueues`. Exact match required: no. Hosted promotion must observe every listed path after the provider-native mutation; dynamic provider ids and timestamps are excluded from exact matching.

    **Expected reset:** restores loaded sample.

    **Known limits**

    * Does not claim complete Apify actor execution or platform parity.

    **Start this sample**

    ```bash theme={null}
    archal sample show apify.actor-output-workflow.v1 --raw > archal-apify-actor-output-workflow.json
    archal state validate apify archal-apify-actor-output-workflow.json
    archal session create apify \
      --state apify=archal-apify-actor-output-workflow.json
    ```

    **Inspect the raw state**

    ```bash theme={null}
    archal sample show apify.actor-output-workflow.v1 --raw
    ```

    The packaged JSON artifact is `samples/states/apify/actor-output-workflow/state.json` and is 15,081 bytes. The CLI verifies SHA-256 `2b26479f3cca8cb766bdf7bc20faea1f2c3c11421e9f8c6555693670314dabd6` before printing it.

    Catalog validation: **Passed**. Hosted availability is determined by Archal's live certification and admission system, not this static page.
  </Accordion>
</AccordionGroup>

## Use custom state

Start from a sample when possible. For custom state, inspect the contract with `archal environment describe apify`, then validate the file before creating a sandbox:

```bash theme={null}
archal state validate apify state.json
```

Loading state replaces the current collections and establishes a new reset baseline. See [Starting state](/sandboxes/starting-state) before replacing state in an existing sandbox.
