Skip to the page

API reference

Change the away message

Turns it on or off, or changes its words, your hours or how often one person can get it.

PATCH/v1/automations/away

Turns it on or off, or changes its words, your hours or how often one person can get it. It goes to a one-to-one text that arrives outside your hours when no keyword rule replied, at most once per person per cooldown_hours.

Needs a key with the messages:send scope. Keys and scopes

Request body

  • enabledboolean
  • textstring

    The reply, with {{variables}}.

    Up to 2,000 characters.

  • cooldown_hoursinteger

    1 to 168.

  • business_hoursobject

    Your hours each day in your time zone; null for a day you’re closed.

    Show its 7 fields
    • monobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • tueobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • wedobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • thuobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • friobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • satobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • sunobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

Example

PATCH/v1/automations/awayChange the away message →
curl -X PATCH "https://usebluebot.com/api/v1/automations/away" \
  -H "Authorization: Bearer $BLUEBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "cooldown_hours": 12
  }'

Response

200: The away message.

  • object"away_message"required
  • enabledbooleanrequired
  • textstring or nullrequired

    The reply, with {{variables}}.

  • cooldown_hoursintegerrequired

    Each person gets it at most once in this many hours.

  • business_hoursobjectrequired

    Your hours each day in your time zone; null for a day you’re closed.

    Show its 7 fields
    • monobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • tueobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • wedobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • thuobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • friobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • satobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

    • sunobject or nullrequired
      Show its 2 fields
      • startstringrequired

        A time of day as HH:MM in your account’s time zone.

      • endstringrequired

        A time of day as HH:MM in your account’s time zone.

  • time_zonestringrequired
  • open_nowbooleanrequired

    Whether it’s inside your business hours right now.

Response200
{
  "object": "away_message",
  "enabled": true,
  "text": "Thanks for your text! We’re closed right now and will reply when we open at 9 AM.",
  "cooldown_hours": 12,
  "business_hours": {
    "mon": {
      "start": "09:00",
      "end": "17:00"
    },
    "tue": {
      "start": "09:00",
      "end": "17:00"
    },
    "wed": {
      "start": "09:00",
      "end": "17:00"
    },
    "thu": {
      "start": "09:00",
      "end": "17:00"
    },
    "fri": {
      "start": "09:00",
      "end": "17:00"
    },
    "sat": null,
    "sun": null
  },
  "time_zone": "America/Chicago",
  "open_now": true
}

Errors

Every refusal has the same envelope and a page of its own. These are the ones this operation can give.

CodeStatusWhat it means
unauthorized401The request carried no key, or a key BlueBot doesn’t know: mistyped, revoked, or a test key sent to the live API.
insufficient_scope403The key doesn’t carry the scope the endpoint needs. Each endpoint’s reference names its scope.
rate_limited429Too many requests. A key may make 120 requests a minute. The RateLimit header says how many are left, and Retry-After how long to wait.
internal500Something went wrong on BlueBot’s side. It was reported. Send the request again; with an Idempotency-Key that is always safe.
invalid_request400Something in the request doesn’t fit: a missing or malformed field, a bad id, or a combination the endpoint refuses. details names each field.

Try it

Call this operation from the page with your own key. The key stays in this tab and is forgotten when you leave.