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

# Get an action rule

> Read the account-scoped rule, immutable revisions and recent run decisions. Send Accept: application/json for the documented JSON errors.



## OpenAPI

````yaml https://plainrouter.com/openapi.json get /agent/workspaces/{workspace}/action-rules/{action_rule}
openapi: 3.1.0
info:
  title: Plainrouter Conversion API
  version: 0.5.0
  description: Plainrouter public Signals Conversion API.
servers:
  - url: https://plainrouter.com/api/v1
    description: Production
security:
  - workspaceSecret: []
paths:
  /agent/workspaces/{workspace}/action-rules/{action_rule}:
    get:
      tags:
        - ActionRuleApi
      summary: Get an action rule
      description: >-
        Read the account-scoped rule, immutable revisions and recent run
        decisions. Send Accept: application/json for the documented JSON errors.
      operationId: actions.rules.show
      parameters:
        - name: workspace
          in: path
          required: true
          description: The workspace ID
          schema:
            type: integer
        - name: action_rule
          in: path
          required: true
          schema:
            type: string
        - name: account_id
          in: query
          description: >-
            Optional account ID, ignored by an account-bound key. An unbound key
            requires exactly one active available advertising account with an
            active connection; omission uses that account and a supplied ID must
            match it. Multiple active accounts return 422 even when account_id
            is supplied.
          schema:
            minimum: 1
            type: integer
      responses:
        '200':
          description: Rule with revisions and recent runs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionRuleDetailRead'
        '401':
          description: Missing, invalid, expired or revoked workspace key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Insufficient ability or grant, or a conflicting workspace selector.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrorMessage'
                  - type: object
                    properties:
                      error:
                        type: string
                        enum:
                          - insufficient_scope
                      error_description:
                        type: string
                    required:
                      - error
                      - error_description
        '404':
          description: Workspace, account or rule unavailable in this scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiRouteNotFound'
        '422':
          description: >-
            Invalid rule input or account ID, mismatched account binding, or
            ambiguous active accounts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '429':
          description: The shared API rate limit is exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          headers:
            Retry-After:
              description: Seconds until a retry is allowed.
              schema:
                type: integer
      security:
        - ruleReader: []
components:
  schemas:
    ActionRuleDetailRead:
      type: object
      properties:
        rule:
          type: object
          properties:
            id:
              type: string
            workspace_id:
              type: integer
            platform_ad_account_id:
              type: integer
            name:
              type: string
            enabled:
              type: boolean
            suspended_at:
              type:
                - string
                - 'null'
              format: date-time
            suspended_reason:
              type:
                - string
                - 'null'
            window:
              type: object
              properties:
                days:
                  type: integer
                  enum:
                    - 3
                kind:
                  type: string
                  enum:
                    - last_complete_days
                timezone:
                  type: string
              required:
                - days
                - kind
                - timezone
            current_revision:
              type: object
              properties:
                id:
                  type: string
                target_level:
                  type: string
                  enum:
                    - ad
                    - ad_set
                    - campaign
                action:
                  type: string
                  enum:
                    - pause
                    - increase_budget
                    - decrease_budget
                budget_change_percent:
                  type:
                    - integer
                    - 'null'
                minimum_counted_arrivals:
                  type: integer
                cost_comparison:
                  type: string
                  enum:
                    - at_least
                    - at_most
                cost_ratio:
                  type: string
                author_type:
                  type: string
                  enum:
                    - user
                    - agent
                created_at:
                  type: string
                  format: date-time
              required:
                - id
                - target_level
                - action
                - budget_change_percent
                - minimum_counted_arrivals
                - cost_comparison
                - cost_ratio
                - author_type
                - created_at
            revisions:
              type: array
              description: Present on show and write responses.
              items:
                type: object
                properties:
                  id:
                    type: string
                  target_level:
                    type: string
                    enum:
                      - ad
                      - ad_set
                      - campaign
                  action:
                    type: string
                    enum:
                      - pause
                      - increase_budget
                      - decrease_budget
                  budget_change_percent:
                    type:
                      - integer
                      - 'null'
                  minimum_counted_arrivals:
                    type: integer
                  cost_comparison:
                    type: string
                    enum:
                      - at_least
                      - at_most
                  cost_ratio:
                    type: string
                  author_type:
                    type: string
                    enum:
                      - user
                      - agent
                  created_at:
                    type: string
                    format: date-time
                required:
                  - id
                  - target_level
                  - action
                  - budget_change_percent
                  - minimum_counted_arrivals
                  - cost_comparison
                  - cost_ratio
                  - author_type
                  - created_at
            runs:
              type: array
              description: >-
                Show only; at most five recent runs, each with at most 100
                decisions.
              items:
                type: object
                properties:
                  id:
                    type: string
                  revision_id:
                    type: string
                  window_start:
                    type: string
                    format: date-time
                  window_end:
                    type: string
                    format: date-time
                  timezone:
                    type: string
                  status:
                    type: string
                  reason:
                    type:
                      - string
                      - 'null'
                  account_spend_minor:
                    type:
                      - string
                      - 'null'
                  account_counted_arrivals:
                    type:
                      - integer
                      - 'null'
                  evaluated_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  decisions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        target_type:
                          type: string
                        target_id:
                          type: string
                        target_name:
                          type:
                            - string
                            - 'null'
                        target_spend_minor:
                          type: string
                        target_counted_arrivals:
                          type: integer
                        decision:
                          type: string
                        reason:
                          type: string
                        action_type:
                          type: string
                        new_daily_budget_minor:
                          type:
                            - integer
                            - 'null'
                        action_batch_id:
                          type:
                            - string
                            - 'null'
                      required:
                        - id
                        - target_type
                        - target_id
                        - target_name
                        - target_spend_minor
                        - target_counted_arrivals
                        - decision
                        - reason
                        - action_type
                        - new_daily_budget_minor
                        - action_batch_id
                  decisions_truncated:
                    type: boolean
                required:
                  - id
                  - revision_id
                  - window_start
                  - window_end
                  - timezone
                  - status
                  - reason
                  - account_spend_minor
                  - account_counted_arrivals
                  - evaluated_at
                  - decisions
                  - decisions_truncated
          required:
            - id
            - workspace_id
            - platform_ad_account_id
            - name
            - enabled
            - suspended_at
            - suspended_reason
            - window
            - current_revision
            - revisions
            - runs
      required:
        - rule
      title: ActionRuleDetailRead
    ErrorMessage:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: ErrorMessage
    ApiRouteNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - api_route_not_found
            message:
              type: string
            resolution:
              type: string
          required:
            - code
            - message
            - resolution
        request:
          type: object
          properties:
            method:
              type: string
            path:
              type: string
          required:
            - method
            - path
        resources:
          type: object
          properties:
            documentation:
              type: string
            openapi:
              type: string
          required:
            - documentation
            - openapi
      required:
        - error
        - request
        - resources
      title: ApiRouteNotFound
    ValidationError:
      type: object
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
        - errors
      title: ValidationError
  securitySchemes:
    workspaceSecret:
      type: http
      description: >-
        Per-workspace Server secret. It authenticates only the Signals workspace
        represented by the credential.
      scheme: bearer
    ruleReader:
      type: http
      description: >-
        A workspace-scoped key with read ability and actions.rules.index or
        actions.rules.show access to the bound account. Send Accept:
        application/json.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.