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

# Quickstart

> Send your first audit event in under 5 minutes.

<Steps>
  <Step title="Sign up and create a workspace">
    Go to [getimmutable.dev](https://getimmutable.dev) and create an account. A workspace is automatically created for you on registration.
  </Step>

  <Step title="Create an API key">
    Navigate to **Settings > API Keys** in your dashboard and generate a new key. Copy the full key immediately.

    <Warning>
      API keys are only shown once at creation. The key is bcrypt hashed before storage -- Immutable never stores your raw key. If you lose it, revoke and create a new one.
    </Warning>

    Your key uses the `imk_` prefix:

    ```
    imk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0...
    ```
  </Step>

  <Step title="Install an SDK">
    <Tabs>
      <Tab title="JavaScript">
        ```bash theme={null}
        npm install getimmutable
        ```
      </Tab>

      <Tab title="Laravel">
        ```bash theme={null}
        composer require getimmutable/laravel
        ```

        Add to your `.env`:

        ```env theme={null}
        GETIMMUTABLE_API_KEY=imk_your_api_key_here
        GETIMMUTABLE_BASE_URL=https://getimmutable.dev
        ```
      </Tab>

      <Tab title="Python">
        ```bash theme={null}
        pip install getimmutable
        ```
      </Tab>

      <Tab title="cURL">
        No installation needed. Use any HTTP client.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Send your first event">
    <CodeGroup>
      ```typescript JavaScript theme={null}
      import { ImmutableClient } from "getimmutable";

      const client = new ImmutableClient({
        apiKey: "imk_your_api_key_here",
        baseUrl: "https://getimmutable.dev",
      });

      const result = await client.track({
        actor_id: "user_2hG9kLm",
        actor_name: "Sarah Chen",
        action: "document.created",
        resource_id: "doc_8nXpQr3",
        resource_name: "Q4 Financial Report",
        resource: "document",
        metadata: { folder: "reports", template: "quarterly" },
      });

      console.log(result.id);     // "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
      console.log(result.status); // "queued"
      ```

      ```php Laravel theme={null}
      use GetImmutable\AuditLog;

      AuditLog::track('document.created', 'document', [
          'actor_id' => 'user_2hG9kLm',
          'actor_name' => 'Sarah Chen',
          'resource_id' => 'doc_8nXpQr3',
          'resource_name' => 'Q4 Financial Report',
          'metadata' => ['folder' => 'reports', 'template' => 'quarterly'],
      ]);
      ```

      ```python Python theme={null}
      from getimmutable import ImmutableClient

      client = ImmutableClient(
          api_key="imk_your_api_key_here",
          base_url="https://getimmutable.dev",
      )

      result = client.track({
          "actor_id": "user_2hG9kLm",
          "actor_name": "Sarah Chen",
          "action": "document.created",
          "resource_id": "doc_8nXpQr3",
          "resource_name": "Q4 Financial Report",
          "resource": "document",
          "metadata": {"folder": "reports", "template": "quarterly"},
      })

      print(result["id"])      # "9b1deb4d-..."
      print(result["status"])  # "queued"
      ```

      ```bash cURL theme={null}
      curl -X POST https://getimmutable.dev/api/v1/events \
        -H "Authorization: Bearer imk_your_api_key_here" \
        -H "Content-Type: application/json" \
        -d '{
          "actor_id": "user_2hG9kLm",
          "actor_name": "Sarah Chen",
          "action": "document.created",
          "resource_id": "doc_8nXpQr3",
          "resource_name": "Q4 Financial Report",
          "resource": "document",
          "metadata": {
            "folder": "reports",
            "template": "quarterly"
          }
        }'
      ```
    </CodeGroup>

    The API returns `202 Accepted` with a pre-generated event ID:

    ```json theme={null}
    {
      "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
      "status": "queued"
    }
    ```
  </Step>

  <Step title="Query your events">
    <CodeGroup>
      ```typescript JavaScript theme={null}
      const response = await client.getEvents({
        actor_id: "user_2hG9kLm",
        limit: 10,
      });

      console.log(response.data);
      console.log(response.pagination.has_more);
      ```

      ```php Laravel theme={null}
      $events = AuditLog::getEvents(['actor_id' => 'user_2hG9kLm', 'limit' => 10]);
      ```

      ```python Python theme={null}
      result = client.get_events(actor_id="user_2hG9kLm", limit=10)

      for event in result["data"]:
          print(event["action"])
      print(result["pagination"]["has_more"])
      ```

      ```bash cURL theme={null}
      curl "https://getimmutable.dev/api/v1/events?actor_id=user_2hG9kLm&limit=10" \
        -H "Authorization: Bearer imk_your_api_key_here"
      ```
    </CodeGroup>

    Response:

    ```json theme={null}
    {
      "data": [
        {
          "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
          "actor": { "id": "user_2hG9kLm", "name": "Sarah Chen", "type": null },
          "action": "document.created",
          "action_category": null,
          "resource": { "type": "document", "id": "doc_8nXpQr3", "name": "Q4 Financial Report" },
          "targets": [],
          "metadata": { "folder": "reports", "template": "quarterly" },
          "tenant_id": null,
          "session_id": null,
          "ip_country": "US",
          "ip_city": "San Francisco",
          "idempotency_key": null,
          "version": null,
          "integrity": {
            "event_hash": "a3f2c8d1e4b5...",
            "previous_event_hash": null
          },
          "occurred_at": "2026-03-26T10:15:00.000000Z",
          "created_at": "2026-03-26T10:15:00.000000Z"
        }
      ],
      "pagination": {
        "has_more": false,
        "next_cursor": null,
        "total": 1
      }
    }
    ```
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Event Structure" icon="table" href="/guides/events">
    Understand every field on an event.
  </Card>

  <Card title="Hash Chain" icon="link" href="/guides/hash-chain">
    Learn how tamper evidence works.
  </Card>

  <Card title="JavaScript SDK" icon="js" href="/sdks/javascript">
    Full SDK reference with fluent builder.
  </Card>

  <Card title="Laravel SDK" icon="php" href="/sdks/laravel">
    Facade, auto-session, Eloquent observers.
  </Card>
</CardGroup>
