# Structure of a Payload

Every time any data is sent to Ray, a payload is generated with the same basic structure before being sent to the Ray app.

If you run the following test PHP script, you'll get the payload example below sent via `HTTP POST` to the Ray app.

```
ray()->html('<em>hello world!</em>');
```

## Payload example

```
{
  "uuid": "ca539a10-bfd5-3e5a-6271-0c4a95612132",
  "payloads": [
    {
      "type": "custom",
      "content": {
        "content": "<em>hello world!</em>",
        "label": "HTML"
      },
      "origin": {
        "function_name": "test",
        "file": "/home/user/projects/test-project/test.php",
        "line_number": 16,
        "hostname": "my-hostname"
      }
    }
  ],
  "meta": {
    "php_version": "7.4.16",
    "php_version_id": 70416,
    "ray_package_version": "1.20.1.0"
  }
}
```

## Payload sections overview

> All of the listed payload sections are **required** when sending a payload from an integration library.

- The "uuid" section contains a valid `UUIDv4` value. This value is important, as it can be used in future to modify the payload after it's been sent to Ray _(i.e., changing its color)_.
- The "meta" section contains metadata about the Ray integration library as well as the current language and its version.
- The `payloads[0].origin` section contains information about where the call to `ray()` originated from. It's used to tell Ray what file to open when the related file link is clicked.
- The `payloads[0].type` value contains the type of payload being sent.
- The `payloads[0].content` value contains the payload-specific content to display within the Ray app. This varies depending on the type of payload.

## On this page

- [Payload example](/content/docs/developing-ray-libraries/payload#payload-example/index.html)
- [Payload sections overview](/content/docs/developing-ray-libraries/payload#payload-sections-overview/index.html)

## Debug without breaking your flow

Ray keeps all your debug output neatly organized in a dedicated desktop app.

### Download Ray

[Buy Ray for\ 49 USD](https://spatie.be/products/ray)  
Licenses are valid for 1 year and managed through [Spatie](https://spatie.be/products/ray). Licenses purchased before Ray 3 remain valid. VAT is calculated at checkout.

## Thanks for trying out Ray!

macOS

[ARM](https://spatie.be/products/ray/v3/download/macos-arm64/latest) [Intel](https://spatie.be/products/ray/v3/download/macos-x64/latest)

Windows

[x86 (Intel)](https://spatie.be/products/ray/v3/download/windows/latest)

Linux

[AppImage](https://spatie.be/products/ray/v3/download/linux/latest)

By downloading Ray, you agree to our [terms of use](/content/terms-of-use/index.html).  
The free trial lets you send up to 20 messages per session.
