AIStoryHub Rules API
Story Rules: a reusable writing-instruction library, not tied to one story.
Story Rules: a reusable writing-instruction library, not tied to one story.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/aistoryhub-co:aistoryhub-co-rules-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: AIStoryHub Rules API
version: 1.0.0
description: A REST API for reading and creating stories and chapters on AIStoryHub outside the app. Authenticate with a scoped bearer token created under Settings, Developer API. Scopes are explicit, so write access does not imply read access.
contact:
url: https://aistoryhub.co/developers
termsOfService: https://aistoryhub.co/terms
servers:
- url: https://aistoryhub.co/api/v1
security:
- bearerAuth: []
tags:
- name: Rules
description: 'Story Rules: a reusable writing-instruction library, not tied to one story.'
paths:
/rules:
get:
operationId: listRules
tags:
- Rules
summary: List your Story Rules library
x-required-scope: rules:read
parameters:
- name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 25
- name: offset
in: query
schema:
type: integer
minimum: 0
default: 0
responses:
'200':
description: A page of Story Rules.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Rule'
pagination:
$ref: '#/components/schemas/Pagination'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
post:
operationId: createRule
tags:
- Rules
summary: Create or update a Story Rule
description: Reusing an existing name overwrites that rule instead of creating a duplicate.
x-required-scope: rules:write
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RuleCreate'
responses:
'201':
description: The created or updated rule.
content:
application/json:
schema:
$ref: '#/components/schemas/Rule'
'400':
$ref: '#/components/responses/InvalidRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
/rules/{id}:
get:
operationId: getRule
tags:
- Rules
summary: Fetch a single Story Rule
x-required-scope: rules:read
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: The rule.
content:
application/json:
schema:
$ref: '#/components/schemas/Rule'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
patch:
operationId: updateRule
tags:
- Rules
summary: Update a Story Rule's fields
x-required-scope: rules:write
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RuleCreate'
responses:
'200':
description: The updated rule.
content:
application/json:
schema:
$ref: '#/components/schemas/Rule'
'400':
$ref: '#/components/responses/InvalidRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
delete:
operationId: deleteRule
tags:
- Rules
summary: Delete a Story Rule
description: 'Irreversible. The first call always fails with `confirmation_required`; retry with `confirm: true` to actually delete.'
x-required-scope: rules:write
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
requestBody:
content:
application/json:
schema:
type: object
properties:
confirm:
type: boolean
responses:
'200':
description: Deleted.
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
description: 'Needs `confirm: true` to proceed.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
$ref: '#/components/responses/RateLimited'
components:
schemas:
Pagination:
type: object
properties:
limit:
type: integer
offset:
type: integer
total:
type: integer
Rule:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
instructions:
type: string
special_instructions:
type:
- string
- 'null'
context:
type:
- string
- 'null'
description:
type:
- string
- 'null'
content_rating:
type: string
enum:
- general
- adult
created_at:
type:
- string
- 'null'
format: date-time
updated_at:
type:
- string
- 'null'
format: date-time
Error:
type: object
properties:
error:
type: object
properties:
code:
type: string
enum:
- unauthorized
- forbidden
- invalid_request
- not_found
- rate_limited
- internal_error
message:
type: string
RuleCreate:
type: object
required:
- name
- instructions
properties:
name:
type: string
description: Reusing an existing name overwrites it.
instructions:
type: string
special_instructions:
type: string
context:
type: string
description:
type: string
content_rating:
type: string
enum:
- general
- adult
default: general
responses:
InvalidRequest:
description: The request body or parameters are invalid.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Forbidden:
description: The token lacks the scope this endpoint requires.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
Unauthorized:
description: Missing, malformed, invalid, revoked, or expired token.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
RateLimited:
description: Too many requests. Retry after the delay in the `Retry-After` header.
headers:
Retry-After:
schema:
type: integer
description: Seconds to wait before retrying.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
NotFound:
description: The resource does not exist or you do not own it.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: ash_...
description: 'Create a token under Settings, Developer API and send it as `Authorization: Bearer ash_...`. Each endpoint requires one scope, listed per-operation via the `x-required-scope` extension; see https://aistoryhub.co/developers for the full scope list.'