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

# Restore a rule



## OpenAPI

````yaml POST /apps/connect/v1/rules/{number}/restore
openapi: 3.1.0
info:
  title: Invopop Connect configuration API
  version: 1.0.0
  description: >-
    Configure how Connect receives and imports a workspace's invoices: rules
    (short instructions for the AI that reads PDFs and images), profiles
    (ordered groups of rules a workflow's import step uses) and endpoints (HTTP
    upload URLs and email addresses that receive documents). Documents give what
    an import recorded for a silo entry.


    Call it through Invopop's API at https://api.invopop.com/apps/connect with a
    workspace token: `Authorization: Bearer <token>`. The workspace must have
    the Connect app enabled.


    Typical setup:

    1. Create rules: `POST /v1/rules {"text": "Use the de-xrechnung-v3 addon"}`.
    Each gets a `number`.

    2. Create a profile from them: `POST /v1/profiles {"name": "Germany",
    "rules": [1, 2]}`, and keep its `id`.

    3. In the workflow's "Import document" step, choose that profile (its config
    is `{"profile_id": "<id>"}`).

    4. Create an endpoint that runs the workflow: `POST /v1/endpoints
    {"channel": "http", "slug": "suppliers", "workflow_id": "<workflow id>",
    "config": {"security": {"type": "bearer", "token": "<secret>"}}}`. Send
    documents to its `uri`.


    Errors answer `{"status": "error", "message": "..."}`: 401 bad token or
    Connect not enabled, 404 not found, 422 invalid request (the message says
    which field and why).
  contact:
    email: dev@invopop.com
    name: Invopop Developers
servers:
  - description: production
    url: https://api.invopop.com
security:
  - InvopopAuth: []
paths:
  /apps/connect/v1/rules/{number}/restore:
    parameters:
      - name: number
        in: path
        required: true
        schema:
          type: integer
          minimum: 1
        description: The rule's number
    post:
      summary: Bring an archived rule back
      operationId: restoreRule
      responses:
        '200':
          description: The rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
        '404':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
components:
  schemas:
    Rule:
      type: object
      properties:
        number:
          type: integer
          description: >-
            Identifies the rule in its workspace for good: numbers are never
            reused. Profiles list rules by number.
        id:
          type: string
        text:
          type: string
        addon:
          type: string
          description: The GOBL addon the rule names, if any
        profiles:
          type: array
          items:
            type: string
          description: Ids of the profiles using the rule
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        archived_at:
          type: string
          format: date-time
          description: Set on an archived rule
  responses:
    Error:
      description: An error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                const: error
              message:
                type: string
  securitySchemes:
    InvopopAuth:
      type: http
      scheme: bearer
      description: >-
        A workspace token in the `Bearer` scheme. The workspace must have the
        Connect app enabled.

````

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