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

# Callbacks

> Receive notifications when automations complete

Set up callbacks to receive automation results without polling.

## Overview

Optexity sends HTTP POST requests to your callback URL when automations complete.

| Environment | Configuration                             |
| ----------- | ----------------------------------------- |
| Local       | `LOCAL_CALLBACK_URL` environment variable |
| Production  | Set in dashboard                          |

***

## Local Development

Set the environment variable:

```bash theme={null}
LOCAL_CALLBACK_URL=http://localhost:3000/receive_callback
```

Requirements:

* URL must be accessible from the machine running the automation
* Endpoint must be unauthenticated

***

## Production

Configure in the Optexity dashboard:

* Callback URL must be publicly accessible
* Supports API key authentication
* Supports username/password authentication

***

## Callback Payload

```json theme={null}
{
  "task_id": "abc123",
  "recording_id": "rec456",
  "endpoint_name": "login-flow",
  "status": "success",
  "output_data": [
    {"name": "email", "value": "test@example.com"}
  ],
  "error": null,
  "final_screenshot": "base64_encoded_string",
  "downloads": [
    {"url": "signed_url", "filename": "report.pdf"}
  ]
}
```

| Field              | Type          | Description                                                        |
| ------------------ | ------------- | ------------------------------------------------------------------ |
| `task_id`          | `str`         | Unique task identifier                                             |
| `status`           | `str`         | `queued`, `allocated`, `running`, `success`, `failed`, `cancelled` |
| `output_data`      | `list`        | Extracted data objects                                             |
| `error`            | `str \| null` | Error message if failed                                            |
| `final_screenshot` | `str`         | Base64 screenshot                                                  |
| `downloads`        | `list`        | Download URLs and filenames                                        |

***

## Authentication

| Type       | Fields Required        |
| ---------- | ---------------------- |
| API Key    | `api_key`              |
| Basic Auth | `username`, `password` |

<Info>
  See [Callback Reference](/api-reference/callback) for complete schema details.
</Info>
