Docs/Custom Actions/Custom Actions

    Examples

    Last updated · MAR 2026·Read as Markdown

    Integration Examples

    Common Custom Action patterns and real-world AV integrations.


    Note: Custom Actions require a Builder plan or higher. Upgrade to Builder

    Push status updates from the agent to a Slack channel via webhook. Useful for install-team standups, commissioning callouts, or escalations.

    Configuration#

    bash
    curl -X POST https://hooks.slack.com/services/{{var.SLACK_WEBHOOK_ID}} \
      -H "Content-Type: application/json" \
      -d '{
        "text": "{{message}}",
        "channel": "{{channel}}",
        "username": "AVCodex Bot"
      }'

    Parameters#

    ParameterSourceConfiguration
    messageAI GeneratedMessage content to send.
    channelAI GeneratedTarget channel (optional).
    SLACK_WEBHOOK_IDVariableYour Slack webhook ID.

    Usage#

    _"Post to #av-ops that Boardroom 4 commissioning passed."_

    Call OpenAI's API for an extra round of analysis (for example, summarizing a long commissioning checklist).

    Configuration#

    bash
    curl -X POST https://api.openai.com/v1/chat/completions \
      -H "Authorization: Bearer {{var.OPENAI_API_KEY}}" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-4",
        "messages": {{system.message_history}},
        "temperature": 0.7,
        "max_tokens": {{maxTokens}}
      }'

    Parameters#

    ParameterSourceConfiguration
    OPENAI_API_KEYVariable (secret)Your OpenAI API key.
    message_historySystem variableConversation context.
    maxTokensAI GeneratedToken limit (default: 1000).

    Send a transactional email, for example a client-acceptance email after commissioning.

    Configuration#

    bash
    curl -X POST https://api.sendgrid.com/v3/mail/send \
      -H "Authorization: Bearer {{var.SENDGRID_API_KEY}}" \
      -H "Content-Type: application/json" \
      -d '{
        "personalizations": [{
          "to": [{"email": "{{recipientEmail}}"}],
          "subject": "{{subject}}"
        }],
        "from": {
          "email": "{{var.FROM_EMAIL}}",
          "name": "{{var.FROM_NAME}}"
        },
        "content": [{
          "type": "text/html",
          "value": "{{emailBody}}"
        }]
      }'

    Variables#

    bash
    SENDGRID_API_KEY = SG.abc123...
    FROM_EMAIL = noreply@your-integrator.com
    FROM_NAME = Your Integrator

    Read or append to a Google Sheet. Common use: an asset register or a per-room commissioning log.

    Read data#

    bash
    curl -X GET "https://sheets.googleapis.com/v4/spreadsheets/{{var.SHEET_ID}}/values/{{range}}" \
      -H "Authorization: Bearer {{var.GOOGLE_API_KEY}}"

    Append data#

    bash
    curl -X POST "https://sheets.googleapis.com/v4/spreadsheets/{{var.SHEET_ID}}/values/{{range}}:append" \
      -H "Authorization: Bearer {{var.GOOGLE_API_KEY}}" \
      -H "Content-Type: application/json" \
      -d '{
        "values": [[
          "{{system.timestamp}}",
          "{{system.user_id}}",
          "{{data}}"
        ]]
      }'

    Multi-step workflow using action dependencies. Example: register a new site, then push a welcome ticket to the field-service queue.

    Step 1: create site record#

    bash
    curl -X POST https://api.example.com/sites \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer {{var.API_KEY}}" \
      -d '{
        "name": "{{siteName}}",
        "client": "{{clientName}}"
      }'

    Returns: {"data": {"id": "site_123", "name": "1200 Market"}}.

    Step 2: open kickoff ticket#

    Use the site ID from Step 1:

    bash
    curl -X POST https://api.example.com/tickets \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer {{var.API_KEY}}" \
      -d '{
        "site_id": "{{siteId}}",
        "template": "kickoff",
        "send_at": "{{system.timestamp}}"
      }'

    Parameter configuration for `site_id`:

    • Source: Output from another Action.
    • Action: Create site record.
    • JSONPath: $.data.id.

    Update client records in your CRM (HubSpot, Salesforce, ConnectWise).

    Configuration#

    bash
    curl -X PATCH https://api.crm.com/v2/contacts/{{contactId}} \
      -H "Authorization: Bearer {{var.CRM_API_KEY}}" \
      -H "Content-Type: application/json" \
      -d '{
        "properties": {
          "last_contact": "{{system.timestamp}}",
          "last_message": "{{summary}}",
          "status": "{{status}}"
        }
      }'

    AI instructions#

    For summary:

    code
    Summarize the key points of the conversation in 1-2 sentences. Mention any rooms, devices, or deadlines referenced.

    For status:

    code
    Choose one: 'rfp-open', 'design-review', 'install-active', 'commissioning', 'closed-won', 'closed-lost'.

    Create payment intents via Stripe, for example accepting a deposit on a hospitality AV refresh.

    Configuration#

    bash
    curl -X POST https://api.stripe.com/v1/payment_intents \
      -u "{{var.STRIPE_SECRET_KEY}}:" \
      -H "Content-Type: application/x-www-form-urlencoded" \
      -d "amount={{amount}}&currency=usd&customer={{customerId}}"

    Parameters#

    ParameterSourceConfiguration
    STRIPE_SECRET_KEYVariable (secret)Your Stripe secret key.
    amountAI GeneratedAmount in cents.
    customerIdAI GeneratedStripe customer ID.

    Pull a device's recent status from a monitoring tool, for example checking a Q-SYS Core or a Crestron 4-Series before dispatching a tech.

    Configuration#

    bash
    curl -X GET "https://api.your-monitoring.com/devices/{{deviceId}}/status" \
      -H "Authorization: Bearer {{var.MONITORING_API_KEY}}"

    Usage examples#

    _"Is the Q-SYS Core in the auditorium online?"_ _"What was the last reboot time for the boardroom Crestron processor?"_

    Open issues in a repo, for example a control-system code library where programmers track Crestron SIMPL or Q-SYS Lua modules.

    Configuration#

    bash
    curl -X POST https://api.github.com/repos/{{var.GITHUB_OWNER}}/{{var.GITHUB_REPO}}/issues \
      -H "Authorization: Bearer {{var.GITHUB_TOKEN}}" \
      -H "Content-Type: application/json" \
      -d '{
        "title": "{{issueTitle}}",
        "body": "{{issueBody}}",
        "labels": {{labels}},
        "assignees": {{assignees}}
      }'

    Parameter configuration#

    ParameterSourceAI instructions
    issueTitleAI GeneratedConcise issue title that names the module and symptom.
    issueBodyAI GeneratedDetailed description, include processor model and firmware.
    labelsAI GeneratedArray of labels, for example ["crestron", "simpl", "bug"].
    assigneesAI GeneratedArray of GitHub usernames to assign.

    1. Error handling#

    Always return clear error messages:

    json
    {
      "success": false,
      "error": "API key invalid. Please check your credentials."
    }

    2. Rate limiting#

    Respect API rate limits:

    • Add delays between requests.
    • Implement exponential backoff.
    • Cache responses when possible.

    3. Security#

    • Use HTTPS endpoints only.
    • Store credentials as secret variables.
    • Never log sensitive data.
    • Validate all inputs.

    4. Performance#

    • Paginate large result sets.
    • Use field selection to minimize data.
    • Implement timeouts (30s max).
    • Cache frequently accessed data.

    5. Testing#

    • Test with various inputs.
    • Verify error handling.
    • Check edge cases.
    • Monitor response times.

    *AVCodex · Your AV expertise. Amplified by AI.*

    Was this helpful?
    Edit this page →