Cotal Chat Session API
The Chat Session API from Cotal — 3 operation(s) for chat session.
The Chat Session API from Cotal — 3 operation(s) for chat session.
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/cotal-ai:cotal-ai-chat-session-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: Cotal Ai Chat Session API
version: 1.0.0
description: 'Operations tagged Chat Session across 2 of this provider''s published API definitions: cotal-ai-auth-openapi.json, cotal-ai-auth-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://auth.example.invalid
description: Replace with the configured HTTPS public authority URL; TLS terminates at the operator proxy.
tags:
- name: Chat Session
paths:
/chat-session/open:
post:
operationId: auth-chat-session-open
summary: Admit a narrowed chat session
description: Fresh JSON IdP proof derives owner. Body is closed; unknown or missing fields are 400 before proof verification. Uses holderHash and the current cli parent grant; does not accept a caller-selected actor. Origin is refused. Effect failures preserve native code and outcome; missing native outcome means unknown. Retain the same holder on an uncertain retry. Credential verification and native dispatch failures share the public peer refusal budget.
security: []
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/ChatAdmitted'
'400':
$ref: '#/components/responses/ChatRefusal'
'401':
$ref: '#/components/responses/ChatRefusal'
'403':
$ref: '#/components/responses/ChatRefusal'
'404':
$ref: '#/components/responses/ChatRefusal'
'405':
$ref: '#/components/responses/RequestError'
'409':
$ref: '#/components/responses/ChatRefusal'
'412':
$ref: '#/components/responses/ChatRefusal'
'413':
$ref: '#/components/responses/ChatRefusal'
'415':
$ref: '#/components/responses/ChatRefusal'
'429':
$ref: '#/components/responses/ChatRefusal'
'500':
$ref: '#/components/responses/ChatServerError'
'501':
$ref: '#/components/responses/ChatRefusal'
'503':
$ref: '#/components/responses/Unavailable'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ChatOpen'
description: UTF-8 JSON; maximum 65536 bytes. An Authorization header does not replace the JSON proof.
tags:
- Chat Session
servers:
- url: https://auth.example.invalid
description: Replace with the configured HTTPS public authority URL; TLS terminates at the operator proxy.
/chat-session/bearer:
post:
operationId: auth-chat-session-bearer
summary: Mint a short chat bearer
description: Fresh JSON IdP proof derives owner. Body is closed; unknown or missing fields are 400 before proof verification. Requires holderProof; bearer expires at the least of 900 seconds, IdP proof expiry and session expiry. Origin is refused. Effect failures preserve native code and outcome; missing native outcome means unknown. Retain the same holder on an uncertain retry. Credential verification and native dispatch failures share the public peer refusal budget.
security: []
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/Bearer'
'400':
$ref: '#/components/responses/ChatRefusal'
'401':
$ref: '#/components/responses/ChatRefusal'
'403':
$ref: '#/components/responses/ChatRefusal'
'404':
$ref: '#/components/responses/ChatRefusal'
'405':
$ref: '#/components/responses/RequestError'
'409':
$ref: '#/components/responses/ChatRefusal'
'412':
$ref: '#/components/responses/ChatRefusal'
'413':
$ref: '#/components/responses/ChatRefusal'
'415':
$ref: '#/components/responses/ChatRefusal'
'429':
$ref: '#/components/responses/ChatRefusal'
'500':
$ref: '#/components/responses/ChatServerError'
'501':
$ref: '#/components/responses/ChatRefusal'
'503':
$ref: '#/components/responses/Unavailable'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ChatBearer'
description: UTF-8 JSON; maximum 65536 bytes. An Authorization header does not replace the JSON proof.
tags:
- Chat Session
servers:
- url: https://auth.example.invalid
description: Replace with the configured HTTPS public authority URL; TLS terminates at the operator proxy.
/chat-session/retire:
post:
operationId: auth-chat-session-retire
summary: Retire a chat session
description: Fresh JSON IdP proof derives owner. Body is closed; unknown or missing fields are 400 before proof verification. Requires holderProof and exact lifecycleUid. HTTP 200 may have outcome=failed with pending work; inspect outcome. Origin is refused. Effect failures preserve native code and outcome; missing native outcome means unknown. Retain the same holder on an uncertain retry. Credential verification and native dispatch failures share the public peer refusal budget.
security: []
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/ChatRetired'
'400':
$ref: '#/components/responses/ChatRefusal'
'401':
$ref: '#/components/responses/ChatRefusal'
'403':
$ref: '#/components/responses/ChatRefusal'
'404':
$ref: '#/components/responses/ChatRefusal'
'405':
$ref: '#/components/responses/RequestError'
'409':
$ref: '#/components/responses/ChatRefusal'
'412':
$ref: '#/components/responses/ChatRefusal'
'413':
$ref: '#/components/responses/ChatRefusal'
'415':
$ref: '#/components/responses/ChatRefusal'
'429':
$ref: '#/components/responses/ChatRefusal'
'500':
$ref: '#/components/responses/ChatServerError'
'501':
$ref: '#/components/responses/ChatRefusal'
'503':
$ref: '#/components/responses/Unavailable'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ChatRetire'
description: UTF-8 JSON; maximum 65536 bytes. An Authorization header does not replace the JSON proof.
tags:
- Chat Session
servers:
- url: https://auth.example.invalid
description: Replace with the configured HTTPS public authority URL; TLS terminates at the operator proxy.
components:
responses:
ChatServerError:
description: Native chat failure with its supplied code and outcome, or an unexpected handler failure with only {"error":"internal server error"}. Unexpected failure details are logged server-side.
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
example:
error: internal server error
RequestError:
description: JSON error from a named request refusal. Route guards run before proof evaluation; parser failures are 400 and byte overflow is 413.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
ChatRefusal:
description: Native refusal where code and outcome are supplied by the chat handler. Pre-dispatch method, Origin, media type and shape refusals are not-executed. Native outcome may be not-executed, executed or unknown. JSON parse/size errors and public admission/deadline errors have only error, without code or outcome.
content:
application/json:
schema:
$ref: '#/components/schemas/ChatError'
Unavailable:
description: Public admission cap (64 in flight), 10 second request deadline, or a route-specific unavailable read/effect. A service authority 503 may follow a binding; retain the request identity.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
UserAuthGrant:
type: object
description: Current issuer-authorized agent grant. Present for a human IdP exchange and absent for a managed-agent secret exchange.
properties:
scope:
type: array
items:
type: string
allowSubscribe:
type: array
items:
type: string
allowPublish:
type: array
items:
type: string
dmHistory:
const: own
required:
- scope
- allowSubscribe
- allowPublish
- dmHistory
additionalProperties: false
Error:
type: object
properties:
error:
type: string
code:
type: string
outcome:
type: string
enum:
- not-executed
- executed
- unknown
required:
- error
Bearer:
type: object
properties:
token:
type: string
minLength: 1
owner:
type: string
minLength: 1
exp:
type: integer
minimum: 0
grant:
$ref: '#/components/schemas/UserAuthGrant'
required:
- token
- owner
- exp
ChatBearer:
type: object
properties:
idpToken:
type: string
minLength: 1
actor:
type: string
holderProof:
type: string
required:
- idpToken
- actor
- holderProof
additionalProperties: false
ChatRetired:
type: object
properties:
outcome:
type: string
enum:
- retired
- alreadyRetired
- notStarted
- failed
pending:
type: string
required:
- outcome
ChatRetire:
type: object
properties:
idpToken:
type: string
minLength: 1
actor:
type: string
lifecycleUid:
type: string
holderProof:
type: string
required:
- idpToken
- actor
- lifecycleUid
- holderProof
additionalProperties: false
ChatError:
oneOf:
- type: object
required:
- error
properties:
error:
type: string
additionalProperties: false
- type: object
required:
- error
- code
- outcome
properties:
error:
type: string
code:
type: string
outcome:
type: string
enum:
- not-executed
- executed
- unknown
additionalProperties: false
ChatOpen:
type: object
properties:
idpToken:
type: string
minLength: 1
holderHash:
type: string
pattern: ^[0-9a-f]{64}$
read:
type: array
items:
type: string
maxItems: 64
post:
type: array
items:
type: string
maxItems: 64
ttlSec:
type: integer
minimum: 1
maximum: 28800
label:
type: string
minLength: 1
maxLength: 128
required:
- idpToken
- holderHash
- read
- post
- ttlSec
description: Lists contain at most 64 distinct concrete channel names and are narrowed to the current cli parent grant. holderHash is SHA-256 of a client-held proof. Reuse the holder identity on uncertain retries; opening never extends its fixed expiry.
additionalProperties: false
ChatAdmitted:
type: object
properties:
actor:
type: string
pattern: ^chat_[a-z2-7]{26}$
lifecycleUid:
type: string
minLength: 1
expiresAt:
type: integer
minimum: 0
required:
- actor
- lifecycleUid
- expiresAt
x-refined-from:
- cotal-ai-auth-openapi.json
- cotal-ai-auth-openapi.yml
x-source: implementations/auth/src/service.ts ROUTES and loopback handlers