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

# Server Data, Time, and Webhook Inputs in erlc.dev Studio

> Read live ERLC server metadata, current time values, and parse incoming webhook payloads to build conditional, time-aware automations in Studio.

erlc.dev Studio provides value blocks for reading high-level metadata about your ERLC server, working with timestamps and formatted time strings, and parsing the payloads of incoming webhooks that trigger your automations. Together these blocks give you the context you need to build conditional, time-aware, and event-driven workflows.

## Server Values

The `erlc_server_value` block returns a single piece of metadata about your linked server. Set its **FIELD** dropdown to the property you want to read.

| Field | Type | Description |
| - | - | - |
| `Name` | string | The display name of the server |
| `CurrentPlayers` | number | Number of players currently in the server |
| `MaxPlayers` | number | Maximum player slot limit |
| `JoinKey` | string | The server's current join key |
| `OwnerId` | number | Roblox user ID of the server owner |
| `CoOwnerIds` | list | Roblox user IDs of all co-owners |
| `TeamBalance` | boolean | Whether team balance enforcement is enabled |
| `AccVerifiedReq` | boolean | Whether account verification is required to join |

***

## Time Blocks

Use these value blocks to read the current time, perform arithmetic on timestamps, and format output for logs or Discord messages.

<CardGroup cols={2}>
  <Card title="erlc_time_unix" icon="clock">
    Returns the current Unix timestamp as a number. No inputs required.
  </Card>

  <Card title="erlc_time_clock" icon="clock">
    Returns the current time as a clock string (e.g. `14:35:00`). No inputs required.
  </Card>

  <Card title="erlc_time_date" icon="calendar">
    Returns the current date as a string (e.g. `2025-06-10`). No inputs required.
  </Card>

  <Card title="erlc_time_weekday" icon="calendar-days">
    Returns the current day of the week as a string (e.g. `Tuesday`). No inputs required.
  </Card>

  <Card title="erlc_time_add" icon="plus">
    Adds a number of seconds to a timestamp. Inputs: **TIME** (timestamp), **SECONDS** (number). Returns a new timestamp.
  </Card>

  <Card title="erlc_time_difference" icon="arrows-left-right">
    Returns the number of seconds between two timestamps. Inputs: **A**, **B**.
  </Card>

  <Card title="erlc_time_format" icon="text-size">
    Formats a timestamp into a custom string. Input: **TIME**. Set the **FORMAT** field to your format pattern (e.g. `YYYY-MM-DD HH:mm`).
  </Card>

  <Card title="erlc_discord_timestamp" icon="discord">
    Converts a timestamp into a Discord timestamp markup string. Input: **TIME**. Set the **STYLE** field to one of: `t` (short time), `T` (long time), `d` (short date), `D` (long date), `R` (relative).
  </Card>
</CardGroup>

***

## Webhook Input Blocks

When an automation is triggered by an incoming webhook URL, you can use these blocks to read the fields from the incoming payload. They are only available inside webhook-triggered automations.

<Note>
  Webhook input blocks are only available inside automations triggered via an incoming webhook URL. Using them in other automation types will produce no output.
</Note>

### Raw Payload

<CardGroup cols={2}>
  <Card title="erlc_webhook_text" icon="file-lines">
    Returns the raw body text of the incoming webhook request. No inputs required.
  </Card>

  <Card title="erlc_webhook_text_contains" icon="magnifying-glass">
    Returns `true` if the raw webhook body contains the given string. Input: **TEXT**.
  </Card>

  <Card title="erlc_webhook_text_starts" icon="arrow-right-to-bracket">
    Returns `true` if the raw body starts with the given string. Input: **TEXT**.
  </Card>

  <Card title="erlc_webhook_text_ends" icon="arrow-right-from-bracket">
    Returns `true` if the raw body ends with the given string. Input: **TEXT**.
  </Card>
</CardGroup>

### Structured Fields

Use `erlc_webhook_field` to read a named field from the parsed webhook payload. Set the **FIELD** dropdown to one of the following:

| Field | Description |
| - | - |
| `EventType` | The type of event that triggered the webhook |
| `PlayerName` | Name of the player associated with the event |
| `PlayerId` | Roblox ID of the associated player |
| `CommandName` | Name of the command that was used |
| `CommandArguments` | Arguments passed with the command |
| `origin` | Origin identifier of the webhook source |
| `timestamp` | Timestamp of the event |
| `server` | Server identifier |
| `caller` | The player or entity that triggered the event |
| `players` | List of players included in the payload |
| `callNumber` | Emergency call number |
| `description` | Event or call description |
| `team` | Team associated with the event |
| `position` | Location position string |
| `positionDescriptor` | Human-readable position description |
| `startedAt` | When the associated session or call started |

Use `erlc_webhook_has_field` with the same **FIELD** dropdown to check whether a field is present before reading it — this prevents empty-value errors in conditional automations.

### Command Arguments

If the webhook payload includes a command, use these blocks to work with its arguments:

<CardGroup cols={2}>
  <Card title="erlc_webhook_command_name" icon="terminal">
    Returns the command name from the webhook payload. No inputs required.
  </Card>

  <Card title="erlc_webhook_argument" icon="list-ol">
    Returns the argument at a specific position. Input: **INDEX** (zero-based number).
  </Card>

  <Card title="erlc_webhook_arguments" icon="list">
    Returns all arguments as a list. No inputs required.
  </Card>

  <Card title="erlc_webhook_argument_count" icon="hashtag">
    Returns the total number of arguments in the payload. No inputs required.
  </Card>
</CardGroup>

### Custom Event Values

Use `erlc_custom_event_value` to read a field from a custom event payload. Set the **FIELD** field to the name of the key you want to extract from the event data.

***

## Example: Reading a Webhook Payload and Acting on It

The following automation checks whether an incoming webhook payload contains a `PlayerName` field, reads it along with the `EventType`, and sends an ERLC command using that data.

```json theme={null}
{
  "type": "erlc_if_then",
  "id": "if_1",
  "inputs": {
    "IF0": {
      "block": {
        "type": "erlc_webhook_has_field",
        "id": "has_field_1",
        "fields": {
          "FIELD": "PlayerName"
        }
      }
    },
    "DO0": {
      "block": {
        "type": "erlc_log",
        "id": "log_event_type",
        "inputs": {
          "MESSAGE": {
            "block": {
              "type": "erlc_webhook_field",
              "id": "field_event",
              "fields": {
                "FIELD": "EventType"
              }
            }
          }
        },
        "next": {
          "block": {
            "type": "erlc_command",
            "id": "cmd_1",
            "inputs": {
              "COMMAND": {
                "block": {
                  "type": "erlc_webhook_field",
                  "id": "field_player",
                  "fields": {
                    "FIELD": "PlayerName"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```

<Steps>
  <Step title="Guard with erlc_webhook_has_field">
    Before reading `PlayerName`, the `erlc_webhook_has_field` block confirms the field exists in the payload. This prevents the automation from failing on webhook calls that don't include player data.
  </Step>

  <Step title="Log the event type">
    `erlc_webhook_field` reads the `EventType` field and `erlc_log` writes it to the Studio panel so you can trace which event fired.
  </Step>

  <Step title="Run a command using the player name">
    A second `erlc_webhook_field` block reads the `PlayerName` and passes it directly to `erlc_command`, which sends the command to your ERLC server.
  </Step>
</Steps>

<Tip>
  Combine `erlc_discord_timestamp` with `erlc_time_unix` to add a live relative timestamp (e.g. "2 minutes ago") to any Discord message your automation sends after processing a webhook.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.