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

# Get One Rule

> Get a rule by ID



## OpenAPI

````yaml /api-reference/openapi.json get /api/rest/rules/{id}
openapi: 3.1.0
info:
  description: >-
    Upwell is Accounts Receivable automation software for the logistics
    industry. We serve freight brokers, carriers, factors, and anyone who needs
    to get transportation invoices paid.


    Learn more at:


    - [Upwell.com](https://upwell.com)
  title: Upwell REST API
  version: 3.30.2
  termsOfService: https://upwell.com/legal
  contact:
    name: Upwell
    url: https://upwell.com
    email: contact@upwell.com
servers:
  - url: https://api.upwell.com
    description: Production server
  - url: https://staging.api.upwell.com
    description: Staging server
security: []
tags:
  - name: Invoice Approval
    description: Endpoints for managing customer invoice approval workflow
paths:
  /api/rest/rules/{id}:
    get:
      tags:
        - Rules
      summary: Get One Rule
      description: Get a rule by ID
      parameters:
        - description: >-
            Your API key will be used for authentication of the request.
            `Authorization: YOUR_API_KEY`
          in: header
          name: authorization
          schema:
            type: string
        - description: _"id" is required (enter it either in parameters or request body)_
          in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  rule:
                    description: Rules used for matching, document requirements, etc
                    nullable: true
                    properties:
                      actionType:
                        $ref: '#/components/schemas/RuleActionTypeEnum'
                      actionValue:
                        $ref: '#/components/schemas/jsonb'
                      conditionExpression:
                        nullable: true
                        title: String
                        type: string
                      createdAt:
                        $ref: '#/components/schemas/timestamp'
                      criteriaField:
                        nullable: true
                        title: String
                        type: string
                      criteriaObject:
                        $ref: '#/components/schemas/RuleCriteriaObjectEnum'
                      criteriaOperator:
                        $ref: '#/components/schemas/ComparisonOperatorEnum'
                      criteriaValue:
                        nullable: true
                        title: String
                        type: string
                      customerId:
                        nullable: true
                        title: String
                        type: string
                      id:
                        nullable: false
                        title: String
                        type: string
                      priority:
                        nullable: false
                        title: Int
                        type: integer
                      type:
                        $ref: '#/components/schemas/RuleTypeEnum'
                      updatedAt:
                        $ref: '#/components/schemas/timestamp'
                      validationExpression:
                        nullable: true
                        title: String
                        type: string
                    title: Rules
                    type: object
          description: Responses for GET /api/rest/rules/{id}
components:
  schemas:
    RuleActionTypeEnum:
      enum:
        - CREATE_EXCEPTION
        - ROUTE_TO_SCAC
        - SET_CUSTOMER_BY_CASS_ID
        - SET_CUSTOMER_BY_CUSTOMER_NAME
        - SET_REQUIRED_DOCUMENTS
        - VALIDATE_CONTENT
      nullable: false
      title: RuleActionTypeEnum
    jsonb:
      nullable: false
      title: jsonb
    timestamp:
      nullable: false
      title: timestamp
    RuleCriteriaObjectEnum:
      enum:
        - CUSTOMER
        - DOCUMENT
        - EMAIL_MESSAGE
        - INVOICE
        - PARSED_INVOICE
        - PORTAL
        - SHIPMENT
        - TMS
      nullable: false
      title: RuleCriteriaObjectEnum
    ComparisonOperatorEnum:
      enum:
        - ARRAY_DOES_NOT_HAVE_OBJECT_WITH_PROPERTY
        - ARRAY_HAS_OBJECT_WITH_PROPERTY
        - CONTAINED_IN
        - CONTAINS
        - EQ
        - GT
        - GTE
        - HAS_KEY
        - HAS_KEYS_ALL
        - HAS_KEYS_ANY
        - ILIKE
        - IN
        - IREGEX
        - IS_NULL
        - LIKE
        - LT
        - LTE
        - NEQ
        - NILIKE
        - NIN
        - NLIKE
        - NREGEX
        - NSIMILAR
        - REGEX
        - SIMILAR
      nullable: false
      title: ComparisonOperatorEnum
    RuleTypeEnum:
      enum:
        - CARRIER_INVOICE_EXCEPTION
        - CUSTOMER_INVOICE_EXCEPTION
        - DOCUMENT_BASIC
        - DOCUMENT_CUSTOM
        - ON_CREATION_FROM_EMAIL
        - REFERENCE_NUMBER
        - SCAC_ROUTING
      nullable: false
      title: RuleTypeEnum

````