openapi: 3.0.1
info:
  title: Embedded 2025-09
  version: "5.0"
servers:
  - url: https://production.runalloy.com
components:
  parameters:
    xApiVersion:
      name: x-api-version
      in: header
      required: true
      description: The version of the API to use. The current API version is **2025-09**.
      schema:
        type: string
        default: "2025-09"
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer
paths:
  /users/{userId}:
    put:
      summary: Update a user
      description: >-
        Updates a user given a specified userId. This endpoint allows you to
        update a username or fullName and returns the updated user object.
      operationId: update-a-user
      parameters:
        - name: userId
          in: path
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint. Note: you can also use the Embedded user's `username` in
            this field.
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                  description: The unique identifier of the user
                fullName:
                  type: string
                  description: The name of the user
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    userId: "6323d7c9122ae69742a5d0a2"
                    fullName: "Gregg Mojica"
                    username: "greggmojica"
              schema:
                type: object
                properties:
                  userId:
                    type: string
                    example: 6323d7c9122ae69742a5d0a2
                  fullName:
                    type: string
                    example: Gregg Mojica
                  username:
                    type: string
                    example: greggmojica
        "401":
          description: "401"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "Unauthorized"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Unauthorized
      deprecated: false
      security: []
    get:
      summary: Retrieve a single user
      description: >-
        Returns a specific user given a userId and any active workflows
        associated with the user.
      operationId: get-a-user
      parameters:
        - name: userId
          in: path
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint. Note: you can also use the Embedded user's `username` in
            this field.
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              schema:
                type: object
                properties:
                  userId:
                    type: string
                    example: "6323d7c9122ae69742a5d0a2"
                  fullName:
                    type: string
                    example: "Gregg Mojica"
                  username:
                    type: string
                    example: "support@runalloy.com"
                required:
                  - userId
                  - fullName
                  - username
              examples:
                Result:
                  value:
                    userId: "6323d7c9122ae69742a5d0a2"
                    fullName: "Gregg Mojica"
                    username: "support@runalloy.com"
      deprecated: false
      security: []
    delete:
      summary: Delete a user
      description: >-
        This endpoint deletes a user account. It is most commonly used when a
        user stops being a customer of your platform or in conjunction with a
        GDPR compliance request. Note that this endpoint only deletes the user's
        account – not any corresponding workflow logs or other data. To remove
        that data as part of a compliance request, see our 'Delete User Logs'
        endpoint
      operationId: delete-a-user
      parameters:
        - name: userId
          in: path
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint. Note: you can also use the Embedded user's `username` in
            this field.
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    success: true
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    default: true
        "401":
          description: "401"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "Unauthorized"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Unauthorized
      deprecated: false
      security: []
  /users/:
    post:
      summary: Create a user
      description: >-
        Creates a new user in your Embedded account. The user record acts like a
        "container" to store all the integrations, workflows, and credentials
        for any given user. Returns a user identifier.
      operationId: create-a-user
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - username
              properties:
                fullName:
                  type: string
                  description: >-
                    The name of the user you want to create. Typically a full
                    name.
                username:
                  type: string
                  description: >-
                    The username to be associated with the user.  To easily
                    identify a customer, we recommend using a friendly username
                    such as an email for example. The username must be unique
                    (this acts as an identifier to reference and lookup a given
                    merchant on your platform).
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    userId: "xyz123abc098754"
              schema:
                type: object
                properties:
                  userId:
                    type: string
                    example: xyz123abc098754
        "401":
          description: "401"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /users:
    get:
      summary: Retrieve a list of all users
      description: Returns a list of all users created in your Embedded account.
      operationId: list-all-users
      parameters:
        - name: parentWorkflowId
          in: query
          description: >-
            You can pass a parentWorkflowId if you wish to list users for a
            specific workflow.
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - userId: "6323d7c9122ae69742a5d0a2"
                        username: "gregg"
                        fullName: "Gregg Mojica"
                      - userId: "6323d7cf9ae88f59bf66ce63"
                        username: "sara"
                        fullName: "Sara Du"
                      - userId: "6323d7e159479ba26d80fcc8"
                        fullName: "William Jackson"
                      - userId: "6323d7f090020baf1091b151"
                        username: "izzy@gmail.com"
                        fullName: "Izzy Jackson"
                      - userId: "6323d7da4b764bfe02cacaef"
                        username: "jose@example.com"
                        fullName: "Jose Santos"
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        userId:
                          type: string
                          example: 6323d7c9122ae69742a5d0a2
                        username:
                          type: string
                          example: gregg
                        fullName:
                          type: string
                          example: Gregg Mojica
        "401":
          description: "401"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "Unauthorized"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Unauthorized
      deprecated: false
      security: []
  /headless/credentials:
    post:
      summary: Create Credential
      description: >-
        Use this endpoint to add a credential programmatically via the API. This
        endpoint should be used primarily for non-OAuth blocks. If you are using
        custom OAuth with an OAuth block and you have the OAuth tokens
        already, you can add them to Alloy with this endpoint. Please reference
        [this](/embedded/headless-mode) section of our docs for
        a complete tutorial on when and how to use this endpoint.
      operationId: create-a-credential
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - credential
                - userId
              properties:
                credential:
                  type: object
                  description: The data for the credential you want to create.
                  properties:
                    type:
                      type: string
                      description: Connector name, e.g., "netsuite".
                    data:
                      type: object
                      description: Connector authentication required parameters.
                      properties:
                        realm:
                          type: string
                        consumerKey:
                          type: string
                        tokenId:
                          type: string
                        tokenSecret:
                          type: string
                userId:
                  type: string
                  description: The id of the currently logged in user
            examples:
              Request Example:
                value:
                  userId: string
                  credential:
                    type: netsuite
                    data:
                      realm: XXX
                      consumerKey: XXX
                      tokenId: XXX
                      tokenSecret: XXX
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    success: true
                    credentialId: "63252d14cc29df15cc481a76"
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    default: true
                  credentialId:
                    type: string
                    example: 63252d14cc29df15cc481a76
      deprecated: false
      security: []
  /metadata/credentials:
    get:
      summary: Retrieve all credential structures
      description: >-
        This endpoint returns a basic structure of what data must be inputted
        when adding a credential manually. This should be used when creating a
        credential using the POST credential endpoint.


        This endpoint returns the structure of every supported block on Alloy
        Embedded. It returns a boolean flag called `isOauth` which indicates if
        the credential uses OAuth or an API key.
      operationId: get-credential-metadata
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - connector: "acuityScheduling"
                        icon: "https://cdn.runalloy.com/icons/acuityScheduling.png"
                        isOauth: false
                        properties:
                          - name: "apiKey"
                            displayName: "API Key"
                          - name: "userId"
                            displayName: "User Id"
                      - connector: "amazonBusiness"
                        icon: "https://cdn.runalloy.com/icons/amazonBusiness.png"
                        isOauth: true
                        properties:
                          - name: "regionCountry"
                            displayName: "Country"
                            description: ""
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        connector:
                          type: string
                          example: acuityScheduling
                        icon:
                          type: string
                          example: https://cdn.runalloy.com/icons/acuityScheduling.png
                        isOauth:
                          type: boolean
                          example: false
                          default: true
                        properties:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                                example: apiKey
                              displayName:
                                type: string
                                example: API Key
      deprecated: false
      security: []
  /users/{userId}/token:
    get:
      summary: Generate a new JWT for a user
      description: >-
        This endpoint is used to generate a new user token in the form of a JSON
        Web Token (JWT) which is required to securely render the Embedded Modal
        in your application. Once retrieved, you'll want to pass this token to
        your frontend.
      operationId: generate-jwt-token
      parameters:
        - name: userId
          in: query
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint. Note: you can also use the Embedded user's `username` in
            this field.
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/users/{userId}/token?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/users/{userId}/token"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const url = `https://production.runalloy.com/users/${userId}/token?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $url = "https://production.runalloy.com/users/{$userId}/token?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                baseURL := "https://production.runalloy.com/users/" + userId + "/token"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String baseUrl = "https://production.runalloy.com/users/" + userId + "/token";
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            base_url = "https://production.runalloy.com/users/#{userId}/token"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    token: "XXXXXXXXXXXXXX.YYYYYYYYYYYYYY.ZZZZZZZZZZZZZZ"
              schema:
                type: object
                properties:
                  token:
                    type: string
                    example: XXXXXXXXXXXXXX.YYYYYYYYYYYYYY.ZZZZZZZZZZZZZZ
      deprecated: false
      security: []
  /credentials/users/{userId}:
    get:
      summary: Retrieve all credentials for a user
      description: Returns a list of all credentials created for a specified user.
      operationId: list-user-credentials
      parameters:
        - name: userId
          in: path
          description: The id of the currently logged in user
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - credentialId: "66fb066c3793749b64c214bc"
                        type: "shopify"
                        name: "Shopify alloy-sandbox.myshopify.com"
                        createdAt: "2024-09-30T20:13:32.491Z"
                        updatedAt: "2024-09-30T20:13:32.522Z"
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        credentialId:
                          type: string
                          example: 63253068590a5f1d6cc9b635
                        type:
                          type: string
                          example: shopify
                        createdAt:
                          type: string
                          example: "2022-09-17T02:12:25.619Z"
                        updatedAt:
                          type: string
                          example: "2022-09-17T02:12:25.620Z"
      deprecated: false
      security: []
  /workflows/install:
    post:
      summary: Install workflows
      description: >-
        Installs workflows for a specified user.
      operationId: install-workflows
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - workflowIds
                - credentialIds
                - userId
              properties:
                workflowIds:
                  type: array
                  items:
                    type: string
                credentialIds:
                  type: array
                  items:
                    type: string
                userId:
                  type: string
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    installed: true
              schema:
                type: object
                properties:
                  installed:
                    type: boolean
                    example: true
                    default: true
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "Could not install workflow(s)"
      deprecated: false
      security: []
  /workflows:
    get:
      summary: Retrieve a list of workflows
      description: >-
        Returns a list of all active **parent** workflows associated with your
        Alloy Embedded account. Note this endpoint does _not_ return a list of
        workflows that the user has installed, but rather a list of all
        _available_ workflows. The `installed` flag indicates if the user has
        installed a copy of the workflow but does not  indicate if the user has
        a given workflow "active".


        For each workflow, this endpoint returns the individual apps that are
        required as part of the workflow. Commonly used to populate data on an
        integrations page.
      operationId: list-workflows
      parameters:
        - name: userId
          in: query
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint. Note: you can also use the Embedded user's `username` in
            this field.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/workflows?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/workflows"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const url = `https://production.runalloy.com/workflows?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $url = "https://production.runalloy.com/workflows?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                baseURL := "https://production.runalloy.com/workflows"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String urlString = "https://production.runalloy.com/workflows?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            uri = URI("https://production.runalloy.com/workflows")
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - workflowId: "6544eac8e1ee020334af4ec8"
                        name: "Untitled Workflow #595"
                        createdAt: "2023-11-03T12:42:48.304Z"
                        updatedAt: "2023-11-03T13:12:45.522Z"
                        installed: false
                        active: false
                        version: 1
                        integrationId: "6544193cd8c482b3fe875101"
                        connectors:
                          - connectorName: "KnoCommerce Trigger"
                            connectorId: "3fe19002-a854-466a-b1c7-682d6fbe398a"
                            connector: "knoCommerceTrigger"
                            icon: "https://cdn.runalloy.com/icons/knoCommerce.png"
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /workflows/deactivate:
    put:
      summary: Deactivate a workflow
      description: >-
        Disables all future invocations and runs for a given workflow.


        By deactivating a workflow, this endpoint will turn off any events or
        webhooks a workflow is subscribed to. May be reactivated by the
        Reactivate workflow endpoint.
      operationId: deactivate-a-workflow
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - userId
              properties:
                userId:
                  type: string
                  description: >-
                    The Id of the user you want to lookup. Returned from the
                    Create User endpoint. Note: you can also use the Embedded
                    user's `username` in this field.
                workflowId:
                  type: string
                  description: >-
                    The Id of the workflow to activate. If you pass this
                    parameter, then `workflowName` is not required.
                workflowName:
                  type: string
                  description: >-
                    The name of the workflow to activate.  If you pass this
                    parameter, then `workflowId` is not required.
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    activated: false
              schema:
                type: object
                properties:
                  activated:
                    type: boolean
                    example: false
                    default: true
      deprecated: false
      security: []
  /workflows/activate:
    put:
      summary: Activate workflow for a user
      description: >-
        Reactivates a workflow that was previously disabled by the Disable
        Workflow endpoint. This endpoint requires a specified WorkflowId and
        returns a success/failure.
      operationId: activate-a-workflow
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - userId
              properties:
                userId:
                  type: string
                  description: >-
                    The Id of the user you want to lookup. Returned from the
                    Create User endpoint. Note: you can also use the Embedded
                    user's `username` in this field.
                workflowName:
                  type: string
                  description: >-
                    The name of the workflow to activate.  If you pass this
                    parameter, then `workflowId` is not required.
                workflowId:
                  type: string
                  description: >-
                    The Id of the workflow to activate. If you pass this
                    parameter, then `workflowName` is not required.
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    activated: true
              schema:
                type: object
                properties:
                  activated:
                    type: boolean
                    example: true
                    default: true
      deprecated: false
      security: []
  /workflows/{workflowId}/analytics:
    get:
      summary: Retrieve usage metrics for a workflow
      description: >-
        This endpoint returns the `totalAppActions` (the number of times each
        block inside the workflow has been executed over the course of the
        workflow's lifetime), the `totalWorkflowRuns` (which represents the
        number of times the workflow has been invoked) and the `totalErrors`
        (the number of times the workflow has had an error).
      operationId: get-workflow-analytics
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: workflowId
          in: path
          description: The Id of the workflow you want to find errors for
          schema:
            type: string
          required: true
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    totalAppActions: 14
                    totalWorkflowRuns: 14
                    totalErrors: 0
              schema:
                type: object
                properties:
                  totalAppActions:
                    type: integer
                    example: 14
                    default: 0
                  totalWorkflowRuns:
                    type: integer
                    example: 14
                    default: 0
                  totalErrors:
                    type: integer
                    example: 0
                    default: 0
      deprecated: false
      security: []
  /users/{userId}/deactivate-workflows:
    put:
      summary: Deactivate workflows for a user
      description: >-
        Deactivates all active workflows for a user in bulk.


        This endpoint may be used to perform a bulk operation such as
        temporarily disabling a user's account in lieu of deleting the user
        account if the user wants to "pause" their account.
      operationId: disable-all-workflows-for-a-user
      parameters:
        - name: userId
          in: path
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "Success"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Success
      deprecated: false
      security: []
  /workflows/{workflowId}/logs:
    get:
      summary: Retrieve logs for a single workflow
      description: >-
        Retrieves log data for a given workflow.

        Each log includes the `executionId` (which can be used to rerun an
        execution), the `startedAt` and `stoppedAt` date stamps, and the JSON
        output of the execution.
      operationId: get-workflow-logs
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: workflowId
          in: path
          description: The Id of the git workflow you want to find logs for
          schema:
            type: string
          required: true
        - name: userId
          in: query
          description: >-
            The Id of the user you want delete logs for. Returned from the
            Create User endpoint
          schema:
            type: string
        - name: page
          in: query
          description: page of results
          schema:
            type: integer
            format: int32
        - name: limit
          in: query
          description: Number of results per page (max 30, default 10)
          schema:
            type: integer
            format: int32
        - name: order
          in: query
          description: asc or desc for ascending/descending (default desc)
          schema:
            type: string
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/workflows/{workflowId}/logs?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/workflows/{workflowId}/logs"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const workflowId = "{workflowId}";
            const url = `https://production.runalloy.com/workflows/${workflowId}/logs?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $workflowId = "{workflowId}";
            $url = "https://production.runalloy.com/workflows/{$workflowId}/logs?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                workflowId := "{workflowId}"
                baseURL := "https://production.runalloy.com/workflows/" + workflowId + "/logs"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String workflowId = "{workflowId}";
                    String baseUrl = "https://production.runalloy.com/workflows/" + workflowId + "/logs";
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            workflowId = "{workflowId}"
            base_url = "https://production.runalloy.com/workflows/#{workflowId}/logs"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - executionId: "uGmauA50FBlibba3JkPfB"
                        startedAt: "2024-11-15T17:57:42.233Z"
                        stoppedAt: "2024-11-15T17:57:42.847Z"
                        finished: true
                        results:
                          - startedAt: "2024-11-15T17:57:42.233Z"
                            stoppedAt: "2024-11-15T17:57:42.287Z"
                            data:
                              - 
                                - json: {}
                                  id: "1e2ef00f-af4c-405e-88b7-c71536d28ddd"
                            connectorId: "6ad63c40-1abc-4289-8287-c62ef8bb2003"
                          - startedAt: "2024-11-15T17:57:42.391Z"
                            data:
                              - 
                                - json:
                                  profileId:
                                    type: "profile"
                                    id: "01F1EQ9A32KABYFC7Q0QNNHH33"
                                    attributes:
                                      email: "gregg@runalloy.com"
                                      phone_number: "+12394750599"
                                      external_id: null
                                    relationships:
                                      lists:
                                        links:
                                          self: "https://a.klaviyo.com/api/profiles/01F1EQ9A32KABYFC7Q0QNNHH33/relationships/lists/"
                                          related: "https://a.klaviyo.com/api/profiles/01F1EQ9A32KABYFC7Q0QNNHH33/lists/"
                                      segments:
                                        links:
                                          self: "https://a.klaviyo.com/api/profiles/01F1EQ9A32KABYFC7Q0QNNHH33/relationships/segments/"
                                          related: "https://a.klaviyo.com/api/profiles/01F1EQ9A32KABYFC7Q0QNNHH33/segments/"
                                      conversation:
                                        links:
                                          self: "https://a.klaviyo.com/api/profiles/01F1EQ9A32KABYFC7Q0QNNHH33/relationships/conversation/"
                                          related: "https://a.klaviyo.com/api/profiles/01F1EQ9A32KABYFC7Q0QNNHH33/conversation/"
                                    links:
                                      self: "https://a.klaviyo.com/api/profiles/01F1EQ9A32KABYFC7Q0QNNHH33/"
                                  statusCode: 200
                                  id: "a6c68f48-4ef0-4d16-a009-3b47db6f611f"
                            stoppedAt: "2024-11-15T17:57:42.781Z"
                            connectorId: "ae331681-25a5-452c-8d21-884fada67437"
                        inputs:
                          - connectorId: "6ad63c40-1abc-4289-8287-c62ef8bb2003"
                            data: {}
                          - connectorId: "ae331681-25a5-452c-8d21-884fada67437"
                            data:
                              apiVersion: "legacy"
                              profileFrom: "emailAddress"
                              email: "gregg@runalloy.com"
      deprecated: false
      security: []
  /workflows/{workflowId}/errors:
    get:
      summary: Retrieve all error logs for a workflow
      description: >-
        Use this endpoint to get the error logs for a specific workflow.

        It returns the error message, and the date stamp when the error was
        thrown, the block that caused the error, and the `workflowId` . Commonly
        used to debug workflows when they error and identify historical errors;
        this endpoint may be used in conjunction with the route error messages
        feature.


        If there are no errors for the specified workflow, this endpoint will
        return an empty array.
      operationId: get-workflow-errors
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: workflowId
          in: path
          description: The Id of the workflow you want to find errors for
          schema:
            type: string
          required: true
        - name: userId
          in: query
          description: >-
            The Id of the user
          schema:
            type: string
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/workflows/{workflowId}/errors?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/workflows/{workflowId}/errors"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const workflowId = "{workflowId}";
            const url = `https://production.runalloy.com/workflows/${workflowId}/errors?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $workflowId = "{workflowId}";
            $url = "https://production.runalloy.com/workflows/{$workflowId}/errors?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                workflowId := "{workflowId}"
                baseURL := "https://production.runalloy.com/workflows/" + workflowId + "/errors"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String workflowId = "{workflowId}";
                    String baseUrl = "https://production.runalloy.com/workflows/" + workflowId + "/errors";
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            workflowId = "{workflowId}"
            base_url = "https://production.runalloy.com/workflows/#{workflowId}/errors"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - workflowId: "632531cf3beb6c98611abd09"
                        connector: "shopify"
                        errorOccurredAt: "2022-09-17T22:12:34.567Z"
                        message: "The customer failed to create due to an invalid Id"
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /users/{userId}/logs:
    delete:
      summary: Delete all logs for a user
      description: >-
        This endpoint deletes all historical logs associated with a user and is
        most commonly used in conjunction with a compliance request such as
        GDPR. This endpoint requires a userId.


        Note that this action cannot be undone.
      operationId: delete-logs-for-a-user
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: userId
          in: query
          description: >-
            The Id of the user you want delete logs for. Returned from the
            Create User endpoint
          schema:
            type: string
          required: true
      x-code-samples:
        - lang: cURL
          source: |
            curl -X DELETE "https://production.runalloy.com/users/{userId}/logs?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/users/{userId}/logs"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.delete(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const url = `https://production.runalloy.com/users/${userId}/logs?userId=${userId}`;

            fetch(url, {
              method: "DELETE",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $url = "https://production.runalloy.com/users/{$userId}/logs?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                baseURL := "https://production.runalloy.com/users/" + userId + "/logs"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("DELETE", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String baseUrl = "https://production.runalloy.com/users/" + userId + "/logs";
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("DELETE");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            base_url = "https://production.runalloy.com/users/#{userId}/logs"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Delete.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "Success"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Success
      deprecated: false
      security: []
  /users/{userId}/credentials/{credentialId}:
    delete:
      summary: Delete a Credential for a user
      description: >-
        To delete a credential via the API, you need to invoke the below
        endpoint.
      operationId: delete-a-credential
      parameters:
        - name: credentialId
          in: path
          description: The credential you're looking to delete
          schema:
            type: string
          required: true
        - name: userId
          in: path
          description: The Id of the user associated with this credential
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    success: true
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
      deprecated: false
      security: []
  /run/event:
    post:
      summary: Trigger an event for a user
      description: >-
        This endpoint runs a workflow that uses a **Custom Event**. Note that
        this endpoint cannot be used to invoke a workflow that has a Custom
        Webhook Trigger.


        If you have defined a custom JSON body for the Custom Event, it should
        be passed into the `data` body parameter.
      operationId: run-event
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - event
                - userId
                - data
              properties:
                event:
                  type: string
                  description: The name of the custom event to run.
                userId:
                  type: string
                  description: The user Id the workflow belongs to
                data:
                  type: object
                  description: >-
                    The key-value pairs you want to send as defined in the
                    custom event. This data will be used in expressions during
                    the workflow execution.
                  additionalProperties:
                    type: string
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "Event successfully triggered"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Event successfully triggered
      deprecated: false
      security: []
  /workflows/{workflowId}/rerun/{executionId}:
    post:
      summary: Rerun a single workflow execution
      description: >-
        Retrieves log data for a given workflow over time. Logs are stored for a
        maximum of 7 days before being purged.


        Each log includes the `executionId` (which can be used to rerun an
        execution), the `startedAt` and `stoppedAt` date stamps, and the JSON
        output of the execution.
      operationId: rerun-workfow
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: workflowId
          in: path
          description: The Id of the workflow you want to find logs for
          schema:
            type: string
          required: true
        - name: executionId
          in: path
          description: >-
            The Id of the execution to rerun. This can be retrieved from the GET
            Workflow Logs endpoint
          schema:
            type: string
          required: true
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "success"
                    executionId: "37e974f0-5d0c4035"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: success
                  executionId:
                    type: string
                    example: 37e974f0-5d0c4035
      deprecated: false
      security: []
  /run/workflow:
    post:
      summary: Run Workflow
      description: >-
        This endpoint runs a workflow that uses a **Webhook Trigger.** Note that
        this endpoint should not be used to invoke a workflow that has a Custom
        Event. If you have defined a custom JSON body for the webhook trigger,
        it should be passed into the `data` body parameter.
      operationId: run-workflow
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - userId
                - workflowId
                - workflowName
                - data
              properties:
                workflowName:
                  type: string
                  description: The name of the workflow to run.
                workflowId:
                  type: string
                  description: >-
                    The Id of the workflow to activate. If you pass this
                    parameter, then `workflowName` is not required.
                userId:
                  type: string
                  description: >-
                    The Id of the user you want to lookup. Returned from the
                    Create User endpoint. Note: you can also use the Embedded
                    user's `username` in this field.
                data:
                  type: object
                  description: >-
                    The key-value pairs you want to send as defined in the
                    webhook trigger. This data will be used in expressions
                    during the workflow execution.
                  example:
                    key: value
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "success"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: success
      deprecated: false
      security: []
  /metadata/apps:
    get:
      summary: Retrieve all supported apps
      description: Returns all the available apps currently supported by Alloy Embedded
      operationId: list-apps
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - connector: "acuityScheduling"
                        icon: "https://cdn.runalloy.com/icons/acuityScheduling.png"
                        type: ["action", "trigger"]
                        oauth: false
                      - connector: "shopify"
                        icon: "https://cdn.runalloy.com/icons/shopify.png"
                        type: ["action", "trigger"]
                        oauth: true
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /integrations:
    get:
      summary: Retrieve a list of all integrations
      description: >-
        Returns all the available integrations in your Alloy Embedded Account.
        Includes integrations/apps you've created an "integration" for, their
        workflows and statuses. If `installed` equals `true`, the
        `installedVersion` key will show the currently installed version.
      operationId: list-integrations
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: userId
          in: query
          description: >-
            The Id used to identify the user. Note: you can also use the
            Embedded user's `username` in this field.
          required: true
          schema:
            type: string
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/integrations?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/integrations"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const url = `https://production.runalloy.com/integrations?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $url = "https://production.runalloy.com/integrations?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                baseURL := "https://production.runalloy.com/integrations"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String urlString = "https://production.runalloy.com/integrations?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            uri = URI("https://production.runalloy.com/integrations")
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - integrationId: "66326843cc9cdb107221f222"
                        description: ""
                        primaryConnector: "Shopify"
                        installed: false
                        icon: "https://cdn.runalloy.com/icons/shopify.png"
                        workflows:
                          - workflowId: "66326849cc9cdb107221f342"
                            name: "Untitled Workflow #346"
                            installed: false
                            active: false
                            version: 1
                            connectors:
                              - name: "On Installation Trigger"
                                id: "4762a899-8f38-44d9-a091-f4b6eaba386e"
                                connector: "onInstallationTrigger"
                                icon: "https://cdn.runalloy.com/icons/OnIntegrationInstallation.svg"
                                subtitle: "On Installation Trigger"
                              - name: "Shopify"
                                id: "0679a48c-e0f9-455a-91f2-48a739bac9d7"
                                connector: "shopify"
                                icon: "https://cdn.runalloy.com/icons/shopify.png"
                                subtitle: "Gets a list of all Products"
                        credentials:
                          - "PA_Sn1sp8Of8p5JICNiJ"
                          - "shopify"
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        integrationId:
                          type: string
                          example: 63ea758e82c3074141968bb9
                        app:
                          type: string
                          example: Magento
                        installed:
                          type: boolean
                          example: false
                          default: true
                        icon:
                          type: string
                          example: https://cdn.runalloy.com/icons/magento.png
                        workflows:
                          type: array
                          items:
                            type: object
                            properties:
                              workflowId:
                                type: string
                                example: 63ea75a2fcf2e2c72e805ddc
                              name:
                                type: string
                                example: Magento Order Sync
                              installed:
                                type: boolean
                                example: true
                                default: true
                              version:
                                type: integer
                                example: 1
                                default: 0
                              installedVersion:
                                type: integer
                                example: 1
                                default: 0
                              active:
                                type: boolean
                                example: true
                                default: true
                              blocks:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      example: Custom Event
                                    id:
                                      type: string
                                      example: bc9202b2-8e7e-47d4-9416-5ba6b319fa2a
                                    type:
                                      type: string
                                      example: customEvent
                                    icon:
                                      type: string
                                      example: >-
                                        https://cdn.runalloy.com/icons/app-event.svg
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /users/batch:
    post:
      summary: Create a new batch of users
      description: >-
        Creates a new user in your Embedded account. The user record acts like a
        "container" to store all the integrations, workflows, and credentials
        for any given user. Returns a user identifier.
      operationId: batch-create-users
      parameters:
        - name: Authorization
          in: header
          description: Your Embedded API key for authorization
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - users
              properties:
                users:
                  type: array
                  description: >-
                    An array of user objects to be created. Each object must contain
                    a `username` (mandatory) and an optional `fullName`.
                    Limited to 1000 users at a time.
                  items:
                    type: object
                    properties:
                      username:
                        type: string
                        description: The username of the user.
                        example: "demo@runalloy.com"
                      fullName:
                        type: string
                        description: The full name of the user.
                        example: "Gregg Mojica"
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "success"
                    invalidUsers:
                      - fullName: "Missing Username"
                      - username: "alreadyexists123"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: success
                  invalidUsers:
                    type: array
                    items:
                      type: object
                      properties:
                        fullName:
                          type: string
                          example: Missing Username
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "No valid users provided"
              schema:
                oneOf:
                  - type: object
                    properties:
                      message:
                        type: string
                        example: All users already exist
                  - type: object
                    properties:
                      message:
                        type: string
                        example: No valid users provided
        "401":
          description: "401"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /events:
    get:
      summary: Retrieve a list of custom events
      description: Returns a list of all Custom Events you have enabled in Alloy Embedded.
      operationId: list-events
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - name: "Customer Created"
                        description: "This event is invoked every time a customer is created in your app"
                        body:
                          name: "Gregg"
                          email: "support@runalloy.com"
                      - name: "Order created"
                        description: "Triggers when an order is created in ACME"
                        body:
                          orderId: "0001"
                          orderName: "My order"
                          customerEmail: "support@runalloy.com"
                          customerPhone: "1234567891"
                      - name: "Invoke Slack"
                        description: "Invokes Slack"
                        body:
                          name: "New order created"
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: Customer Created
                        description:
                          type: string
                          example: >-
                            This event is invoked every time a customer is
                            created in your app
                        body:
                          type: object
                          properties:
                            name:
                              type: string
                              example: Gregg
                            email:
                              type: string
                              example: support@runalloy.com
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /users/{userId}/integrations/{integrationId}/install-url:
    get:
      summary: Create an Embedded link for an integration
      description: >-
        This endpoint generates an alloy Link. For more details on Embedded
        Link, please [read](/embedded/alloy-link) this
        tutorial.
      operationId: generate-alloy-link
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: userId
          in: query
          description: The user to generate the Embedded Link for
          schema:
            type: string
          required: true
        - name: integrationId
          in: path
          description: The Id of the integration you want to generate the Embedded Link for
          schema:
            type: string
          required: true
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/users/{userId}/integrations/{integrationId}/install-url?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/users/{userId}/integrations/{integrationId}/install-url"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const integrationId = "{integrationId}";
            const url = `https://production.runalloy.com/users/${userId}/integrations/${integrationId}/install-url?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $integrationId = "{integrationId}";
            $url = "https://production.runalloy.com/users/{$userId}/integrations/{$integrationId}/install-url?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                integrationId := "{integrationId}"
                baseURL := "https://production.runalloy.com/users/" + userId + "/integrations/" + integrationId + "/install-url"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String integrationId = "{integrationId}";
                    String baseUrl = "https://production.runalloy.com/users/" + userId + "/integrations/" + integrationId + "/install-url";
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            integrationId = "{integrationId}"
            base_url = "https://production.runalloy.com/users/#{userId}/integrations/#{integrationId}/install-url"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    url: "https://app.runalloy.com/embedded-install?integrationId=XXXXXXX&token=YYYYYYYY.ZZZZZZZZZZZZZ.WWWWWWWWWWWWWW-VVVVVVVVV&forgeMode=engaged&alwaysShowCredentials=true"
              schema:
                type: object
                properties:
                  url:
                    type: string
                    example: >-
                      https://app.runalloy.com/embedded-install?integrationId=XXXXXXX&token=YYYYYYYY.ZZZZZZZZZZZZZ.WWWWWWWWWWWWWW-VVVVVVVVV&forgeMode=engaged&alwaysShowCredentials=true
      deprecated: false
      security: []
  /headless/oauthUrl:
    get:
      summary: Create OAuth Link
      description: >-
        This endpoint can be used to generate an OAuth link if you want to
        completely white label your authentication experience. You can use this
        endpoint to generate a link which your users can click to redirect to
        the specified application without rendering the Alloy Embedded Modal.


        Note: this endpoint **only** works with OAuth enabled integrations. To
        add a credential manually, please use the [POST Create Credential
        API](/reference/embedded/create-a-credential).


        This endpoint takes a `userId`, `integrationId`, and `connectorName` as
        inputs. It should be used in conjunction with the [GET Credential
        Metadata
        API](/reference/embedded/get-credential-metadata).
        `credentialName` represents the name of the integration you want to
        call.


        If the credential metadata endpoint returns any `properties,` you must
        pass them as query string parameters at the end of this call.

        For example, to generate a `oAuthURL` for Shopify, you'll need to add the specify `shopifySubdomain`
        in the query paramter of the URI. Your URI may look like `/oauthUrl?userId=YOUR_USER_ID&app=shopify&shopSubdomain=YOUR_STORE_NAME`
      operationId: generate-oauth-link
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: userId
          in: query
          description: The id of the user to generate this link for
          required: true
          schema:
            type: string
        - name: app
          in: query
          description: The name of the app you want the user to authorize access to
          required: true
          schema:
            type: string
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/oauthUrl?userId={{userId}}&app=shopify" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/oauthUrl"
            params = {"userId": "{{userId}}", "app": "shopify"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const app = "shopify";
            const url = `https://production.runalloy.com/oauthUrl?userId=${userId}&app=${app}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $app = "shopify";
            $url = "https://production.runalloy.com/oauthUrl?userId=" . urlencode($userId) . "&app=" . urlencode($app);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                app := "shopify"
                baseURL := "https://production.runalloy.com/oauthUrl"
                params := url.Values{}
                params.Add("userId", userId)
                params.Add("app", app)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String app = "shopify";
                    String urlString = "https://production.runalloy.com/oauthUrl?userId=" + java.net.URLEncoder.encode(userId, "UTF-8") + "&app=" + java.net.URLEncoder.encode(app, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            app = "shopify"
            uri = URI("https://production.runalloy.com/oauthUrl")
            params = { userId: userId, app: app }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    oauthUrl: "https://api.runalloy.com/api/strategy/shopify/authorize?userId=xyz123abc098754&shopSubdomain=my-shoe-store"
              schema:
                type: object
                properties:
                  oauthUrl:
                    type: string
                    example: >-
                      https://api.runalloy.com/api/strategy/shopify/authorize?userId=xyz123abc098754&shopSubdomain=my-shoe-store
      deprecated: false
      security: []
  /workflows/{workflowId}:
    delete:
      summary: Delete a workflow
      description: >-
        Deletes a workflow for a specific user. This endpoint does not delete a
        workflow for all users.
      operationId: delete-workflow
      parameters:
        - name: userId
          in: query
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint. Note: you can also use the Embedded user's `username` in
            this field.
          required: true
          schema:
            type: string
        - name: workflowId
          in: path
          description: The Id of the workflow to delete
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      x-code-samples:
        - lang: cURL
          source: |
            curl -X DELETE "https://production.runalloy.com/workflows/{workflowId}?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/workflows/{workflowId}"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.delete(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const workflowId = "{workflowId}";
            const url = `https://production.runalloy.com/workflows/${workflowId}?userId=${userId}`;

            fetch(url, {
              method: "DELETE",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    deleted: true
              schema:
                type: object
                properties:
                  deleted:
                    type: boolean
                    example: true
      deprecated: false
      security: []
    get:
      summary: Retrieve a single workflow
      description: Find a workflow given a workflowId
      operationId: find-a-workflow
      parameters:
        - name: userId
          in: query
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint. Note: you can also use the Embedded user's `username` in
            this field.
          required: true
          schema:
            type: string
        - name: workflowId
          in: path
          description: The Id of the workflow to find
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/workflows/{workflowId}?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/workflows/{workflowId}"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const workflowId = "{workflowId}";
            const url = `https://production.runalloy.com/workflows/${workflowId}?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $workflowId = "{workflowId}";
            $url = "https://production.runalloy.com/workflows/{$workflowId}?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                workflowId := "{workflowId}"
                baseURL := "https://production.runalloy.com/workflows/" + workflowId
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String workflowId = "{workflowId}";
                    String baseUrl = "https://production.runalloy.com/workflows/" + workflowId;
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            workflowId = "{workflowId}"
            base_url = "https://production.runalloy.com/workflows/#{workflowId}"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      workflowId: "6544eac8e1ee020334af4ec8"
                      name: "Untitled Workflow #595"
                      createdAt: "2023-11-03T12:42:48.304Z"
                      updatedAt: "2023-11-03T13:12:45.522Z"
                      installed: false
                      active: false
                      version: 1
                      integrationId: "6544193cd8c482b3fe875101"
                      connectors:
                        - connectorName: "KnoCommerce Trigger"
                          connectorId: "3fe19002-a854-466a-b1c7-682d6fbe398a"
                          connector: "knoCommerceTrigger"
                          icon: "https://cdn.runalloy.com/icons/knoCommerce.png"
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      workflowId:
                        type: string
                        example: 61af97f3a64b5900144610d8
                      integrationId:
                        type: string
                        example: 632ca935bb5c785d64d095b5
                      name:
                        type: string
                        example: New Customer Created
                      createdAt:
                        type: string
                        example: "2021-12-07T17:20:51.889Z"
                      updatedAt:
                        type: string
                        example: "2021-12-07T17:36:32.454Z"
                      installed:
                        type: boolean
                        example: true
                        default: true
                      active:
                        type: boolean
                        example: true
                        default: true
                      version:
                        type: integer
                        example: 2
                        default: 0
                      installedVersion:
                        type: integer
                        example: 1
                        default: 0
                      connectors:
                        type: array
                        items:
                          type: object
                          properties:
                            connectorName:
                              type: string
                              example: Custom Event
                            connectorId:
                              type: string
                              example: acd92ef8-303a-4c31-b323-c55fb2d7a41f
                            connector:
                              type: string
                              example: customEvent
                            icon:
                              type: string
                              example: https://cdn.runalloy.com/icons/app-event.svg
      deprecated: false
      security: []
  /integrations/{integrationId}:
    get:
      summary: Retrieve a single integration
      description: Finds a specific integration for a user
      operationId: get-an-integration
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: integrationId
          in: path
          description: >-
            This API parameter allows you to filter results based on the
            integrationId or the integrationName (also referred to as 'app').
            The integration name (app) is a custom name that you have set for
            your integration. When using the integration name (app), provide the
            name of the integration you want to filter for (e.g. 'shopify order
            sync' or 'magento product creation'). You can obtain the integration
            name (app) from the List Integrations endpoint under the 'app'
            parameter, or by checking your UI. Either integrationId or
            integrationName must be provided but it cannot be both.
          schema:
            type: string
          required: true
        - name: userId
          in: query
          description: >-
            The Id used to identify the user. Note: you can also use the
            Embedded user's `username` in this field.
          required: true
          schema:
            type: string
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/integrations/{integrationId}?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/integrations/{integrationId}"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const integrationId = "{integrationId}";
            const url = `https://production.runalloy.com/integrations/${integrationId}?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $integrationId = "{integrationId}";
            $url = "https://production.runalloy.com/integrations/{$integrationId}?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                integrationId := "{integrationId}"
                baseURL := "https://production.runalloy.com/integrations/" + integrationId
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String integrationId = "{integrationId}";
                    String baseUrl = "https://production.runalloy.com/integrations/" + integrationId;
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            integrationId = "{integrationId}"
            base_url = "https://production.runalloy.com/integrations/#{integrationId}"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      integrationId: "66326843cc9cdb107221f222"
                      app: "Shopify"
                      installed: false
                      icon: "https://cdn.runalloy.com/icons/shopify.png"
                      workflows:
                        - workflowId: "66326849cc9cdb107221f342"
                          name: "Untitled Workflow #346"
                          installed: false
                          active: false
                          version: 1
                          connectors:
                            - name: "On Installation Trigger"
                              id: "4762a899-8f38-44d9-a091-f4b6eaba386e"
                              connector: "onInstallationTrigger"
                              icon: "https://cdn.runalloy.com/icons/OnIntegrationInstallation.svg"
                              subtitle: "On Installation Trigger"
                            - name: "Shopify"
                              id: "0679a48c-e0f9-455a-91f2-48a739bac9d7"
                              connector: "shopify"
                              icon: "https://cdn.runalloy.com/icons/shopify.png"
                              subtitle: "Gets a list of all Products"
                            - name: "Shopify"
                              id: "24ed5879-4aa9-4a2c-b8dc-afe6413c1ca7"
                              connector: "shopify"
                              icon: "https://cdn.runalloy.com/icons/shopify.png"
                              subtitle: "Shopify"
                      credentials:
                        - "shopify"
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      integrationId:
                        type: string
                        example: 63ea758e82c3074141968bb9
                      app:
                        type: string
                        example: Magento
                      installed:
                        type: boolean
                        example: false
                        default: true
                      icon:
                        type: string
                        example: https://cdn.runalloy.com/icons/magento.png
                      workflows:
                        type: array
                        items:
                          type: object
                          properties:
                            workflowId:
                              type: string
                              example: 63ea75a2fcf2e2c72e805ddc
                            name:
                              type: string
                              example: Magento Order Sync
                            installed:
                              type: boolean
                              example: true
                              default: true
                            version:
                              type: integer
                              example: 1
                              default: 0
                            installedVersion:
                              type: integer
                              example: 1
                              default: 0
                            active:
                              type: boolean
                              example: true
                              default: true
                            blocks:
                              type: array
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                    example: Custom Event
                                  id:
                                    type: string
                                    example: bc9202b2-8e7e-47d4-9416-5ba6b319fa2a
                                  type:
                                    type: string
                                    example: customEvent
                                  icon:
                                    type: string
                                    example: >-
                                      https://cdn.runalloy.com/icons/app-event.svg
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /workflows/{workflowId}/users:
    get:
      summary: List Users by workflowId
      description: ""
      operationId: list-users-by-workflowid
      parameters:
        - name: workflowId
          in: path
          description: The Id of the parent workflow you would like to list users for.
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - username: "alexmcvar@runalloy.com"
                        fullName: "Alex McVarish"
                        userId: "6398f116aaab31dbb69df94d"
                        workflowActive: true
                        installedAt: "2023-11-03T18:02:28.296Z"
                      - username: "brandonl@runalloy.com"
                        fullName: "Brandon Looker"
                        userId: "6398f895dk5b31dbh69df7d7"
                        workflowActive: true
                        installedVersion: 2
                        installedAt: "2023-11-03T18:02:28.296Z"
                      - username: "abdullah+embedded3@runalloy.com"
                        fullName: "Abdullah Wali"
                        userId: "63fec7df57e0a6da84257316"
                        workflowActive: true
                        installedAt: "2023-11-03T18:02:28.296Z"
                      - username: "devanshMehta@runalloy.com"
                        fullName: "Devansh Mehta"
                        userId: "63feca0157e0a6da8425731b"
                        workflowActive: false
                        installedVersion: 2
                        installedAt: "2023-11-03T18:02:28.296Z"
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /workflows/{workflowId}/upgrade:
    put:
      summary: Upgrade a workflow
      description: >-
        This endpoint allows you as the ISV to upgrade the workflow for a
        specified end user.  <br /> <br />In order to upgrade a workflow via
        this endpoint, the new workflow must have the same configurable fields
        as the original. If any new configurable fields were added, you will not
        be able to upgrade the workflow programmatically and instead would need
        to reinstall the workflow for the end user.
      operationId: upgrade-workflow
      parameters:
        - name: workflowId
          in: path
          description: >-
            Id of the parent workflow in which you are upgrading for the end
            user
          schema:
            type: string
          required: true
        - name: userId
          in: query
          description: Id of the end user you wish to upgrade the workflow for
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      x-code-samples:
        - lang: cURL
          source: |
            curl -X PUT "https://production.runalloy.com/workflows/{workflowId}/upgrade?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/workflows/{workflowId}/upgrade"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.put(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const workflowId = "{workflowId}";
            const url = `https://production.runalloy.com/workflows/${workflowId}/upgrade?userId=${userId}`;

            fetch(url, {
              method: "PUT",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $workflowId = "{workflowId}";
            $url = "https://production.runalloy.com/workflows/{$workflowId}/upgrade?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                workflowId := "{workflowId}"
                baseURL := "https://production.runalloy.com/workflows/" + workflowId + "/upgrade"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("PUT", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String workflowId = "{workflowId}";
                    String baseUrl = "https://production.runalloy.com/workflows/" + workflowId + "/upgrade";
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("PUT");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            workflowId = "{workflowId}"
            base_url = "https://production.runalloy.com/workflows/#{workflowId}/upgrade"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Put.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    upgraded: true
              schema:
                type: object
                properties:
                  upgraded:
                    type: boolean
                    example: true
                    default: true
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /workflows/{workflowId}/versions:
    get:
      summary: Retrieve a list of workflow versions
      description: Returns a list of all versions available for a given workflow
      operationId: list-versions
      parameters:
        - name: userId
          in: query
          description: >-
            The Id of the user you want to lookup. Returned from the Create User
            endpoint. Note: you can also use the Embedded user's `username` in
            this field.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: workflowId
          in: path
          description: The Id of the workflow you want to retrieve versions for
          schema:
            type: string
          required: true
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/workflows/{workflowId}/versions?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/workflows/{workflowId}/versions"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const workflowId = "{workflowId}";
            const url = `https://production.runalloy.com/workflows/${workflowId}/versions?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
        - lang: PHP
          source: |
            <?php
            $userId = "{{userId}}";
            $workflowId = "{workflowId}";
            $url = "https://production.runalloy.com/workflows/{$workflowId}/versions?userId=" . urlencode($userId);
            
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "Authorization: bearer YOUR_API_KEY",
                "x-api-version: 2025-09"
            ]);
            
            $response = curl_exec($ch);
            curl_close($ch);
            $data = json_decode($response, true);
            print_r($data);
            ?>
        - lang: Go
          source: |
            package main

            import (
                "encoding/json"
                "fmt"
                "io"
                "net/http"
                "net/url"
            )

            func main() {
                userId := "{{userId}}"
                workflowId := "{workflowId}"
                baseURL := "https://production.runalloy.com/workflows/" + workflowId + "/versions"
                params := url.Values{}
                params.Add("userId", userId)
                fullURL := baseURL + "?" + params.Encode()

                req, _ := http.NewRequest("GET", fullURL, nil)
                req.Header.Set("Authorization", "bearer YOUR_API_KEY")
                req.Header.Set("x-api-version", "2025-09")

                client := &http.Client{}
                resp, _ := client.Do(req)
                defer resp.Body.Close()

                body, _ := io.ReadAll(resp.Body)
                var data map[string]interface{}
                json.Unmarshal(body, &data)
                fmt.Println(data)
            }
        - lang: Java
          source: |
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import com.google.gson.Gson;
            import java.util.Map;

            public class Example {
                public static void main(String[] args) throws Exception {
                    String userId = "{{userId}}";
                    String workflowId = "{workflowId}";
                    String baseUrl = "https://production.runalloy.com/workflows/" + workflowId + "/versions";
                    String urlString = baseUrl + "?userId=" + java.net.URLEncoder.encode(userId, "UTF-8");
                    
                    URL url = new URL(urlString);
                    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                    conn.setRequestMethod("GET");
                    conn.setRequestProperty("Authorization", "bearer YOUR_API_KEY");
                    conn.setRequestProperty("x-api-version", "2025-09");
                    
                    BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                    String inputLine;
                    StringBuilder response = new StringBuilder();
                    while ((inputLine = in.readLine()) != null) {
                        response.append(inputLine);
                    }
                    in.close();
                    
                    Gson gson = new Gson();
                    Map<String, Object> data = gson.fromJson(response.toString(), Map.class);
                    System.out.println(data);
                }
            }
        - lang: Ruby
          source: |
            require 'net/http'
            require 'json'
            require 'uri'

            userId = "{{userId}}"
            workflowId = "{workflowId}"
            base_url = "https://production.runalloy.com/workflows/#{workflowId}/versions"
            uri = URI(base_url)
            params = { userId: userId }
            uri.query = URI.encode_www_form(params)

            http = Net::HTTP.new(uri.host, uri.port)
            http.use_ssl = true

            request = Net::HTTP::Get.new(uri)
            request['Authorization'] = 'bearer YOUR_API_KEY'
            request['x-api-version'] = '2025-09'

            response = http.request(request)
            data = JSON.parse(response.body)
            puts data
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - versionId: "64e176068b7928bceb2ff557"
                        versionName: "Version 1"
                        lastModified: "2023-12-07T17:20:51.889Z"
                        status: "inactive"
                      - versionId: "64e1760bb03ee19a07a2ee35"
                        versionName: "Version 2"
                        lastModified: "2023-12-07T17:20:51.889Z"
                        status: "active"
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /metadata/credentials/{credentialName}:
    get:
      summary: Retrieve credential structure for an app
      description: ""
      operationId: credential-medata-by-app
      parameters:
        - name: credentialName
          in: path
          description: Name of connector (camelCased, can be found in App Metadata response)
          schema:
            type: string
          required: true
        - name: Authorization
          in: header
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      connector: "shopify"
                      icon: "https://cdn.runalloy.com/icons/shopify.png"
                      isOauth: true
                      properties:
                        - name: "shopSubdomain"
                          displayName: "Shop Subdomain"
                          description: "Enter your store subdomain. If your store domain is example.myshopify.com, the subdomain would be example."
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      name:
                        type: string
                        example: shopify
                      icon:
                        type: string
                        example: https://cdn.runalloy.com/icons/shopify.png
                      isOauth:
                        type: boolean
                        example: true
                        default: true
                      properties:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              example: shopSubdomain
                            displayName:
                              type: string
                              example: Shop Subdomain
                            description:
                              type: string
                              example: >-
                                Enter your store subdomain. If your store domain
                                is example.myshopify.com, the subdomain would be
                                example.
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
      security: []
  /headless/startInstallation:
    post:
      summary: Start Installation
      description: >-
        This endpoint will create an installation record and return the
        information required to create a form for your user to fill out.
      operationId: start-installation
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - userId
                - integrationId
              properties:
                userId:
                  type: string
                  description: ID of the user that will install your integration
                integrationId:
                  type: string
                  description: ID of the integration which is being installed
                credentialIds:
                  type: array
                  description: >-
                    List of credentials to be used in this installation. If the
                    user has authorized any of the apps in the integration more
                    than once, then this field is required. Otherwise, the
                    user's credentials will be automatically detected.
                  items:
                    type: string
                workflowIds:
                  type: array
                  description: >-
                    A list of workflows to include in this installation, if only
                    a subset is desired. If every workflow in the integration
                    will be installed, this field is optional.
                  items:
                    type: string
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - workflowId: "65b7005ae9761102a64ddd3b"
                        app: "netsuite"
                        blockId: "3a8a8e50-f0e5-488b-9b7b-53656e93d392"
                        fields:
                          - name: "customerEmail"
                            displayName: "Customer's Email"
                            type: "string"
                            required: true
                    installationId: "65b701c2f5ba66db3bc53a68"
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        workflowId:
                          type: string
                          example: 65b7005ae9761102a64ddd3b
                        app:
                          type: string
                          example: netsuite
                        blockId:
                          type: string
                          example: 3a8a8e50-f0e5-488b-9b7b-53656e93d392
                        fields:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                                example: customerEmail
                              displayName:
                                type: string
                                example: Customer's Email
                              type:
                                type: string
                                example: string
                              required:
                                type: boolean
                                example: true
                                default: true
                  installationId:
                    type: string
                    example: 65b701c2f5ba66db3bc53a68
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: >-
                    {"message":"User is not authorized to install integrations
                    for this account"}
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: >-
                      User is not authorized to install integrations for this
                      account
      deprecated: false
  /headless/completeInstallation:
    post:
      summary: Complete Installation
      description: ""
      operationId: complete-installation
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - installationId
                - data
              properties:
                installationId:
                  type: string
                  description: ID you received when you started the installation.
                data:
                  type: array
                  description: Values filled by user in your installation form
                  items:
                    properties:
                      workflowId:
                        type: string
                      blockId:
                        type: string
                      fields:
                        type: array
                        items:
                          properties:
                            name:
                              type: string
                            value:
                              type: string
                          required:
                            - name
                            - value
                          type: object
                    required:
                      - workflowId
                      - blockId
                    type: object
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value:
                    message: "Installation completed successfully"
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Installation completed successfully
        "400":
          description: "400"
          content:
            application/json:
              examples:
                Result:
                  value: "{}"
              schema:
                type: object
                properties: {}
      deprecated: false
  /headless/editInstallation:
    post:
      summary: Edit Installation
      description: >-
        This endpoint allows you to edit an existing installation for a user.
        The `credentialIds` and `installationId` are optional parameters. If the user has authorized any of the apps in the integration more than once, then `credentialIds` is required. Otherwise, the user's credentials will be automatically detected.
      operationId: edit-installation
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - userId
                - integrationId
              properties:
                userId:
                  type: string
                  description: The id of the user to generate this link for.
                  example: "string"
                integrationId:
                  type: string
                  description: The integration you want to install.
                  example: "string"
                credentialIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    List of credentials to be used in this installation. If the user has authorized any of the apps in the integration more than once, then this field is required. Otherwise, the user's credentials will be automatically detected.
                installationId:
                  type: string
                  description: ID you received when you started the installation.
      responses:
        "200":
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      installationId:
                        type: string
                        example: "674570d5160c297be4a3ee74"
                      integrationId:
                        type: string
                        example: "66fa99433793749b64c1bf82"
                      userId:
                        type: string
                        example: "659d28e18c35f07db18fcd8c"
                      formData:
                        type: array
                        items: {}
                      credentialIds:
                        type: object
                        additionalProperties:
                          type: string
                        example:
                          klaviyoApi: "66c79e5965ede8edfa909553"
                      workflowIds:
                        type: array
                        items:
                          type: string
                        example:
                          - "66fa99453793749b64c1bfa8"
                      installedData:
                        type: array
                        items: {}
                      installedAt:
                        type: string
                        format: date-time
                        example: "2024-11-26T06:55:33Z"
  /passthrough:
    post:
      summary: Send passthrough request
      description: >-
        This endpoint makes it easy to send a passthrough request to the
        underlying Third Party App using a specified credentialId. It returns the
        raw data coming from the Third Party App.
      operationId: send-passthrough-request
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - name: credentialId
          in: query
          required: true
          description: >-
            The credentialId for this integration.
          schema:
            type: string
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                    - PUT
                    - DELETE
                    - PATCH
                  example: GET
                path:
                  type: string
                  example: /some/path
                body:
                  type: object
                  nullable: true
                query:
                  type: object
                  nullable: true
                extraHeaders:
                  type: object
                  nullable: true
      responses:
        "200":
          description: "200"
          content:
            application/json:
              examples:
                Result:
                  value: ""
      deprecated: false
      security: []
  /analytics/usage:
    get:
      summary: Get Analytics Usage
      description: >-
        Returns a list of all app actions usage data.
      operationId: get-app-actions-usage
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "Success (Example)"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      startDate: "2023-12-27"
                      endDate: "2024-12-26"
                      executionsLimit: 0
                      sevenDays: 14
                      thirtyDays: 90
                      lastThreeMonths: 1300
                      billingCycle: 2096
                      appActions: 2096
                      apiActions: 0
  /analytics/detail-usage-time:
    get:
      summary: Get Analytics Detailed Usage Time
      description: >-
        Returns app actions usage based on a given time period.
      operationId: get-detail-usage-time
      parameters:
        - name: timePeriod
          in: query
          required: false
          description: "The time period for usage data. Default time-period is `current-billing-cycle`"
          schema:
            type: string
            example: "7-days"
            enum:
              - "7-days"
              - "30-days"
              - "3-months"
              - "current-billing-cycle"
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: "Success (Example)"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      startDate: "2023-12-27"
                      endDate: "2024-12-27"
                      totalActions: 0
                      data:
                        - appActions: 37
                          month: "Jan-24"
                          year: 2024
                          date: "2024-01-02"
                          apiActions: 0
                          count: 37
                        - appActions: 41
                          month: "Feb-24"
                          year: 2024
                          date: "2024-02-04"
                          apiActions: 0
                          count: 41
                        - appActions: 55
                          month: "Mar-24"
                          year: 2024
                          date: "2024-03-02"
                          apiActions: 0
                          count: 55
                        - appActions: 431
                          month: "Apr-24"
                          year: 2024
                          date: "2024-04-01"
                          apiActions: 0
                          count: 431
                        - appActions: 148
                          month: "May-24"
                          year: 2024
                          date: "2024-05-05"
                          apiActions: 0
                          count: 148
                        - appActions: 6
                          month: "Jun-24"
                          year: 2024
                          date: "2024-06-27"
                          apiActions: 0
                          count: 6
                        - appActions: 28
                          month: "Jul-24"
                          year: 2024
                          date: "2024-07-10"
                          apiActions: 0
                          count: 28
                        - appActions: 70
                          month: "Aug-24"
                          year: 2024
                          date: "2024-08-05"
                          apiActions: 0
                          count: 70
                        - appActions: 234
                          month: "Sep-24"
                          year: 2024
                          date: "2024-09-12"
                          apiActions: 0
                          count: 234
                        - appActions: 956
                          month: "Oct-24"
                          year: 2024
                          date: "2024-10-13"
                          apiActions: 0
                          count: 956
                        - appActions: 90
                          month: "Nov-24"
                          year: 2024
                          date: "2024-11-07"
                          apiActions: 0
                          count: 90
                      timePeriod: "current-billing-cycle"
  /analytics/detail-usage-integration:
    get:
      summary: Get Analytics Detailed Usage By Integration
      description: >-
        Returns usage data for a specific integration.
      operationId: get-detail-usage-integration
      parameters:
        - name: timePeriod
          in: query
          required: false
          description: "The time period for usage data."
          schema:
            type: string
            enum:
              - "7-days"
              - "30-days"
              - "3-months"
              - "current-billing-cycle"
            example: "7-days"
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: integrationId
          in: query
          required: true
          description: "The ID of the integration."
          schema:
            type: string
            example: "66fabcb533a7e961c65fad51"
      responses:
        "200":
          description: "Success (Example)"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      integrationName: "Variable Selector"
                      integrationId: "673dc357c2f5556954bd4b45"
                      integrationCreatedDate: "2024-11-20T11:09:11.090Z"
                      isDeleted: false
                      startDate: "2023-12-27"
                      endDate: "2024-12-27"
                      totalActions: 0
                      data:
                        - month: "Nov-24"
                          date: "2024-11-19"
                          isDeleted: false
                          name: "variable Selector"
                          integrationId: "673dc357c2f5556954bd4b45"
                          integrationCreatedDate: "2024-11-20"
                          count: 14
                      timePeriod: "current-billing-cycle"
  /analytics/detail-usage-user:
    get:
      summary: Get Analytics Detailed Usage By User
      description: >-
        Retrieves usage data for a specific user.
      operationId: get-detail-usage-user
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: userId
          in: query
          required: true
          description: "The ID of the user."
          schema:
            type: string
            example: "y66wqtzdeu94q5xawwjxc"
        - name: timePeriod
          in: query
          required: false
          description: "The time period for usage data."
          schema:
            type: string
            enum:
              - "7-days"
              - "30-days"
              - "3-months"
              - "current-billing-cycle"
            example: "7-days"
      x-code-samples:
        - lang: cURL
          source: |
            curl -X GET "https://production.runalloy.com/analytics/detail-usage-user?userId={{userId}}" \
              -H "Authorization: bearer YOUR_API_KEY" \
              -H "x-api-version: 2025-09"
        - lang: Python
          source: |
            import requests

            url = "https://production.runalloy.com/analytics/detail-usage-user"
            params = {"userId": "{{userId}}"}
            headers = {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
        - lang: JavaScript
          source: |
            const userId = "{{userId}}";
            const url = `https://production.runalloy.com/analytics/detail-usage-user?userId=${userId}`;

            fetch(url, {
              method: "GET",
              headers: {
                "Authorization": "bearer YOUR_API_KEY",
                "x-api-version": "2025-09"
              }
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error("Error:", error));
      responses:
        "200":
          description: "Success (Example)"
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      userName: "demo@runalloy.com"
                      userId: "659d28e18c35f07db18fcd8c"
                      userCreatedDate: "2024-01-09T11:07:13.963Z"
                      isDeleted: false
                      startDate: "2023-12-27"
                      endDate: "2024-12-27"
                      totalActions: 0
                      data:
                        - month: "Mar-24"
                          userName: "demo@runalloy.com"
                          isDeleted: false
                          date: "2024-03-10"
                          userId: "659d28e18c35f07db18fcd8c"
                          userCreatedDate: "2024-01-09"
                          apiActions: 0
                          count: 7
                          appActions: 7
                        - month: "Jun-24"
                          userName: "demo@runalloy.com"
                          isDeleted: false
                          date: "2024-06-30"
                          userId: "659d28e18c35f07db18fcd8c"
                          userCreatedDate: "2024-01-09"
                          apiActions: 0
                          count: 2
                          appActions: 2
                        - month: "Aug-24"
                          userName: "demo@runalloy.com"
                          isDeleted: false
                          date: "2024-08-05"
                          userId: "659d28e18c35f07db18fcd8c"
                          userCreatedDate: "2024-01-09"
                          apiActions: 0
                          count: 22
                          appActions: 22
                        - month: "Sep-24"
                          userName: "demo@runalloy.com"
                          isDeleted: false
                          date: "2024-09-29"
                          userId: "659d28e18c35f07db18fcd8c"
                          userCreatedDate: "2024-01-09"
                          apiActions: 0
                          count: 2
                          appActions: 2
                      timePeriod: "current-billing-cycle"
  /integrations/all:
    get:
      summary: Get All Integrations
      description: >-
        Retrieves all integrations available in the Alloy Embedded account.
      operationId: getAllIntegrations
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: Successful response with a list of integrations.
          content:
            application/json:
              examples:
                Result:
                  value:
                    data:
                      - integrationId: "67120234ea0bb132f61455d3"
                        description: ""
                        primaryConnector: "Variable Selector"
                        icon: "https://cdn.runalloy.com/icons/shopify.png"
                        workflows:
                          - workflowId: "673f2573ef641065fce767a7"
                            name: "Untitled Workflow #6"
                            version: 1
                            connectors:
                              - name: "On Installation Trigger"
                                id: "c911ec0a-0016-40c0-9c04-b46c8e9e2751"
                                connector: "onInstallationTrigger"
                                icon: "https://cdn.runalloy.com/icons/OnIntegrationInstallation.svg"
                                subtitle: "On Installation Trigger"
                              - name: "Shopify"
                                id: "de156f05-db36-439a-a237-5c6d9f6b1515"
                                connector: "shopify"
                                icon: "https://cdn.runalloy.com/icons/shopify.png"
                                subtitle: "Gets a list of all Abandoned Checkouts"
                        credentials:
                          - "shopify"
      deprecated: false
      security: []
  /installations/{installationId}:
    get:
      summary: Get Installation
      description: >-
        Retrieves details for a specific installation.
      operationId: getInstallation
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: installationId
          in: path
          required: true
          description: "The ID of the installation."
          schema:
            type: string
            example: "6630f0f971184ae724f2d930"
      responses:
        "200":
          description: Successful response with installation details.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      installationId:
                        type: string
                        example: "6630f0f971184ae724f2d930"
                      integrationId:
                        type: string
                        example: "662f950e454784bc5e7caa37"
                      userId:
                        type: string
                        example: "6622cd2e506ac293a3e60b00"
                      formData:
                        type: array
                        items:
                          type: object
                        example: []
                      credentialIds:
                        type: object
                        additionalProperties:
                          type: string
                        example:
                          shopifyApi: "66263e318dca4463fe1b480f"
                      workflowIds:
                        type: array
                        items:
                          type: string
                        example:
                          - "662fa657454784bc5e7cd5ea"
                      enabled:
                        type: boolean
                        example: false
                    required:
                      - installationId
                      - integrationId
                      - userId
                      - formData
                      - credentialIds
                      - workflowIds
                      - enabled
                required:
                  - data
              examples:
                Result:
                  value:
                    data:
                      installationId: "6630f0f971184ae724f2d930"
                      integrationId: "662f950e454784bc5e7caa37"
                      userId: "6622cd2e506ac293a3e60b00"
                      formData: []
                      credentialIds:
                        shopifyApi: "66263e318dca4463fe1b480f"
                      workflowIds:
                        - "662fa657454784bc5e7cd5ea"
                      enabled: false
  /installations/{installationId}/:
    delete:
      summary: Delete an Installation
      description: >-
        Deletes a specific installation by its ID.
      operationId: deleteInstallation
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: installationId
          in: path
          required: true
          description: "The ID of the installation."
          schema:
            type: string
            example: "6630f0f971184ae724f2d930"
      responses:
        "200":
          description: Successful response after installation deletion.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                required:
                  - success
              examples:
                Result:
                  value:
                    success: true
  /installations/{installationId}/activate:
    put:
      summary: Activate Installation
      description: >-
        Activates a specific installation.
      operationId: activateInstallation
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: installationId
          in: path
          required: true
          description: "The ID of the installation."
          schema:
            type: string
            example: "6630f0f971184ae724f2d930"
      responses:
        "200":
          description: Successful activation response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
  /installations/{installationId}/deactivate:
    put:
      summary: Deactivate Installation
      description: >-
        Deactivates a specific installation.
      operationId: deactivateInstallation
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: installationId
          in: path
          required: true
          description: "The ID of the installation."
          schema:
            type: string
            example: "6630f0f971184ae724f2d930"
      responses:
        "200":
          description: Successful deactivation response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
  /installations/{installationId}/upgrade:
    put:
      summary: Upgrade Installation
      description: >-
        Upgrades a specific installation.
      operationId: upgradeInstallation
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
        - name: installationId
          in: path
          required: true
          description: "The ID of the installation."
          schema:
            type: string
            example: "6630f0f971184ae724f2d930"
      responses:
        "200":
          description: Successful upgrade response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
  /installations:
    get:
      summary: Get All Installations
      description: >-
        Retrieves all installations available in the Alloy Embedded account.
      operationId: getAllInstallations
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - $ref: "#/components/parameters/xApiVersion" # Reference the global parameter
      responses:
        "200":
          description: Successful response with a list of installations.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        installationId:
                          type: string
                          example: "6631155371184ae724f2d949"
                        integrationId:
                          type: string
                          example: "662f950e454784bc5e7caa37"
                        userId:
                          type: string
                          example: "6622cd2e506ac293a3e60b00"
                        formData:
                          type: array
                          items:
                            type: object
                            properties:
                              workflowId:
                                type: string
                                example: "66310999b37a737ba5107d5a"
                              app:
                                type: string
                                example: "accountVariables"
                              blockId:
                                type: string
                                example: "f7c4304a-b3d8-4088-8ca3-adeb3ddf2ce4"
                              fields:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                      example: "variables[0].value"
                                    displayName:
                                      type: string
                                      example: "Value"
                                    type:
                                      type: string
                                      example: "string"
                                    required:
                                      type: boolean
                                      example: true
                                  required:
                                    - name
                                    - displayName
                                    - type
                                    - required
                            required:
                              - workflowId
                              - app
                              - blockId
                              - fields
                          example: []
                        credentialIds:
                          type: object
                          additionalProperties:
                            type: string
                          example:
                            shopifyApi: "66263e318dca4463fe1b480f"
                        workflowIds:
                          type: array
                          items:
                            type: string
                          example:
                            - "662fa657454784bc5e7cd5ea"
                        installedAt:
                          type: string
                          format: date-time
                          example: "2024-04-30T16:00:05.041Z"
                        enabled:
                          type: boolean
                          example: false
                      required:
                        - installationId
                        - integrationId
                        - userId
                        - formData
                        - credentialIds
                        - workflowIds
                        - installedAt
                        - enabled
                required:
                  - data
              examples:
                Result:
                  value:
                    data:
                      - installationId: "6631155371184ae724f2d949"
                        integrationId: "662f950e454784bc5e7caa37"
                        userId: "6622cd2e506ac293a3e60b00"
                        formData: []
                        credentialIds:
                          shopifyApi: "66263e318dca4463fe1b480f"
                        workflowIds:
                          - "662fa657454784bc5e7cd5ea"
                        installedAt: "2024-04-30T16:00:05.041Z"
                        enabled: false
                      - installationId: "66322c61182c8c5270980ed3"
                        integrationId: "66310993b37a737ba5107d1e"
                        userId: "6622cd2e506ac293a3e60b00"
                        formData:
                          - workflowId: "66310999b37a737ba5107d5a"
                            app: "accountVariables"
                            blockId: "f7c4304a-b3d8-4088-8ca3-adeb3ddf2ce4"
                            fields:
                              - name: "variables[0].value"
                                displayName: "Value"
                                type: "string"
                                required: true
                        credentialIds:
                          shopifyApi: "66263e318dca4463fe1b480f"
                        workflowIds:
                          - "66310999b37a737ba5107d5a"
                        installedAt: "2024-05-01T11:50:14.043Z"
                        enabled: false
  /logs:
    get:
      summary: Retrieve logs for all workflows
      description: |
        This endpoint gives you direct programmatic access to the logs for ALL your workflows.

        This allows you to build first-class observability for customers or pipe data into the internal monitoring tools you use. You may also choose to use this endpoint to stream logs in real-time to a third-party logging service to enable alerting for your end-users.

        Learn more about [logs](/embedded/handling-errors-logs) in Alloy.

        Use the query parameters to filter, sort, and paginate logs. See the `example` fields for each parameter for valid values. A sample request URL is:

        `https://production.runalloy.com/logs?filters=[{"columns":{"value":"message"},"operators":{"value":"equals"},"userinput":{"value":"executionError"},"condition":{"value":"and"}}]&workflowId=67ef017d8eaeb50b18e635a1&associatedUserId=67a21c7d10e1dee8d5ec3a3d&skip=0&limit=10&sortBy=createdAt&sortOrder=desc`
      operationId: get-logs
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - name: filters
          in: query
          required: false
          description: |
            Array of filter objects to narrow down logs based on specific criteria.
            Pass as a JSON-encoded array string in the query parameter.

            Example:
              [
                {
                  "columns": {
                    "value": "message" | "data.executionId" | "forgeWorkflowId" | "createdAt" | "userId" | "forgeWorkflow.integrationId._id" | "workflowVersion"
                  },
                  "operators": {
                    "value": "notequals" | "equals" | "greaterthan" | "lessthan" | "equals" | "contains" | "notcontains" | "notequals"
                  },
                  "userinput": { "value": String },
                  "condition": { "value": "and" }
                }
              ]
          schema:
            type: string
            example: '[{"columns":{"value":"message"},"operators":{"value":"equals"},"userinput":{"value":"executionError"},"condition":{"value":"and"}}]'
        - name: workflowId
          in: query
          required: false
          description: To filter by a given workflow instead of all workflows of all users.
          schema:
            type: string
            example: "67ef017d8eaeb50b18e635a1"
        - name: associatedUserId
          in: query
          required: false
          description: To filter user-specific logs instead of all users.
          schema:
            type: string
            example: "67a21c7d10e1dee8d5ec3a3d"
        - name: skip
          in: query
          required: false
          description: Amount of docs to skip.
          schema:
            type: integer
            example: 0
        - name: limit
          in: query
          required: false
          description: Amount of docs to return (page size).
          schema:
            type: integer
            example: 10
        - name: sortBy
          in: query
          required: false
          description: "Sort by (createdAt, completedAt, message, userId)."
          schema:
            type: string
            enum:
              - createdAt
              - completedAt
              - message
              - userId
            example: createdAt
        - name: sortOrder
          in: query
          required: false
          description: "Sort order (asc or desc)."
          schema:
            type: string
            enum:
              - asc
              - desc
            example: desc
      responses:
        "200":
          description: Logs retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  notifications:
                    type: array
                    items:
                      type: object
                      properties:
                        _id:
                          type: string
                          example: "68110feaa81a0e507fbdd36a"
                        message:
                          type: string
                          enum:
                            - executionError
                            - executionFinished
                            - executionStarted
                          example: executionError
                        data:
                          type: object
                          properties:
                            executionId:
                              type: string
                              example: "68110fea7d181f356acd1bf1"
                            executionUuid:
                              type: string
                              example: "35SnGU0DUSNP5L26fsmnq"
                        startedAt:
                          type: string
                          format: date-time
                          example: "2025-04-29T17:44:10.336Z"
                        completedAt:
                          type: string
                          format: date-time
                          example: "2025-04-29T17:44:10.432Z"
                        createdAt:
                          type: string
                          format: date-time
                          example: "2025-04-29T17:44:10.432Z"
                        customVersion:
                          type: boolean
                          example: false
                        workflowVersion:
                          type: integer
                          example: 1
                        teamId:
                          type: string
                          example: "63fcaa053522280b5357aeec"
                        forgeWorkflowId:
                          type: string
                          example: "67ef017d8eaeb50b18e635a1"
                        workflowId:
                          type: string
                          example: "67ef01ed8eaeb50b18e646ea"
                        userId:
                          type: string
                          example: "67a21c7d10e1dee8d5ec3a3d"
                        user:
                          type: object
                          properties:
                            email:
                              type: string
                              example: "eduardo.souza@runalloy.com"
                            fullName:
                              type: string
                              example: "Eduardo Souza"
                        forgeWorkflow:
                          type: object
                          properties:
                            name:
                              type: string
                              example: "order_id example"
                            integrationId:
                              type: object
                              properties:
                                _id:
                                  type: string
                                  example: "67d8875977ce6522e517a382"
                                name:
                                  type: string
                                  example: "Eduardo looper"
                                blockId:
                                  type: string
                                  example: "MuK2Kk9lu0v8N86brS3x"
                                icon:
                                  type: string
                                  example: "https://cdn.runalloy.com/icons/alloy-logo.png"
                  lastFetched:
                    type: string
                    format: date-time
                    example: "2025-04-29T17:46:38.237Z"
                  pagination:
                    type: object
                    properties:
                      totalItems:
                        type: integer
                        example: 4
                      totalPages:
                        type: integer
                        example: 1
                      currentPage:
                        type: integer
                        example: 1
                      pageSize:
                        type: integer
                        example: 10
              examples:
                Result:
                  value:
                    notifications:
                      - _id: "68110feaa81a0e507fbdd36a"
                        message: "executionError"
                        data:
                          executionId: "68110fea7d181f356acd1bf1"
                          executionUuid: "35SnGU0DUSNP5L26fsmnq"
                        startedAt: "2025-04-29T17:44:10.336Z"
                        completedAt: "2025-04-29T17:44:10.432Z"
                        createdAt: "2025-04-29T17:44:10.432Z"
                        customVersion: false
                        workflowVersion: 1
                        teamId: "63fcaa053522280b5357aeec"
                        forgeWorkflowId: "67ef017d8eaeb50b18e635a1"
                        workflowId: "67ef01ed8eaeb50b18e646ea"
                        userId: "67a21c7d10e1dee8d5ec3a3d"
                        user:
                          email: "eduardo.souza@runalloy.com"
                          fullName: "Eduardo Souza"
                        forgeWorkflow:
                          name: "order_id example"
                          integrationId:
                            _id: "67d8875977ce6522e517a382"
                            name: "Eduardo looper"
                            blockId: "MuK2Kk9lu0v8N86brS3x"
                            icon: "https://cdn.runalloy.com/icons/alloy-logo.png"
                    lastFetched: "2025-04-29T17:46:38.237Z"
                    pagination:
                      totalItems: 4
                      totalPages: 1
                      currentPage: 1
                      pageSize: 10
      deprecated: false
  /logs/{id}:
    get:
      summary: Retrieve logs for a specific execution
      description: |
        Fetches the logs and execution details for a workflow by its execution ID.
      operationId: get-logs-by-id
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: bearer YOUR_API_KEY
        - name: id
          in: path
          required: true
          description: The execution ID for which to retrieve logs.
          schema:
            type: string
            example: "68110fea7d181f356acd1bf1"
      responses:
        "200":
          description: Logs for the specified execution retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      _id:
                        type: string
                        example: "68110fea7d181f356acd1bf1"
                      executionMode:
                        type: string
                        enum:
                          [
                            cli,
                            error,
                            internal,
                            manual,
                            retry,
                            trigger,
                            webhook,
                          ]
                        example: "cli"
                      executionUuid:
                        type: string
                        example: "35SnGU0DUSNP5L26fsmnq"
                      workflowId:
                        type: string
                        example: "67ef01ed8eaeb50b18e646ea"
                      userId:
                        type: string
                        example: "67a21c7d10e1dee8d5ec3a3d"
                      forgeWorkflowId:
                        type: string
                        example: "67ef017d8eaeb50b18e635a1"
                      finished:
                        type: boolean
                        example: true
                      retries:
                        type: array
                        items: {}
                        example: []
                      actions:
                        type: integer
                        example: 3
                      metadata:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            name:
                              type: string
                              example: "Step Name"
                            subtitle:
                              type: string
                              example: "Step Subtitle"
                            icon:
                              type: string
                              example: "https://cdn.runalloy.com/icons/alloy-logo.png"
                            type:
                              type: string
                              example: "action"
                            inputs:
                              type: object
                              example: { "key": "value" }
                      runData:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            error:
                              type: string
                              nullable: true
                              example: null
                            data:
                              type: array
                              nullable: true
                              items:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    json:
                                      type: object
                                      example: { "output": "result" }
                                    statusCode:
                                      type: integer
                                      nullable: true
                                      example: 200
                                    id:
                                      type: string
                                      example: "block-uuid"
                      connections:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            main:
                              type: array
                              items:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    block:
                                      type: string
                                      example: "block-uuid"
                                    type:
                                      type: string
                                      example: "action"
                                    index:
                                      type: integer
                                      example: 0
                      startedAt:
                        type: string
                        format: date-time
                        example: "2025-04-29T17:44:10.336Z"
                      stoppedAt:
                        type: string
                        format: date-time
                        example: "2025-04-29T17:44:10.393Z"
x-readme:
  headers: []
  explorer-enabled: true
  proxy-enabled: true
x-readme-fauxas: true
