{
  "service": "torii",
  "displayName": "Torii",
  "categories": [
    "Productivity",
    "Finance",
    "Security"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "API Key",
      "placeholder": "TORII_API_KEY",
      "description": "Torii API key sent as a Bearer token in the Authorization header. Generate it in Torii Settings > API Access: https://app.toriihq.com/team/settings/apiAccess.",
      "extraFields": []
    }
  ],
  "homepageUrl": "https://www.toriihq.com",
  "actions": [
    {
      "id": "torii.get_app",
      "service": "torii",
      "name": "get_app",
      "description": "Retrieve one Torii app by app identifier.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "appId": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647,
            "description": "The Torii app identifier."
          },
          "fields": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to return."
          },
          "includeLicenses": {
            "type": "boolean",
            "description": "Whether to include the aggregated license summary for the app."
          }
        },
        "additionalProperties": false,
        "required": [
          "appId"
        ],
        "description": "The input payload for retrieving one Torii app."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "app": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The Torii app identifier."
              },
              "name": {
                "type": "string",
                "description": "The app name."
              },
              "state": {
                "type": "string",
                "description": "The app lifecycle state."
              },
              "url": {
                "type": "string",
                "description": "The app URL."
              },
              "category": {
                "type": "string",
                "description": "The app category."
              }
            },
            "additionalProperties": true,
            "description": "A Torii app object."
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when retrieving one Torii app."
      }
    },
    {
      "id": "torii.get_contract",
      "service": "torii",
      "name": "get_contract",
      "description": "Retrieve one Torii contract by contract identifier.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "contractId": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647,
            "description": "The Torii contract identifier."
          },
          "apiVersion": {
            "type": "string",
            "enum": [
              "1.0",
              "1.1"
            ],
            "description": "The Torii contracts API version header to send."
          },
          "fields": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to return."
          }
        },
        "additionalProperties": false,
        "required": [
          "contractId"
        ],
        "description": "The input payload for retrieving one Torii contract."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "contract": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The Torii contract identifier."
              },
              "idApp": {
                "type": "integer",
                "description": "The Torii app identifier linked to the contract."
              },
              "name": {
                "type": "string",
                "description": "The contract name."
              },
              "status": {
                "type": "string",
                "description": "The contract status."
              }
            },
            "additionalProperties": true,
            "description": "A Torii contract object."
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when retrieving one Torii contract."
      }
    },
    {
      "id": "torii.get_organization",
      "service": "torii",
      "name": "get_organization",
      "description": "Retrieve the Torii organization profile for the current API key.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "The input payload for retrieving the current Torii organization."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "organization": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The Torii organization identifier."
              },
              "companyName": {
                "type": "string",
                "description": "The organization company name."
              },
              "domain": {
                "type": "string",
                "description": "The organization domain."
              },
              "creationTime": {
                "type": "string",
                "description": "The organization creation timestamp."
              }
            },
            "additionalProperties": true,
            "description": "A Torii organization object."
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when retrieving the current Torii organization."
      }
    },
    {
      "id": "torii.get_user",
      "service": "torii",
      "name": "get_user",
      "description": "Retrieve one Torii user by user identifier.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647,
            "description": "The Torii user identifier."
          }
        },
        "additionalProperties": false,
        "description": "The input payload for retrieving one Torii user."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The Torii user identifier."
              },
              "firstName": {
                "type": "string",
                "description": "The user's first name."
              },
              "lastName": {
                "type": "string",
                "description": "The user's last name."
              },
              "email": {
                "type": "string",
                "description": "The user's primary email address."
              },
              "lifecycleStatus": {
                "type": "string",
                "description": "The user's lifecycle status."
              }
            },
            "additionalProperties": true,
            "description": "A Torii user object."
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when retrieving one Torii user."
      }
    },
    {
      "id": "torii.list_apps",
      "service": "torii",
      "name": "list_apps",
      "description": "List Torii apps with optional search, filters, and cursor pagination.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "fields": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to return."
          },
          "q": {
            "type": "string",
            "minLength": 1,
            "description": "A free-text search query."
          },
          "sort": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to sort by, suffixed with :asc or :desc."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "The maximum number of results to return."
          },
          "cursor": {
            "type": "string",
            "minLength": 1,
            "description": "The Torii nextCursor value returned from the previous page."
          },
          "aggs": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "Torii aggregation configuration. Provide a JSON-encoded string."
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "Torii aggregation configuration. Provide a JSON object and the connector will encode it."
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "A Torii filter or aggregation object."
                },
                "description": "Torii aggregation configuration. Provide a JSON array and the connector will encode it."
              }
            ],
            "description": "Torii aggregation configuration."
          },
          "filters": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "Torii filters expression. Provide a JSON-encoded string."
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "Torii filters expression. Provide a JSON object and the connector will encode it."
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "A Torii filter or aggregation object."
                },
                "description": "Torii filters expression. Provide a JSON array and the connector will encode it."
              }
            ],
            "description": "Torii filters expression."
          },
          "includeLicenses": {
            "type": "boolean",
            "description": "Whether to include aggregated license summaries for each app."
          }
        },
        "additionalProperties": false,
        "description": "The input payload for listing Torii apps."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "apps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "The Torii app identifier."
                },
                "name": {
                  "type": "string",
                  "description": "The app name."
                },
                "state": {
                  "type": "string",
                  "description": "The app lifecycle state."
                },
                "url": {
                  "type": "string",
                  "description": "The app URL."
                },
                "category": {
                  "type": "string",
                  "description": "The app category."
                }
              },
              "additionalProperties": true,
              "description": "A Torii app object."
            },
            "description": "The apps returned by Torii."
          },
          "count": {
            "anyOf": [
              {
                "type": "integer",
                "description": "The number of results returned in this response."
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "description": "The total number of matching results."
              },
              {
                "type": "null"
              }
            ]
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "description": "The cursor for the next result page, or null when there are no more results."
              },
              {
                "type": "null"
              }
            ]
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when listing Torii apps."
      }
    },
    {
      "id": "torii.list_contracts",
      "service": "torii",
      "name": "list_contracts",
      "description": "List Torii contracts with optional API version, filters, and pagination.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string",
            "enum": [
              "1.0",
              "1.1"
            ],
            "description": "The Torii contracts API version header to send."
          },
          "fields": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to return."
          },
          "q": {
            "type": "string",
            "minLength": 1,
            "description": "A free-text search query."
          },
          "sort": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to sort by, suffixed with :asc or :desc."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "The maximum number of results to return."
          },
          "cursor": {
            "type": "string",
            "minLength": 1,
            "description": "The Torii nextCursor value returned from the previous page."
          },
          "aggs": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "Torii aggregation configuration. Provide a JSON-encoded string."
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "Torii aggregation configuration. Provide a JSON object and the connector will encode it."
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "A Torii filter or aggregation object."
                },
                "description": "Torii aggregation configuration. Provide a JSON array and the connector will encode it."
              }
            ],
            "description": "Torii aggregation configuration."
          },
          "filters": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "Torii filters expression. Provide a JSON-encoded string."
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "Torii filters expression. Provide a JSON object and the connector will encode it."
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "A Torii filter or aggregation object."
                },
                "description": "Torii filters expression. Provide a JSON array and the connector will encode it."
              }
            ],
            "description": "Torii filters expression."
          },
          "filterFields": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Exact-match Torii contract filters keyed by contract field or custom field system key."
          }
        },
        "additionalProperties": false,
        "description": "The input payload for listing Torii contracts."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "contracts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "The Torii contract identifier."
                },
                "idApp": {
                  "type": "integer",
                  "description": "The Torii app identifier linked to the contract."
                },
                "name": {
                  "type": "string",
                  "description": "The contract name."
                },
                "status": {
                  "type": "string",
                  "description": "The contract status."
                }
              },
              "additionalProperties": true,
              "description": "A Torii contract object."
            },
            "description": "The contracts returned by Torii."
          },
          "count": {
            "anyOf": [
              {
                "type": "integer",
                "description": "The number of results returned in this response."
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "description": "The total number of matching results."
              },
              {
                "type": "null"
              }
            ]
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "description": "The cursor for the next result page, or null when there are no more results."
              },
              {
                "type": "null"
              }
            ]
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when listing Torii contracts."
      }
    },
    {
      "id": "torii.list_transactions",
      "service": "torii",
      "name": "list_transactions",
      "description": "List recognized Torii expense transactions with optional filters and pagination.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "idApp": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647,
            "description": "The Torii app identifier to filter transactions by."
          },
          "source": {
            "type": "string",
            "minLength": 1,
            "description": "The transaction source to filter by."
          },
          "q": {
            "type": "string",
            "minLength": 1,
            "maxLength": 800,
            "description": "A free-text search query for transaction descriptions."
          },
          "mappingStatus": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of Torii transaction mapping statuses."
          },
          "sort": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to sort by, suffixed with :asc or :desc."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "The maximum number of results to return."
          },
          "cursor": {
            "type": "string",
            "minLength": 1,
            "description": "The Torii nextCursor value returned from the previous page."
          },
          "fields": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to return."
          }
        },
        "additionalProperties": false,
        "description": "The input payload for listing Torii transactions."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "A Torii transaction object."
            },
            "description": "The transactions returned by Torii."
          },
          "count": {
            "anyOf": [
              {
                "type": "integer",
                "description": "The number of results returned in this response."
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "description": "The total number of matching results."
              },
              {
                "type": "null"
              }
            ]
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "description": "The cursor for the next result page, or null when there are no more results."
              },
              {
                "type": "null"
              }
            ]
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when listing Torii transactions."
      }
    },
    {
      "id": "torii.list_users",
      "service": "torii",
      "name": "list_users",
      "description": "List Torii users with optional filters, search, and cursor pagination.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The user email address to filter by.",
            "format": "email"
          },
          "lifecycleStatus": {
            "type": "string",
            "enum": [
              "active",
              "offboarding",
              "offboarded"
            ],
            "description": "The user lifecycle status to filter by."
          },
          "isDeletedInIdentitySources": {
            "type": "boolean",
            "description": "Whether to filter users deleted in identity sources."
          },
          "isExternal": {
            "type": "boolean",
            "description": "Whether to filter external users."
          },
          "firstName": {
            "type": "string",
            "minLength": 1,
            "description": "The first name to filter by."
          },
          "lastName": {
            "type": "string",
            "minLength": 1,
            "description": "The last name to filter by."
          },
          "idUsers": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of up to 50 Torii user identifiers."
          },
          "view": {
            "type": "string",
            "enum": [
              "currentEmployees",
              "pastEmployees",
              "allEmployees",
              "currentUsers",
              "pastUsers",
              "allUsers",
              "currentNonHumanUsers",
              "pastNonHumanUsers",
              "allNonHumanUsers",
              "externalUsers"
            ],
            "description": "The Torii users view to query."
          },
          "fields": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to return."
          },
          "q": {
            "type": "string",
            "minLength": 1,
            "description": "A free-text search query."
          },
          "sort": {
            "type": "string",
            "minLength": 1,
            "description": "A comma-separated list of fields to sort by, suffixed with :asc or :desc."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "The maximum number of results to return."
          },
          "cursor": {
            "type": "string",
            "minLength": 1,
            "description": "The Torii nextCursor value returned from the previous page."
          },
          "aggs": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "Torii aggregation configuration. Provide a JSON-encoded string."
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "Torii aggregation configuration. Provide a JSON object and the connector will encode it."
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "A Torii filter or aggregation object."
                },
                "description": "Torii aggregation configuration. Provide a JSON array and the connector will encode it."
              }
            ],
            "description": "Torii aggregation configuration."
          },
          "filters": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "Torii filters expression. Provide a JSON-encoded string."
              },
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true,
                "description": "Torii filters expression. Provide a JSON object and the connector will encode it."
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "A Torii filter or aggregation object."
                },
                "description": "Torii filters expression. Provide a JSON array and the connector will encode it."
              }
            ],
            "description": "Torii filters expression."
          }
        },
        "additionalProperties": false,
        "description": "The input payload for listing Torii users."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "The Torii user identifier."
                },
                "firstName": {
                  "type": "string",
                  "description": "The user's first name."
                },
                "lastName": {
                  "type": "string",
                  "description": "The user's last name."
                },
                "email": {
                  "type": "string",
                  "description": "The user's primary email address."
                },
                "lifecycleStatus": {
                  "type": "string",
                  "description": "The user's lifecycle status."
                }
              },
              "additionalProperties": true,
              "description": "A Torii user object."
            },
            "description": "The users returned by Torii."
          },
          "count": {
            "anyOf": [
              {
                "type": "integer",
                "description": "The number of results returned in this response."
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "description": "The total number of matching results."
              },
              {
                "type": "null"
              }
            ]
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "description": "The cursor for the next result page, or null when there are no more results."
              },
              {
                "type": "null"
              }
            ]
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when listing Torii users."
      }
    },
    {
      "id": "torii.list_workflows",
      "service": "torii",
      "name": "list_workflows",
      "description": "List Torii regular workflows for the organization.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "regular"
            ],
            "description": "The workflow type to query. Torii currently supports regular."
          }
        },
        "additionalProperties": false,
        "description": "The input payload for listing Torii workflows."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "workflows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "The Torii workflow identifier."
                },
                "version": {
                  "type": "string",
                  "description": "The workflow schema version."
                },
                "name": {
                  "type": "string",
                  "description": "The workflow name."
                },
                "type": {
                  "type": "string",
                  "description": "The workflow type."
                }
              },
              "additionalProperties": true,
              "description": "A Torii workflow object."
            },
            "description": "The workflows returned by Torii."
          },
          "raw": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "The raw Torii response object."
          }
        },
        "additionalProperties": false,
        "description": "The response returned when listing Torii workflows."
      }
    }
  ]
}
