openapi: 3.1.0
info:
title: Codehooks Database REST Documents Queue API
description: The Codehooks.io Database REST API provides a complete and secure REST API for basic database CRUD (Create, Read, Update, Delete) operations on NoSQL collections. The API supports querying with MongoDB-like syntax, pagination, sorting, and field selection. It also includes a key-value store for caching and fast lookups, and a queue system for asynchronous job processing. All endpoints are prefixed with the project ID and datastore space name.
version: 1.0.0
contact:
name: Codehooks
url: https://codehooks.io/
license:
name: Proprietary
url: https://codehooks.io/terms
servers:
- url: https://{projectId}.api.codehooks.io/{space}
description: Codehooks API endpoint
variables:
projectId:
default: myproject-ff00
description: The project ID assigned to your Codehooks project
space:
default: dev
description: The datastore space name (e.g. dev, staging, prod)
security:
- apiKey: []
tags:
- name: Queue
description: Asynchronous job queue for worker processing
paths:
/queue/{topic}:
post:
operationId: enqueueJob
summary: Codehooks Enqueue a job
description: Add a job to a named queue topic. Jobs are processed asynchronously by worker functions registered for the topic.
tags:
- Queue
parameters:
- name: topic
in: path
required: true
description: The queue topic name to add the job to
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
description: The job payload to be processed by the worker
responses:
'201':
description: Job enqueued successfully
content:
application/json:
schema:
type: object
properties:
_id:
type: string
description: The unique identifier of the enqueued job
topic:
type: string
description: The queue topic name
'401':
description: Unauthorized - invalid or missing API key
components:
securitySchemes:
apiKey:
type: apiKey
name: x-apikey
in: header
description: API key for authentication. Obtain from the Codehooks.io dashboard or CLI.
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: JWT token for authentication