Oracle APEX AutoREST API

AutoREST object management. AutoREST enables automatic REST access to database tables and views.

OpenAPI Specification

oracle-apex-autorest-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Oracle REST Data Services (ORDS) REST AutoREST 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: AutoREST
  description: AutoREST object management. AutoREST enables automatic REST access to database tables and views.
paths:
  /ords/rest/autorest/:
    get:
      operationId: listAutoRestObjects
      summary: Get all REST enabled objects
      description: Retrieves a paginated list of all database objects that have been REST-enabled through AutoREST in the current schema.
      tags:
      - AutoREST
      parameters:
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: Paginated list of REST-enabled objects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemsCollection'
    post:
      operationId: enableAutoRest
      summary: REST enable an object
      description: Enables automatic REST access for a database table or view. AutoREST generates standard CRUD endpoints for the specified object without requiring manual module, template, or handler definitions.
      tags:
      - AutoREST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutoRestEnable'
      responses:
        '201':
          description: Object REST-enabled successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '400':
          description: Missing required parameters
        '409':
          description: Object is already REST-enabled
  /ords/rest/autorest/{id}:
    get:
      operationId: getAutoRestObject
      summary: Get a REST enabled object
      description: Retrieves details of a specific REST-enabled object by its identifier.
      tags:
      - AutoREST
      parameters:
      - $ref: '#/components/parameters/resourceId'
      responses:
        '200':
          description: REST-enabled object details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '404':
          description: REST-enabled object not found
    put:
      operationId: updateAutoRestObject
      summary: Update or disable a REST enabled object
      description: Updates the configuration of a REST-enabled object or disables REST access for the object.
      tags:
      - AutoREST
      parameters:
      - $ref: '#/components/parameters/resourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutoRestEnable'
      responses:
        '200':
          description: REST-enabled object updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '404':
          description: REST-enabled object not found
  /ords/rest/autorest/{id}/metadata:
    get:
      operationId: getAutoRestObjectMetadata
      summary: Get a REST enabled object metadata
      description: Retrieves the metadata (column definitions, types, constraints) for a REST-enabled database object.
      tags:
      - AutoREST
      parameters:
      - $ref: '#/components/parameters/resourceId'
      responses:
        '200':
          description: REST-enabled object metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
        '404':
          description: REST-enabled object not found
  /ords/rest/autorest/summary:
    get:
      operationId: getAutoRestSummary
      summary: Get count of all REST enabled objects
      description: Retrieves a summary count of all REST-enabled objects in the current schema.
      tags:
      - AutoREST
      responses:
        '200':
          description: Summary count of REST-enabled objects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceItem'
components:
  schemas:
    AutoRestEnable:
      type: object
      description: Request body for enabling or updating AutoREST on a database object
      required:
      - object_name
      - object_alias
      - auth
      properties:
        object_name:
          type: string
          description: Name of the database table or view to REST-enable
        object_alias:
          type: string
          description: Alias used in the REST URI path for the object
        auth:
          type: boolean
          description: When true, requires user authorization via ORDS roles before allowing access to the object metadata and data
        run_mode:
          type: string
          description: Set to 'codePreview' to return the PL/SQL code 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: {}