# Torii

> Keep Torii, the SaaS management platform, in step with the rest of your work: update apps and their owners, track licenses and who uses each app, manage contracts and renewals, offboard people, import expenses and run Torii workflows. Start a workflow when an app is discovered, a contract nears its end, someone leaves or a Torii action fails.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/torii

## Actions

### Add app

Add an app from Torii's catalog to your organization's apps, such as once a purchase is approved. Torii's API can't remove it again.

**Inputs**

- Catalog app (`catalog_app`, text, required): The app's ID in Torii's catalog, from 'Search app catalog'.

**Outputs**

- `active_users` (number): How many people use it
- `category` (text): Its category, such as Developer Tools
- `created_at` (text): When it was added to Torii (ISO 8601)
- `custom_fields` (object): The values of the fields asked for under More fields, by their key, as Torii gives them
- `description` (text): What it is
- `id` (number): The app's ID in Torii
- `image_url` (text): A link to its logo
- `is_custom` (true/false): True if it was added as a custom app
- `is_hidden` (true/false): True if it's hidden in Torii
- `last_visit_at` (text): When someone last used it (ISO 8601)
- `name` (text): Its name
- `primary_owner_email` (text): Its primary owner's email
- `primary_owner_id` (number): Its primary owner's user ID; 0 if none
- `primary_owner_name` (text): Its primary owner's name
- `sources` (list): Where Torii found it, such as google or okta
- `state` (text): Its state, such as discovered or sanctioned
- `tags` (list): Its tags
- `url` (text): Its website
- `vendor` (text): Who makes it

**Example output**

```json
{
  "active_users": 25,
  "category": "Developer Tools",
  "created_at": "2020-01-01T00:00:00.000Z",
  "custom_fields": {},
  "description": "Awesome application",
  "id": 1000,
  "image_url": "http://example.com/image.png",
  "is_custom": false,
  "is_hidden": false,
  "last_visit_at": "2026-11-05T00:00:00.000Z",
  "name": "Salesforce",
  "primary_owner_email": "tony@stark.com",
  "primary_owner_id": 1000,
  "primary_owner_name": "Tony Stark",
  "sources": [
    "okta"
  ],
  "state": "discovered",
  "tags": [
    "DevOps",
    "Human Resource"
  ],
  "url": "https://example.com",
  "vendor": "Salesforce"
}
```

### Create contract

Add a contract for an app, with its status, amount, dates and owner. Fields your Torii admin made required must be filled in.

**Inputs**

- Name (`name`, text, required): What the contract is called, such as Salesforce 2027.
- App (`app`, text, required): The app the contract is for, or its Torii ID.
- Status (`status`, text, required): Its status, such as Active or In review.
- Amount (`amount`, number): What the contract is worth, such as 12000.50. At least 0.
- Currency (`currency`, text): The amount's currency. Leave blank for your Torii currency. One of: `USD` (USD, US dollar), `EUR` (EUR, euro), `GBP` (GBP, British pound), `CAD` (CAD, Canadian dollar), `AUD` (AUD, Australian dollar), `NZD` (NZD, New Zealand dollar), `JPY` (JPY, Japanese yen), `CHF` (CHF, Swiss franc), `SEK` (SEK, Swedish krona), `NOK` (NOK, Norwegian krone), and 25 more.
- Start date (`start_date`, date): When it starts.
- End date (`end_date`, date): When it ends, which is when it renews.
- Owner (`owner`, text): Who owns it in your organization: their Torii user ID or email.
- Custom fields (`custom_fields`, object): Values for the contract's other fields, such as your organization's own. Fill in only what should change.

**Outputs**

- `amount` (number): What it's worth, such as 12000.50; 0 if not set
- `app_id` (number): The ID of the app it's for
- `created_at` (text): When it was added to Torii (ISO 8601)
- `currency` (text): The amount's currency, such as USD
- `custom_fields` (object): The values of the fields asked for under More fields, by their key, as Torii gives them
- `end_date` (text): When it ends, which is when it renews (YYYY-MM-DD)
- `id` (number): The contract's ID in Torii
- `name` (text): Its name
- `owner_id` (number): Its owner's user ID; 0 if none
- `start_date` (text): When it starts (YYYY-MM-DD)
- `status` (text): Its status, such as active or inReview

**Example output**

