arazzo: 1.0.1 info: title: Logz.io Verify Token And Discover Accounts summary: Confirm which account a token belongs to, then list its associated accounts. description: >- Validates an API token and discovers the accounts it can reach. The workflow calls whoami to confirm the token's account name and id, then fetches all accounts derived from that account and branches on whether any associated sub accounts were returned. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: logzioApi url: ../openapi/logz-io-api-openapi.yml type: openapi workflows: - workflowId: verify-account summary: Confirm the token's account and list its related accounts. description: >- Calls whoami to confirm the token's account, then retrieves all related accounts, branching on whether more than one account was returned. inputs: type: object required: - apiToken properties: apiToken: type: string description: Logz.io API token sent in the X-API-TOKEN header. steps: - stepId: whoAmI description: >- Confirm which account the token belongs to by reading the account name and id. operationId: whoAmI parameters: - name: X-API-TOKEN in: header value: $inputs.apiToken successCriteria: - condition: $statusCode == 200 outputs: accountName: $response.body#/accountName accountId: $response.body#/accountId - stepId: relatedAccounts description: >- List all accounts derived from the token's account. If the token belongs to an owner account, all sub accounts are returned. operationId: getRelatedAccounts parameters: - name: X-API-TOKEN in: header value: $inputs.apiToken successCriteria: - condition: $statusCode == 200 outputs: firstAccountId: $response.body#/0/accountId onSuccess: - name: hasSubAccounts type: end criteria: - context: $response.body condition: $.length > 1 type: jsonpath - name: standaloneAccount type: end criteria: - context: $response.body condition: $.length == 1 type: jsonpath outputs: accountId: $steps.whoAmI.outputs.accountId accountName: $steps.whoAmI.outputs.accountName