Oracle APEX Modules API

REST module management. A module is a container for one or more templates with an associated base path.

OpenAPI Specification

oracle-apex-modules-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Oracle REST Data Services (ORDS) REST AutoREST Modules API
  description: REST API for managing Oracle REST Data Services (ORDS) RESTful service definitions including modules, templates, handlers, privileges, roles, OAuth clients, and AutoREST-enabled objects. ORDS provides a mid-tier Java application that maps HTTP requests to database transactions, enabling RESTful access to Oracle Database resources. This specification covers the ORDS REST Services Management endpoints available through the Database API stable interface.
  version: '25.4'
  contact:
    name: Oracle APEX Support
    url: https://apex.oracle.com/community
    email: apex-info_us@oracle.com
  license:
    name: Oracle Technology Network License
    url: https://www.oracle.com/downloads/licenses/distribution-license.html
servers:
- url: https://{host}:{port}/ords/_/db-api/stable
  description: ORDS Database API stable endpoint
  variables:
    host:
      default: localhost
      description: Hostname of the ORDS instance
    port:
      default: '8443'
      description: Port number for the ORDS instance
- url: https://{host}/ords/_/db-api/stable
  description: ORDS Database API stable endpoint (default port)
  variables:
    host:
      default: example.com
      description: Hostname of the ORDS instance
security:
- basicAuth: []
- oauth2: []
tags:
- name: Modules
  description: REST module management. A module is a container for one or more templates with an associated base path.
paths:
  /ords/rest/modules/:
    get:
      operationId: listModules
      summary: Get all REST modules
      description: Retrieves a paginated list of all REST service modules defined in the current schema.
      tags:
      - Modules
      parameters:
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: Paginated list of REST modules
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemsCollection'
    post:
      operationId: createModule
      summary: Create a REST module
      description: Creates a new REST service module with the specified name and base path. A module is a container for templates that defines the root URI pattern for a group of related REST services.
      tags:
      - Modules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModuleCreate'
      responses:
        '200':
          description: Source code preview of the module creation (when run_mode is codePreview)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '201':
          description: REST module created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '404':
          description: No name or base_path parameter provided
        '409':
          description: A module with that name or base path already exists
  /ords/rest/modules/{id}:
    get:
      operationId: getModule
      summary: Get a REST module
      description: Retrieves details of a specific REST service module by its identifier.
      tags:
      - Modules
      parameters:
      - $ref: '#/components/parameters/resourceId'
      responses:
        '200':
          description: REST module details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '404':
          description: Module not found
    put:
      operationId: updateModule
      summary: Update a REST module
      description: Updates an existing REST service module. All mutable properties of the module can be modified.
      tags:
      - Modules
      parameters:
      - $ref: '#/components/parameters/resourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModuleCreate'
      responses:
        '200':
          description: REST module updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '404':
          description: Module not found
        '409':
          description: A module with that name or base path already exists
  /ords/rest/modules/{id}/source:
    get:
      operationId: getModuleSource
      summary: Get a REST module source
      description: Retrieves the PL/SQL source code that defines the specified REST service module.
      tags:
      - Modules
      parameters:
      - $ref: '#/components/parameters/resourceId'
      responses:
        '200':
          description: REST module source code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '404':
          description: Module not found
components:
  schemas:
    ModuleCreate:
      type: object
      description: Request body for creating or updating a REST service module
      required:
      - name
      - base_path
      properties:
        name:
          type: string
          description: Name of the RESTful service module. Case sensitive.
        base_path:
          type: string
          description: The base URI path used to access this RESTful service. All URIs starting with this path will be serviced by this module.
          examples:
          - hr/
          - api/v1/
        origins_allowed:
          type: string
          description: Comma-separated list of allowed CORS origins for the module
        items_per_page:
          type: integer
          description: Default pagination size for GET handlers (number of rows per page)
          default: 25
          minimum: 1
        module_status:
          type: string
          description: Publication status of the module
          enum:
          - PUBLISHED
          - NOT_PUBLISHED
          default: PUBLISHED
        comments:
          type: string
          description: Descriptive comment for the module
        run_mode:
          type: string
          description: Set to 'codePreview' to return the PL/SQL code that would be executed instead of executing it
          enum:
          - codePreview
    LinkRelation:
      type: object
      description: HATEOAS link relation describing a related resource or action
      required:
      - rel
      - href
      properties:
        rel:
          type: string
          description: Link relationship type (e.g., self, describedby, edit, collection)
        href:
          type: string
          description: URI of the related resource
    ResourceItem:
      type: object
      description: A single resource item with HATEOAS navigation links. Additional properties are included depending on the resource type.
      additionalProperties: true
      properties:
        links:
          type: array
          description: HATEOAS links for the resource
          items:
            $ref: '#/components/schemas/LinkRelation'
    ItemsCollection:
      type: object
      description: Paginated collection of resource items following the ORDS standard collection format
      properties:
        count:
          type: integer
          description: Total number of records in the current response page
        hasMore:
          type: boolean
          description: Indicates whether additional pages of results are available
        limit:
          type: integer
          description: The page size limit applied by the server
        offset:
          type: integer
          description: The starting index of items in this page
        items:
          type: array
          description: Array of resource items in this page
          items:
            $ref: '#/components/schemas/ResourceItem'
        links:
          type: array
          description: Pagination navigation links (first, next, prev, last)
          items:
            $ref: '#/components/schemas/LinkRelation'
  parameters:
    offset:
      name: offset
      in: query
      required: false
      description: The index of the first item to return (0-based). Default is 0.
      schema:
        type: integer
        default: 0
        minimum: 0
    resourceId:
      name: id
      in: path
      required: true
      description: Unique identifier of the resource
      schema:
        type: integer
    limit:
      name: limit
      in: query
      required: false
      description: Maximum number of items to return per page. Default is 25.
      schema:
        type: integer
        default: 25
        minimum: 1
        maximum: 500
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication using ORDS-enabled database schema credentials
    oauth2:
      type: oauth2
      description: OAuth 2.0 authorization using ORDS OAuth client credentials or authorization code flow
      flows:
        clientCredentials:
          tokenUrl: /ords/{schema}/oauth/token
          scopes: {}
        authorizationCode:
          authorizationUrl: /ords/{schema}/oauth/auth
          tokenUrl: /ords/{schema}/oauth/token
          scopes: {}