```json
{
  "amount": 15000,
  "app_id": 1000,
  "created_at": "2026-02-01T09:00:00.000Z",
  "currency": "USD",
  "custom_fields": {},
  "end_date": "2027-02-02",
  "id": 1000,
  "name": "Salesforce contract",
  "owner_id": 1000,
  "start_date": "2026-02-03",
  "status": "active"
}
```

### Delete contract

Delete a contract from Torii for good.

**Inputs**

- Contract (`contract`, text, required): The contract's Torii ID, from another Torii step or the trigger.

**Outputs**

- `deleted` (true/false): True once it's deleted
- `id` (number): The contract's ID

**Example output**

```json
{
  "deleted": true,
  "id": 1000
}
```

### Find apps

Find the apps your organization uses, by words in their name or by state, with their owner and how many people use them. Leave every field blank to list them all.

**Inputs**

- Search (`search`, text): Words to look for, such as a name.
- State (`state`, text): Only apps in this state, such as Sanctioned.
- Include licenses (`include_licenses`, true/false): Also give each app's license counts and costs.
- More fields (`more_fields`, list): Other app fields to include, such as your organization's own. They come back under custom_fields.
- How many (`limit`, number): The most to list at once. Defaults to 50. From 1 to 1000.
- Next page (`cursor`, text): To get the next page, the next_cursor the step's last answer gave. Leave blank for the first page.

**Outputs**

- `apps` (list): The apps found
- `count` (number): How many are on this page
- `next_cursor` (text): Give this to the step's Next page field to get the next page; empty on the last page
- `total` (number): How many match in all

**Example output**

```json
{
  "apps": [
    {
      "active_users": 25,
      "category": "Developer Tools",
      "created_at": "2020-01-01T00:00:00.000Z",
      "custom_fields": {},
      "description": "Awesome application",
      "id": 1000,
      "image_url": "http://example.com/image.png",
      "is_custom": false,
      "is_hidden": false,
      "last_visit_at": "2026-11-05T00:00:00.000Z",
      "licenses": {
        "active": 80,
        "annual_cost": 120000,
        "currency": "USD",
        "inactive": 15,
        "potential_savings": 24000,
        "total": 100,
        "unassigned": 5
      },
      "name": "Salesforce",
      "primary_owner_email": "tony@stark.com",
      "primary_owner_id": 1000,
      "primary_owner_name": "Tony Stark",
      "sources": [
        "okta"
      ],
      "state": "discovered",
      "tags": [
        "DevOps",
        "Human Resource"
      ],
      "url": "https://example.com",
      "vendor": "Salesforce"
    }
  ],
  "count": 1,
  "next_cursor": "",
  "total": 1
}
```

### Find contracts

Find contracts by words, status or app, with their amount and dates. Leave every field blank to list them all.

**Inputs**

- Search (`search`, text): Words to look for, such as a name.
- Status (`status`, text): Only contracts with this status.
- App (`app`, text): Only contracts for this app.
- More fields (`more_fields`, list): Other contract fields to include, such as your organization's own. They come back under custom_fields.
- How many (`limit`, number): The most to list at once. Defaults to 50. From 1 to 1000.
- Next page (`cursor`, text): To get the next page, the next_cursor the step's last answer gave. Leave blank for the first page.

**Outputs**

- `contracts` (list): The contracts found
- `count` (number): How many are on this page
- `next_cursor` (text): Give this to the step's Next page field to get the next page; empty on the last page
- `total` (number): How many match in all

**Example output**

```json
{
  "contracts": [
    {
      "amount": 15000,
      "app_id": 1000,
      "created_at": "2026-02-01T09:00:00.000Z",
      "currency": "USD",
      "custom_fields": {},
      "end_date": "2027-02-02",
      "id": 1000,
      "name": "Salesforce contract",
      "owner_id": 1000,
      "start_date": "2026-02-03",
      "status": "active"
    }
  ],
  "count": 1,
  "next_cursor": "",
  "total": 1
}
```

### Find expenses

Find your organization's SaaS expenses, newest first, by app, words, dates or how they're matched to apps. Torii lists expenses matched to an app unless you choose otherwise.

**Inputs**

