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

# Introduction

> RequestScript is a small, strictly typed scripting language that you send to a server to run.

RequestScript is a small, strictly typed scripting language with syntax inspired by TypeScript and Kotlin. Instead of calling a fixed set of API endpoints, you send a short script in the body of an HTTP request, and the server runs it and returns the result as JSON.

```kotlin theme={null}
request Greeting {
    const name = "Ada"
    return "Hello ${name}!"
}
```

```json theme={null}
{ "returnValue": "Hello Ada!" }
```

## Two kinds of scripts

Every RequestScript script is one of two kinds:

> **[Requests](/language/scripts#request-scripts)**
>
> One-off scripts. You send a request, the server runs it once, and you get the result back. Requests take no parameters.

> **[Contracts](/contracts/overview)**
>
> Named, versioned scripts that you save on the server and invoke later with JSON parameters.

## What scripts can do

A script works with values (numbers, strings, booleans, objects and lists), makes decisions with `if` statements and returns a result. To do anything beyond computing a value, such as reading data or calling another system, a script uses **resources**: named sets of functions that the server makes available.

```kotlin theme={null}
request CurrentTemperature {
    const weather: com.example.Weather

    const temperature = weather.temperature(city: "Oslo")

    if (temperature.error != null) {
        return temperature.error.message
    }

    return temperature.value
}
```

## Design at a glance

* **Strict types.** Every variable has a type that never changes, and values are never silently converted. A string is never treated as a number, and `if (1)` is an error.
* **Exact numbers.** Integers never wrap around, and `decimal` arithmetic is exact, so `0.1 + 0.2 == 0.3` is `true`.
* **Deliberately small.** There are no loops and no user-defined functions. A script runs from top to bottom and returns a value.
* **Recoverable resource failures.** A failing resource call hands the script an error it can inspect, instead of failing the whole request.

## Next steps

> **[Quickstart](/quickstart)**
>
> Run your first request and save your first contract.

> **[Language guide](/language/syntax)**
>
> Learn the syntax, types, variables and operators.

> **[Resources](/resources/overview)**
>
> Call functions that the server makes available.

> **[HTTP API](/reference/http-api)**
>
> Every endpoint for running scripts and managing contracts.


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