> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rightfoot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Monitoring Schedule

> Create a recurring scheduled balance request for authorizers

# Create Monitoring Schedule

Create a recurring scheduled balance request for a set of authorizers. The schedule will automatically run balance checks at the specified interval and send results to your webhook.

## Scheduling Options

Use `interval_days` together with `time_of_day` to run balance checks every N days at a specific time.

| Field           | Description                                                                                                                                                      |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `interval_days` | Run every N days (1-30)                                                                                                                                          |
| `time_of_day`   | Time to run in HH:mm format (24-hour, UTC). Example: `"14:30"` for 2:30 PM UTC. If not provided, defaults to a random time in the 8:00 AM - 11:00 AM UTC window. |

## Key Information

<Card>
  <div>
    **Schedule Name (Required):** Provide a `name` to identify your schedule. Names must be unique (max 255 characters).
  </div>

  <div>
    **Start:** The first job runs at the `time_of_day` on the `starts_at` date, after which jobs will run on the provided interval (format: `YYYY-MM-DD`).
    If none is provided, the first job will run at the next `time_of_day`.
  </div>

  <div>
    **Expiration:** A final job runs at the scheduled `time_of_day` on the `expires_at` date, after which no more jobs will run (format: `YYYY-MM-DD`, default 30 days from creation, max 365 days)
  </div>

  <div>
    **Webhook:** Results are delivered to your specified webhook URL after each run
  </div>
</Card>

## Threshold Monitoring

Set balance thresholds to receive webhook notifications when an account's balance meets or exceeds a specified amount.

| Field              | Level      | Description                                                                                                                          |
| ------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `threshold_amount` | Request    | Applies to all authorizers in the batch. When any authorizer's balance meets or exceeds this amount, a webhook notification is sent. |
| `threshold_amount` | Authorizer | Set within each authorizer object to define individual thresholds. Overrides the request-level threshold if both are provided.       |

<Note>
  When any threshold is configured (request-level or authorizer-level), the `webhook` field is required.
</Note>

## Payment Information Types

You must provide either **bank account information** or **debit card information** for each authorizer:

### Bank Account Information

* Required: `account_number`, `routing_number`, and either `ssn` or `ein`

### Debit Card Information

* Required: `debit_card_number`, `cvv`, `expiration_year`, `expiration_month`, and either `ssn` or `ein`

### Optional Fields