- App (`app`, text): Only expenses for this app.
- Search (`search`, text): Words in the expense's description.
- Matched (`statuses`, list): Only expenses matched this way. Leave blank for the ones matched to an app. One or more of: `mapped` (Matched to an app), `unknown` (Not matched), `recommend_map` (Suggested match), `ignored`, `recommend_ignore` (Suggested to ignore), `archived`.
- From (`from_date`, date): Only expenses on or after this day.
- Until (`until_date`, date): Only expenses on or before this day.
- How many (`limit`, number): The most to list at once. Defaults to 50. From 1 to 1000.
- Next page (`cursor`, text): To get the next page, the next_cursor the step's last answer gave. Leave blank for the first page.

**Outputs**

- `count` (number): How many are on this page
- `next_cursor` (text): Give this to the step's Next page field to get the next page; empty on the last page
- `total` (number): How many match in all
- `transactions` (list): The expenses found

**Example output**

```json
{
  "count": 1,
  "next_cursor": "",
  "total": 1,
  "transactions": [
    {
      "amount": 1300,
      "amount_in_org_currency": 1500,
      "app_id": 1000,
      "app_name": "Salesforce",
      "currency": "EUR",
      "date": "2022-02-03",
      "department": "Engineering",
      "description": "Salesforce subscription",
      "external_id": "INV-1001",
      "file_name": "expenses-q1.csv",
      "id": 1000,
      "reported_by_id": 1000,
      "reported_by_name": "Tony Stark",
      "source": "netsuite",
      "status": "mapped"
    }
  ]
}
```

### Find users

Find people in your organization by email, name or lifecycle status, with how many apps they use. Leave every field blank to list them all.

**Inputs**

- Email (`email`, text): Their email.
- Search (`search`, text): Words to look for, such as a name.
- Lifecycle status (`lifecycle_status`, text): Only people at this point in their time at the organization. One of: `active`, `offboarding`, `offboarded`.
- Left the organization (`left_organization`, true/false): On for only people who have left, off for only those who haven't. Leave unset for both.
- External (`external`, true/false): On for only people from outside the organization, off for only your own. Leave unset for both.
- How many (`limit`, number): The most to list at once. Defaults to 50. From 1 to 1000.
- Next page (`cursor`, text): To get the next page, the next_cursor the step's last answer gave. Leave blank for the first page.

**Outputs**

- `count` (number): How many are on this page
- `next_cursor` (text): Give this to the step's Next page field to get the next page; empty on the last page
- `total` (number): How many match in all
- `users` (list): The users found

**Example output**

```json
{
  "count": 1,
  "next_cursor": "",
  "total": 1,
  "users": [
    {
      "active_apps": 12,
      "additional_emails": [],
      "created_at": "2020-01-01T00:00:00.000Z",
      "email": "tony@stark.com",
      "first_name": "Tony",
      "has_left": false,
      "id": 1000,
      "is_external": false,
      "last_name": "Stark",
      "lifecycle_status": "active",
      "name": "Tony Stark",
      "role": "Admin",
      "role_id": 1
    }
  ]
}
```

### Get app

Get an app's details: its state, category, owner, how many people use it and where Torii found it.

**Inputs**

- App (`app`, text, required): The app, or its Torii ID.
- More fields (`more_fields`, list): Other app fields to include, such as your organization's own. They come back under custom_fields.

**Outputs**

- `active_users` (number): How many people use it
- `category` (text): Its category, such as Developer Tools
- `created_at` (text): When it was added to Torii (ISO 8601)
- `custom_fields` (object): The values of the fields asked for under More fields, by their key, as Torii gives them
- `description` (text): What it is
- `id` (number): The app's ID in Torii
- `image_url` (text): A link to its logo
- `is_custom` (true/false): True if it was added as a custom app
- `is_hidden` (true/false): True if it's hidden in Torii
- `last_visit_at` (text): When someone last used it (ISO 8601)
- `name` (text): Its name
- `primary_owner_email` (text): Its primary owner's email
- `primary_owner_id` (number): Its primary owner's user ID; 0 if none
- `primary_owner_name` (text): Its primary owner's name
- `sources` (list): Where Torii found it, such as google or okta
- `state` (text): Its state, such as discovered or sanctioned
- `tags` (list): Its tags
- `url` (text): Its website
- `vendor` (text): Who makes it

**Example output**

