# Defining inputs (schema)

Define input fields so the agent can extract, map, and validate user data from natural-language prompts.

A schema defines the fields an action needs. When a user makes a request, the agent extracts key details from their prompt and maps them into the fields you define.

<ActionInputsScreen />

**Example prompt**

> *"Invite Sarah as an account manager with email sarah@example.com."*

From this prompt, the agent captures:

- `email = "sarah@example.com"`
- `organizationRoleType = "ORG_ACCOUNT_MANAGER"`
- `name = "Sarah"`

The schema tells the agent exactly which fields to collect. Build it with the visual editor or write it directly as JSON.

## Visual editor

Add fields one at a time using the form. To build the Invite User schema, click **+ Add Field** and define each field:

1. **`email`**
   - Type: **String**
   - Description: *"The email address of the user to invite."*
   - Mark as **Required**.
2. **`organizationRoleType`**
   - Type: **String**
   - Description: *"The role to assign. Must be one of ORG_ACCOUNT_MANAGER (Account Manager), ORG_ADMIN (Admin), or ORG_MEMBER (Member)."*
   - Enum values: `ORG_ACCOUNT_MANAGER`, `ORG_ADMIN`, `ORG_MEMBER`
   - Mark as **Required**.
3. **`name`**
   - Type: **String**
   - Description: *"The full name of the invited user."*
   - Leave as **Optional**.

## Code editor

Define the same fields directly in JSON.

:::note
The description can include a human-friendly role name (Admin, Account Manager, Member) that the agent uses when talking to the user.
:::

```json
[
  {
    "key": "email",
    "description": "The email address of the user to invite.",
    "type": "STRING",
    "enumValues": [],
    "isRequired": true,
    "isMasked": false
  },
  {
    "key": "organizationRoleType",
    "description": "The role to assign to the user. Must be one of: ORG_ACCOUNT_MANAGER (Account Manager), ORG_ADMIN (Admin), or ORG_MEMBER (Member).",
    "type": "STRING",
    "enumValues": ["ORG_ACCOUNT_MANAGER", "ORG_ADMIN", "ORG_MEMBER"],
    "isRequired": true,
    "isMasked": false
  },
  {
    "key": "name",
    "description": "The full name of the invited user.",
    "type": "STRING",
    "enumValues": [],
    "isRequired": false,
    "isMasked": false
  }
]
```

## Next steps

- [Connect the action in your application](/guides/connecting-actions/) and share the schema with your developers.