* `threshold_amount`: Balance threshold in dollars for this authorizer (see [Threshold Monitoring](#threshold-monitoring))


## OpenAPI

````yaml POST /v1/monitoring/scheduled_balance_request
openapi: 3.1.0
info:
  title: Rightfoot API
  description: >-
    Submit a batch of authorizers for balance checks, retrieve processed
    balances, and check the status of a batch.
  version: 0.3.0-alpha
servers:
  - url: https://api.rightfoot.com
security:
  - BearerAuth: []
tags:
  - name: General Availability
    description: |
      **General Availability** indicates that the endpoint is production-ready.
  - name: Early Access
    description: >
      **Early Access** indicates that the endpoint is available for early access
      customers and is being actively refined.
  - name: In Development
    description: >
      **In Development** indicates that the endpoint is currently being built
      and will be available in an upcoming release.
paths:
  /v1/monitoring/scheduled_balance_request:
    post:
      tags:
        - General Availability
      summary: Create a scheduled balance request
      description: >
        Create a recurring scheduled balance request for a set of authorizers.
        The schedule will automatically run balance checks at the specified
        interval.


        **Scheduling:** Use `interval_days` together with `time_of_day` to run
        every N days at a specific time.


        **Expiration:** Schedules expire on the specified `expires_at` date
        (format: YYYY-MM-DD, default 30 days from creation, max 365 days).
      operationId: create_scheduled_balance_request
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduledBalanceRequest'
            example:
              name: Weekly Balance Check
              authorizers:
                - authorizer_unique_id: 1a2b3c4d
                  first_name: John
                  last_name: Doe
                  address:
                    street_address_line1: 123 Main St
                    city: Anytown
                    state: CA
                    zip_code: '12345'
                    country: US
                  phone_number: '5551234567'
                  date_of_birth:
                    day: 1
                    month: 1
                    year: 1980
                  ssn: '123456789'
                  account_number: '1234567890'
                  routing_number: '021000021'
              webhook: https://api.example.com/webhook/scheduled-balance
              interval_days: 7
              time_of_day: '14:30'
              start_at: '2025-01-01'
              expires_at: '2025-03-15'
      responses:
        '201':
          description: Schedule created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledBalanceResponse'
              example:
                schedule_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                name: Weekly Balance Check
                message: Schedule created successfully
                expires_at: '2025-01-15T00:00:00Z'
                next_run_at: '2024-12-19T02:30:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                status: error
                status_code: 400
                error:
                  code: BAD_REQUEST
                  message: Invalid scheduling configuration.
                  timestamp: '2024-12-12T12:00:00Z'
                  suggestion: Provide interval_days with an optional time_of_day.
                documentation_url: https://api.rightfoot.com/docs
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                status: error
                status_code: 409
                error:
                  code: CONFLICT
                  message: Schedule name already exists.
                  timestamp: '2024-12-12T12:00:00Z'
                  suggestion: >-
                    A schedule with this name already exists. Please use a
                    different name.
                documentation_url: https://api.rightfoot.com/docs
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ScheduledBalanceRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
          description: Name for the schedule. Must be unique. Max 255 characters.
        authorizers:
          type: array
          description: List of authorizers to include in the scheduled balance checks.
          items:
            $ref: '#/components/schemas/Authorizer'
        webhook:
          type: string
          format: uri
          description: >-
            Webhook URL to receive notifications when each scheduled run
            completes.
        interval_days:
          type: integer
          minimum: 1
          maximum: 30
          description: >
            Run the schedule every N days. Used together with `time_of_day` for
            interval-based scheduling.

            Value must be between 1 and 30.
        time_of_day:
          type: string
          pattern: ^([01]?[0-9]|2[0-3]):[0-5][0-9]$
          description: >
            Time of day to run the schedule in HH:mm format (24-hour, UTC). Used
            together with `interval_days`.

            If not provided, defaults to a random time in the 8:00 AM - 11:00 AM
            UTC window.

            Example: "14:30" for 2:30 PM UTC.
        start_at:
          type: string
          format: date
          description: >-
            Date at which the schedule should start in YYYY-MM-DD format. If
            none is provided, the schedule will start at the next `time_of_day`.
        expires_at:
          type: string
          format: date
          description: >-
            Date when the schedule expires in YYYY-MM-DD format. Default is 30
            days from creation, maximum is 365 days.
      required:
        - name
        - authorizers
        - webhook
    ScheduledBalanceResponse:
      type: object
      properties:
        schedule_id:
          type: string
          format: uuid
          description: Unique identifier for the created schedule.
        name:
          type: string
          description: The name of the schedule.
        message:
          type: string
          description: Confirmation message.
        expires_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the schedule will expire.
        next_run_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of the next scheduled run.
      required:
        - schedule_id
        - name
        - message
        - expires_at
        - next_run_at
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: string
          description: Status of the error, either "error" or "success"
        status_code:
          type: integer
          description: HTTP status code of the error
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code (e.g., "RESOURCE_NOT_FOUND")
            message:
              type: string
              description: Detailed error message.
            details:
              type: string
              description: Additional details about the error
            timestamp:
              type: string
              format: date-time
              description: Time the error occurred
            suggestion:
              type: string
              description: Suggested action to resolve the error
        documentation_url:
          type: string
          format: uri
          description: URL to the documentation for the error
    Authorizer:
      type: object
      required:
        - authorizer_unique_id
        - address
        - phone_number
        - date_of_birth
      properties:
        authorizer_unique_id:
          type: string
          description: Alphanumeric unique ID for an authorizer, provided by the lender.
        first_name:
          type: string
          description: The authorizer's first name.
        last_name:
          type: string
          description: The authorizer's last name.
        address:
          type: object
          required:
            - zip_code
          properties:
            street_address_line1:
              type: string
              description: Address line 1 (e.g., street, PO Box, or company name).
            street_address_line2:
              type: string
              description: Address line 2 (e.g., apartment, suite, unit, or building).
            city:
              type: string
              description: City, district, suburb, town, or village.
            state:
              type: string
              description: State, county, province, or region.
            zip_code:
              type: string
              description: >-
                ZIP or postal code. Must be 5 digits or in 5+4 format (e.g.,
                94107 or 94107-1234).
              pattern: ^\d{5}(?:-\d{4})?$
            country:
              type: string
              description: Two-letter country code.
        phone_number:
          type: string
          description: The authorizer's phone number
        date_of_birth:
          type: object
          description: Object containing day, month, and year of birth
          required:
            - day
            - month
            - year
          properties:
            day:
              type: integer
              description: The day of birth, between 1 and 31.
            month:
              type: integer
              description: The month of birth, between 1 and 12.
            year:
              type: integer
              description: The four-digit year of birth.
        ssn:
          type: string
          description: The authorizer's Social Security Number, in string form
        ein:
          type: string
          description: The authorizer's Employer Identification Number, in string form
      anyOf:
        - title: Bank Account Information
          description: >-
            Payment details using a bank account. Requires account number,
            routing number, and either SSN or EIN.
          type: object
          properties:
            account_number:
              type: string
              description: The account number for the bank account, in string form.
            routing_number:
              type: string
              pattern: ^\\d{9}$
              description: The routing number for the bank account.
            ssn:
              type: string
              description: Either SSN or EIN is required.
            ein:
              type: string
              description: Either SSN or EIN is required.
          required:
            - account_number
            - routing_number
        - title: Debit Card Information
          description: >-
            Payment details using a debit card. Requires debit card number, cvv,
            expiration, and either SSN or EIN. Routing number is optional.
            Account number is not applicable and will not appear.
          type: object
          properties:
            debit_card_number:
              type: string
              description: A sixteen digit debit card number.
              pattern: ^\\d{16}$
            cvv:
              type: string
              description: 3 or 4 digit CVV for the debit card.
              pattern: ^\\d{3,4}$
            expiration_year:
              type: integer
              description: Four-digit expiration year of the debit card.
            expiration_month:
              type: integer
              description: Expiration month of the debit card (1-12).
              minimum: 1
              maximum: 12
            routing_number:
              type: string
              pattern: ^\\d{9}$
              description: >-
                (Optional) The routing number for the bank account, if debit
                card is linked to one.
            ssn:
              type: string
              description: Either SSN or EIN is required.
            ein:
              type: string
              description: Either SSN or EIN is required.
          required:
            - debit_card_number
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: error
            status_code: 401
            error:
              code: UNAUTHORIZED
              message: Invalid API key provided.
              timestamp: '2024-09-16T12:01:00Z'
              suggestion: Please check your API key.
            documentation_url: https://api.rightfoot.com/docs
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: error
            status_code: 500
            error:
              code: INTERNAL_SERVER_ERROR
              message: An unexpected error occurred while retrieving the balances.
              timestamp: '2024-09-16T12:11:00Z'
              suggestion: >-
                Please try again later. If the problem persists, contact our
                support team.
            documentation_url: https://api.rightfoot.com/docs
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Authentication to the API is performed via Bearer Token Authentication.
        Provide your API key as the bearer token in the Authorization header.


        All API requests must be made over HTTPS. Calls made over plain HTTP
        will fail. API requests without authentication will also fail.

````