```json
{
  "active_users": 25,
  "category": "Developer Tools",
  "created_at": "2020-01-01T00:00:00.000Z",
  "custom_fields": {},
  "description": "Awesome application",
  "id": 1000,
  "image_url": "http://example.com/image.png",
  "is_custom": false,
  "is_hidden": false,
  "last_visit_at": "2026-11-05T00:00:00.000Z",
  "name": "Salesforce",
  "primary_owner_email": "tony@stark.com",
  "primary_owner_id": 1000,
  "primary_owner_name": "Tony Stark",
  "sources": [
    "okta"
  ],
  "state": "discovered",
  "tags": [
    "DevOps",
    "Human Resource"
  ],
  "url": "https://example.com",
  "vendor": "Salesforce"
}
```

### Get app licenses

Get how many of an app's licenses are in use, inactive or unassigned, what they cost a year and what the unused ones could save, in all and by license type.

**Inputs**

- App (`app`, text, required): The app, or its Torii ID.

**Outputs**

- `active` (number): How many are in use
- `annual_cost` (number): What the licenses cost a year, in your Torii currency
- `app_id` (number): The app's ID
- `app_name` (text): Its name
- `currency` (text): The currency of the costs, such as USD
- `inactive` (number): How many are assigned but not used
- `potential_savings` (number): What a year of the inactive and unassigned licenses costs, in your Torii currency
- `total` (number): How many licenses the app has
- `types` (list): Each license type, with its own counts and costs
- `unassigned` (number): How many aren't assigned to anyone

**Example output**

```json
{
  "active": 80,
  "annual_cost": 120000,
  "app_id": 1000,
  "app_name": "Salesforce",
  "currency": "USD",
  "inactive": 15,
  "potential_savings": 24000,
  "total": 100,
  "types": [
    {
      "active": 80,
      "annual_cost": 120000,
      "currency": "USD",
      "inactive": 15,
      "name": "Enterprise",
      "potential_savings": 24000,
      "price_per_license": 1200,
      "total": 100,
      "unassigned": 5
    }
  ],
  "unassigned": 5
}
```

### Get contract

Get a contract's details: its app, status, owner, amount and dates.

**Inputs**

- Contract (`contract`, text, required): The contract's Torii ID, from another Torii step or the trigger.
- More fields (`more_fields`, list): Other contract fields to include, such as your organization's own. They come back under custom_fields.

**Outputs**

- `amount` (number): What it's worth, such as 12000.50; 0 if not set
- `app_id` (number): The ID of the app it's for
- `created_at` (text): When it was added to Torii (ISO 8601)
- `currency` (text): The amount's currency, such as USD
- `custom_fields` (object): The values of the fields asked for under More fields, by their key, as Torii gives them
- `end_date` (text): When it ends, which is when it renews (YYYY-MM-DD)
- `id` (number): The contract's ID in Torii
- `name` (text): Its name
- `owner_id` (number): Its owner's user ID; 0 if none
- `start_date` (text): When it starts (YYYY-MM-DD)
- `status` (text): Its status, such as active or inReview

**Example output**

```json
{
  "amount": 15000,
  "app_id": 1000,
  "created_at": "2026-02-01T09:00:00.000Z",
  "currency": "USD",
  "custom_fields": {},
  "end_date": "2027-02-02",
  "id": 1000,
  "name": "Salesforce contract",
  "owner_id": 1000,
  "start_date": "2026-02-03",
  "status": "active"
}
```

### Get expense import

Check whether Torii has finished reading an expense file, and how many of its expenses it matched to apps.

**Inputs**

- Import (`import_id`, text, required): The import's ID, from 'Import expense file'.

**Outputs**

- `done` (true/false): True once Torii has finished reading the file
- `file_id` (number): The uploaded file's ID; 0 when only checking an import
- `import_id` (number): The import's ID, which 'Get expense import' takes
- `matched` (number): How many expenses Torii matched to apps
- `status` (text): parsing_in_progress, parsed_successfully or parsing_failed, as Torii reports it
- `succeeded` (true/false): True if Torii read the file successfully
- `total` (number): How many expenses the file has

**Example output**

```json
{
  "done": true,
  "file_id": 1000,
  "import_id": 1000,
  "matched": 55,
  "status": "parsed_successfully",
  "succeeded": true,
  "total": 60
}
```

### Get user

Get a person's details: their lifecycle status, role, other emails and how many apps they use.

**Inputs**

- User (`user`, text, required): The person's Torii user ID, from another Torii step or the trigger, or their email.

**Outputs**

