openapi: 3.0.0
info:
  title: Blueprints
  description: Blueprints allow you to define and automate structured business processes in Zoho Books. Define states, transitions, and actions to ensure your team follows the correct procedures for key business workflows.
  contact: {}
  version: 1.0.0
servers:
  - url: https://www.zohoapis.com/books/v3
    description: API Endpoint
tags:
  - name: blueprints
    description: Blueprints Module
paths:
  /settings/blueprints:
    get:
      tags:
        - blueprints
      operationId: list_blueprints
      summary: List blueprints
      description: List all the blueprints configured for the organization.
      parameters:
        - name: filter_by
          in: query
          description: Filter blueprints by entity type.
          required: false
          schema:
            type: string
        - name: page
          in: query
          description: Page number for pagination. Default is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records per page. Default is 200.
          required: false
          schema:
            type: integer
            default: 200
          example: 200
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-blueprints-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.settings.READ
    post:
      tags:
        - blueprints
      operationId: create_blueprint
      summary: Create a blueprint
      description: Create a new blueprint for a module.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-blueprint-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-blueprint-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.settings.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /settings/blueprints/{blueprint_id}:
    get:
      tags:
        - blueprints
      operationId: get_blueprint
      summary: Get a blueprint
      description: Get the details of a specific blueprint.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get-blueprint-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.settings.READ
    put:
      tags:
        - blueprints
      operationId: update_blueprint
      summary: Update a blueprint
      description: Update an existing blueprint.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-blueprint-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-blueprint-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.settings.UPDATE
    delete:
      tags:
        - blueprints
      operationId: delete_blueprint
      summary: Delete a blueprint
      description: Delete an existing blueprint.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-blueprint-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoBooks.settings.DELETE
    parameters:
      - name: blueprint_id
        in: path
        required: true
        description: Unique identifier of the blueprint.
        schema:
          type: string
        example: '982000000567001'
      - $ref: '#/components/parameters/organization_id'
components:
  parameters:
    organization_id:
      name: organization_id
      description: ID of the organization
      in: query
      required: true
      schema:
        type: string
      example: '10234695'
  schemas:
    blueprint:
      type: object
      properties:
        blueprint_id:
          type: string
          description: Unique identifier of the blueprint.
          example: '982000000567001'
        blueprint_name:
          type: string
          description: Name of the blueprint.
          example: Invoice Approval
        entity:
          type: string
          description: The module/entity this blueprint is associated with.
          example: invoice
        is_active:
          type: boolean
          description: Whether the blueprint is active.
          example: true
    create-blueprint-request:
      type: object
      required:
        - blueprint_name
        - entity
      properties:
        blueprint_name:
          type: string
          description: Name of the blueprint.
          example: Invoice Approval
        entity:
          type: string
          description: The module/entity this blueprint is associated with.
          example: invoice
    update-blueprint-request:
      type: object
      properties:
        blueprint_name:
          type: string
          description: Name of the blueprint.
          example: Invoice Approval
    create-blueprint-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
        message:
          type: string
          example: The blueprint has been created.
        blueprint:
          $ref: '#/components/schemas/blueprint'
    update-blueprint-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
        message:
          type: string
          example: The blueprint has been updated.
        blueprint:
          $ref: '#/components/schemas/blueprint'
    get-blueprint-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
        message:
          type: string
          example: success
        blueprint:
          $ref: '#/components/schemas/blueprint'
    list-blueprints-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
        message:
          type: string
          example: success
        blueprints:
          type: array
          items:
            $ref: '#/components/schemas/blueprint'
    delete-blueprint-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
        message:
          type: string
          example: The blueprint has been deleted.
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoBooks.settings.CREATE: Create Settings
            ZohoBooks.settings.UPDATE: Update Settings
            ZohoBooks.settings.READ: Read Settings
            ZohoBooks.settings.DELETE: Delete Settings