- `active_apps` (number): How many apps they use
- `additional_emails` (list): Their other emails
- `created_at` (text): When Torii first saw them (ISO 8601)
- `email` (text): Their email
- `first_name` (text): Their first name
- `has_left` (true/false): True if they've left the organization (removed from its identity source)
- `id` (number): The user's ID in Torii
- `is_external` (true/false): True if they're from outside the organization
- `last_name` (text): Their last name
- `lifecycle_status` (text): active, offboarding or offboarded
- `name` (text): Their full name
- `role` (text): Their role in Torii, such as Admin
- `role_id` (number): Their role's ID; 0 if none

**Example output**

```json
{
  "active_apps": 12,
  "additional_emails": [],
  "created_at": "2020-01-01T00:00:00.000Z",
  "email": "tony@stark.com",
  "first_name": "Tony",
  "has_left": false,
  "id": 1000,
  "is_external": false,
  "last_name": "Stark",
  "lifecycle_status": "active",
  "name": "Tony Stark",
  "role": "Admin",
  "role_id": 1
}
```

### Import expense file

Upload a CSV or Excel file of expenses (up to 3 MB) and have Torii read it and match each expense to an app. Torii's API can't remove the expenses again.

**Inputs**

- Expense file (`file`, text, required): A CSV, TSV or Excel file of expenses, with a date, a description and an amount on each row.

**Outputs**

- `done` (true/false): True once Torii has finished reading the file
- `file_id` (number): The uploaded file's ID; 0 when only checking an import
- `import_id` (number): The import's ID, which 'Get expense import' takes
- `matched` (number): How many expenses Torii matched to apps
- `status` (text): parsing_in_progress, parsed_successfully or parsing_failed, as Torii reports it
- `succeeded` (true/false): True if Torii read the file successfully
- `total` (number): How many expenses the file has

**Example output**

```json
{
  "done": true,
  "file_id": 1000,
  "import_id": 1000,
  "matched": 55,
  "status": "parsed_successfully",
  "succeeded": true,
  "total": 60
}
```

### List app users

List the people who use an app, with their status in it, when they last used it and their licenses.

**Inputs**

- App (`app`, text, required): The app, or its Torii ID.
- Status (`status`, text): Only people with this status in the app. One of: `active`, `deleted`, `managed`.
- Search (`search`, text): Words to look for, such as a name.
- How many (`limit`, number): The most to list at once. Defaults to 50. From 1 to 1000.
- Next page (`cursor`, text): To get the next page, the next_cursor the step's last answer gave. Leave blank for the first page.

**Outputs**

- `count` (number): How many are on this page
- `next_cursor` (text): Give this to the step's Next page field to get the next page; empty on the last page
- `total` (number): How many match in all
- `users` (list): The app's users

**Example output**

```json
{
  "count": 1,
  "next_cursor": "",
  "total": 1,
  "users": [
    {
      "account_name": "demo-torii",
      "email": "admin@demo-torii.com",
      "external_status": "active",
      "first_name": "Torii",
      "has_left": false,
      "id": 873786409,
      "inactive_licenses": 1,
      "last_name": "Demo",
      "last_visit_at": "2021-08-31T00:00:00.000Z",
      "licenses": [
        {
          "last_used_at": "2021-06-30T01:34:43.000Z",
          "name": "Jira Software",
          "paid": true,
          "status": "active",
          "usage": "inactive"
        }
      ],
      "lifecycle_status": "active",
      "name": "Torii Demo",
      "removed_from_app": false,
      "roles": [],
      "sources": [
        "atlassian",
        "google"
      ],
      "status": "active"
    }
  ]
}
```

### List audit log

List what admins and Torii's automation did in your organization, such as changing a contract or signing in, newest first.

**Inputs**

- About (`entity`, text): Only events about this. Leave blank for all. One of: `apps`, `contracts`, `users`, `licenses`, `workflows`, `tasks`, `transactions` (Expenses), `integrations`, `authentication` (Sign-ins), `access`, and 18 more.
- From (`start_date`, date): Only events after this day.
- Until (`end_date`, date): Only events up to the end of this day.
- Order (`order`, text): Newest or oldest first. One of: `desc` (Newest first), `asc` (Oldest first). Default: `desc`.
- How many (`limit`, number): The most to list at once. Defaults to 50. From 1 to 1000.
- Next page (`cursor`, text): To get the next page, the next_cursor the step's last answer gave. Leave blank for the first page.

**Outputs**

- `count` (number): How many are on this page
- `events` (list): The audit log events, newest first unless asked
- `next_cursor` (text): Give this to the step's Next page field to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "events": [
    {
      "by_automation": false,
      "method": "put",
      "path": "/api/orgs/10/contracts/50000",
      "performed_by_email": "tony@stark.com",
      "performed_by_id": 1000,
      "performed_by_name": "Tony Stark",
      "properties": {},
      "time": "2020-01-01T00:00:00.000Z",
      "type": "update_contract"
    }
  ],
  "next_cursor": ""
}
```

### List fields

List the fields apps, contracts or users have, your organization's own included, with the key other steps take and each dropdown's choices.

**Inputs**

- Fields of (`record_type`, text, required): Which kind of record's fields to list. One of: `apps`, `contracts`, `users`.

**Outputs**

- `count` (number): How many are listed
- `fields` (list): The fields

**Example output**

```json
{
  "count": 1,
  "fields": [
    {
      "id": 1000,
      "key": "planName",
      "name": "Plan Name",
      "options": [
        {
          "label": "In-Review",
          "value": "inReview"
        }
      ],
      "type": "dropdown"
    }
  ]
}
```

### List user apps

List the apps a person uses, or was removed from, with when they last used each.

**Inputs**

- User (`user`, text, required): The person's Torii user ID, from another Torii step or the trigger, or their email.
- App state (`state`, text): Only apps in this state, such as Sanctioned.
- Removed (`removed`, true/false): On for only apps they were removed from, off for only the ones they still have. Leave unset for both.

**Outputs**

- `apps` (list): The person's apps
- `count` (number): How many are listed

**Example output**

```json
{
  "apps": [
    {
      "category": "Developer Tools",
      "id": 1000,
      "last_used_at": "2026-11-05T00:00:00.000Z",
      "name": "Salesforce",
      "removed_from_app": false,
      "sources": [
        "okta"
      ],
      "state": "discovered",
      "url": "https://example.com"
    }
  ],
  "count": 1
}
```

### List workflow action runs

List what Torii workflows' actions did, newest first, and whether each finished or failed, such as to check on a workflow you started.

**Inputs**

- App (`app`, text): Only actions on this app.
- User (`user`, text): Only actions on this person: their Torii user ID or email.
- How many (`limit`, number): The most to list at once. Defaults to 50. From 1 to 1000.
- Next page (`cursor`, text): To get the next page, the next_cursor the step's last answer gave. Leave blank for the first page.

**Outputs**

- `count` (number): How many are on this page
- `next_cursor` (text): Give this to the step's Next page field to get the next page; empty on the last page
- `runs` (list): The action runs
- `total` (number): How many match in all

**Example output**

```json
{
  "count": 1,
  "next_cursor": "",
  "runs": [
    {
      "action_id": "3873472394983",
      "action_type": "actionOnUser",
      "app_id": 1000,
      "completed": true,
      "completed_at": "2022-02-03T00:05:00Z",
      "created_at": "2022-02-03T00:00:00Z",
      "details": {
        "userAlreadyExists": true
      },
      "error_at": "",
      "error_type": "",
      "failed": false,
      "id": 1000,
      "ignored": false,
      "workflow_id": 1000,
      "workflow_run_id": 2
    }
  ],
  "total": 1
}
```

### List workflows

List your organization's Torii workflows, with what starts each and whether it's turned on.

**Inputs**: None.

**Outputs**

- `count` (number): How many are listed
- `workflows` (list): The workflows

**Example output**

```json
{
  "count": 1,
  "workflows": [
    {
      "app_id": 0,
      "created_at": "2026-01-05",
      "id": 1000,
      "is_active": true,
      "is_valid": true,
      "last_triggered_at": "2026-11-05",
      "name": "Slack new app notification",
      "trigger_type": "newApp"
    }
  ]
}
```

### Mark user removed from app

Record in Torii that a person was removed from an app, such as once their account there is closed during offboarding, or undo that.

**Inputs**

- User (`user`, text, required): The person's Torii user ID, from another Torii step or the trigger, or their email.
- App (`app`, text, required): The app, or its Torii ID.
- Removed (`removed`, true/false): On to mark them removed from the app; off to mark them back in it. Default: `true`.

**Outputs**

- `category` (text): Its category
- `id` (number): The app's ID in Torii
- `last_used_at` (text): When the user last used it (ISO 8601)
- `name` (text): Its name
- `removed_from_app` (true/false): True if the user was marked removed from it
- `sources` (list): Where Torii saw them use it
- `state` (text): Its state, such as sanctioned
- `url` (text): Its website
- `user_id` (number): The user's ID

**Example output**

```json
{
  "category": "Developer Tools",
  "id": 1000,
  "last_used_at": "2026-11-05T00:00:00.000Z",
  "name": "Salesforce",
  "removed_from_app": false,
  "sources": [
    "okta"
  ],
  "state": "discovered",
  "url": "https://example.com",
  "user_id": 1000
}
```

### Run workflow

Start a Torii workflow, with the app, person or contract its trigger is about. It does whatever the workflow does, such as offboarding someone or messaging an owner.

**Inputs**

- Workflow (`workflow`, text, required): The Torii workflow, or its ID.
- App (`app`, text): The app it's about, for a workflow started by an app, such as New app discovered.
- User email (`user_email`, text): The person it's about, for a workflow started by a person, such as User left.
- Contract (`contract`, text): The contract's Torii ID, for a workflow started by a contract.
- License (`license_name`, text): The license it's about, such as Pro, for a License not in use workflow. Give the App too.
- Webhook data (`payload`, object): For a workflow started by a Custom trigger (Webhook), the fields of its sample payload, such as days: 30.

**Outputs**

- `started` (true/false): True once Torii has started the workflow
- `workflow_id` (number): The workflow's ID

**Example output**

```json
{
  "started": true,
  "workflow_id": 1000
}
```

### Search app catalog

Find apps in Torii's catalog by name, to add one to your organization or set up a contract for it.

**Inputs**

- Name (`query`, text, required): Words in the app's name, such as Salesforce.
- How many (`limit`, number): The most to list at once. Defaults to 10. From 1 to 50.

**Outputs**

- `apps` (list): The catalog apps found
- `count` (number): How many are listed

**Example output**

```json
{
  "apps": [
    {
      "category": "Developer Tools",
      "id": 1000,
      "image_url": "http://example.com/image.png",
      "name": "Salesforce",
      "url": "https://example.com"
    }
  ],
  "count": 1
}
```

### Update app

Change an app's details, such as moving it to Sanctioned or Closed, giving it an owner, or filling in your own fields. Fields left blank keep what they have.

**Inputs**

- App (`app`, text, required): The app, or its Torii ID.
- Name (`name`, text): A new name. Leave blank to keep it.
- State (`state`, text): Its new state, such as Sanctioned or Closed.
- Primary owner (`owner`, text): Who owns the app: their Torii user ID or email.
- Category (`category`, text): Its category, such as Sales.
- Website (`url`, text): Its website.
- Description (`description`, text): What it is.
- Tags (`tags`, text): Its tags, separated by commas, such as DevOps, Finance. They replace the tags it has.
- Hidden (`hidden`, true/false): Hide the app in Torii, or show it again.
- Custom fields (`custom_fields`, object): Values for the app's other fields, such as your organization's own. Fill in only what should change.

**Outputs**

- `active_users` (number): How many people use it
- `category` (text): Its category, such as Developer Tools
- `created_at` (text): When it was added to Torii (ISO 8601)
- `custom_fields` (object): The values of the fields asked for under More fields, by their key, as Torii gives them
- `description` (text): What it is
- `id` (number): The app's ID in Torii
- `image_url` (text): A link to its logo
- `is_custom` (true/false): True if it was added as a custom app
- `is_hidden` (true/false): True if it's hidden in Torii
- `last_visit_at` (text): When someone last used it (ISO 8601)
- `name` (text): Its name
- `primary_owner_email` (text): Its primary owner's email
- `primary_owner_id` (number): Its primary owner's user ID; 0 if none
- `primary_owner_name` (text): Its primary owner's name
- `sources` (list): Where Torii found it, such as google or okta
- `state` (text): Its state, such as discovered or sanctioned
- `tags` (list): Its tags
- `url` (text): Its website
- `vendor` (text): Who makes it

**Example output**

```json
{
  "active_users": 25,
  "category": "Developer Tools",
  "created_at": "2020-01-01T00:00:00.000Z",
  "custom_fields": {},
  "description": "Awesome application",
  "id": 1000,
  "image_url": "http://example.com/image.png",
  "is_custom": false,
  "is_hidden": false,
  "last_visit_at": "2026-11-05T00:00:00.000Z",
  "name": "Salesforce",
  "primary_owner_email": "tony@stark.com",
  "primary_owner_id": 1000,
  "primary_owner_name": "Tony Stark",
  "sources": [
    "okta"
  ],
  "state": "discovered",
  "tags": [
    "DevOps",
    "Human Resource"
  ],
  "url": "https://example.com",
  "vendor": "Salesforce"
}
```

### Update contract

Change a contract, such as its status or end date when it renews. Fields left blank keep what they have.

**Inputs**

- Contract (`contract`, text, required): The contract's Torii ID, from another Torii step or the trigger.
- Name (`name`, text): A new name. Leave blank to keep it.
- App (`app`, text): Move it to another app. Leave blank to keep it.
- Status (`status`, text): A new status. Leave blank to keep it.
- Amount (`amount`, number): What the contract is worth, such as 12000.50. At least 0.
- Currency (`currency`, text): The amount's currency. Leave blank for your Torii currency. One of: `USD` (USD, US dollar), `EUR` (EUR, euro), `GBP` (GBP, British pound), `CAD` (CAD, Canadian dollar), `AUD` (AUD, Australian dollar), `NZD` (NZD, New Zealand dollar), `JPY` (JPY, Japanese yen), `CHF` (CHF, Swiss franc), `SEK` (SEK, Swedish krona), `NOK` (NOK, Norwegian krone), and 25 more.
- Start date (`start_date`, date): When it starts.
- End date (`end_date`, date): When it ends, which is when it renews.
- Owner (`owner`, text): Who owns it in your organization: their Torii user ID or email.
- Custom fields (`custom_fields`, object): Values for the contract's other fields, such as your organization's own. Fill in only what should change.

**Outputs**

- `amount` (number): What it's worth, such as 12000.50; 0 if not set
- `app_id` (number): The ID of the app it's for
- `created_at` (text): When it was added to Torii (ISO 8601)
- `currency` (text): The amount's currency, such as USD
- `custom_fields` (object): The values of the fields asked for under More fields, by their key, as Torii gives them
- `end_date` (text): When it ends, which is when it renews (YYYY-MM-DD)
- `id` (number): The contract's ID in Torii
- `name` (text): Its name
- `owner_id` (number): Its owner's user ID; 0 if none
- `start_date` (text): When it starts (YYYY-MM-DD)
- `status` (text): Its status, such as active or inReview

**Example output**

```json
{
  "amount": 15000,
  "app_id": 1000,
  "created_at": "2026-02-01T09:00:00.000Z",
  "currency": "USD",
  "custom_fields": {},
  "end_date": "2027-02-02",
  "id": 1000,
  "name": "Salesforce contract",
  "owner_id": 1000,
  "start_date": "2026-02-03",
  "status": "active"
}
```

### Update user lifecycle status

Set where a person is in their time at the organization: Active, Offboarding or Offboarded. Offboarded, for someone whose offboarding is under way, marks their remaining apps done and completes their open offboarding tasks.

**Inputs**

- User (`user`, text, required): The person's Torii user ID, from another Torii step or the trigger, or their email.
- Lifecycle status (`lifecycle_status`, text, required): Where they are now. One of: `active`, `offboarding`, `offboarded`.

**Outputs**

- `active_apps` (number): How many apps they use
- `additional_emails` (list): Their other emails
- `created_at` (text): When Torii first saw them (ISO 8601)
- `email` (text): Their email
- `first_name` (text): Their first name
- `has_left` (true/false): True if they've left the organization (removed from its identity source)
- `id` (number): The user's ID in Torii
- `is_external` (true/false): True if they're from outside the organization
- `last_name` (text): Their last name
- `lifecycle_status` (text): active, offboarding or offboarded
- `name` (text): Their full name
- `role` (text): Their role in Torii, such as Admin
- `role_id` (number): Their role's ID; 0 if none

**Example output**

```json
{
  "active_apps": 12,
  "additional_emails": [],
  "created_at": "2020-01-01T00:00:00.000Z",
  "email": "tony@stark.com",
  "first_name": "Tony",
  "has_left": false,
  "id": 1000,
  "is_external": false,
  "last_name": "Stark",
  "lifecycle_status": "active",
  "name": "Tony Stark",
  "role": "Admin",
  "role_id": 1
}
```
