Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API 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.
openapi: 3.2.0
info:
title: Krobar AI Policies API
description: '# API Krobar AI
Welcome to the Krobar AI API! A FastAPI-based service that is the backend for Krobar.ai
## Authentication
**IMPORTANT**: This API requires an API key for all endpoints except for /health. The API key must be provided in the `X-API-Key` header.
```bash
curl -H "X-API-Key: your-api-key" https://api.krobar.ai/endpoint
```'
contact:
name: API Support
email: tristan@kromatic.com
version: 1.0.0
tags:
- name: Policies
paths:
/policies:
get:
tags:
- Policies
summary: List all policies
description: Retrieve all policy records. Policies are immutable and cannot be updated or deleted.
operationId: list_policies_policies_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items:
$ref: '#/components/schemas/PolicySchema'
type: array
title: Response List Policies Policies Get
post:
tags:
- Policies
summary: Create a new policy
description: Create a new policy. The current authenticated user is always used as the creator. You cannot specify a user.
operationId: create_policy_policies_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PolicyCreate'
required: true
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PolicySchema'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- APIKeyCookie: []
/policies/{policy_id}:
get:
tags:
- Policies
summary: Get a policy by ID
description: Retrieve a single policy by its ID. Policies are immutable and cannot be updated or deleted.
operationId: get_policy_policies__policy_id__get
parameters:
- name: policy_id
in: path
required: true
schema:
type: string
format: uuid
title: Policy Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PolicySchema'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
PolicyCreate:
properties:
policy_type:
type: string
title: Policy Type
text:
type: string
title: Text
type: object
required:
- policy_type
- text
title: PolicyCreate
description: Schema for creating a Policy. Version and hash are auto-generated.
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
PolicySchema:
properties:
id:
type: string
format: uuid
title: Id
policy_type:
type: string
title: Policy Type
version:
type: integer
title: Version
hash:
type: string
title: Hash
text:
type: string
title: Text
created_at:
type: string
format: date-time
title: Created At
created_by:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Created By
type: object
required:
- id
- policy_type
- version
- hash
- text
- created_at
title: PolicySchema
description: 'Schema for Policy response.
version is now an integer (was string before migration).
hash is text.'
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
securitySchemes:
APIKeyCookie:
type: apiKey
in: cookie
name: access_token
APIKeyHeader:
type: apiKey
in: header
name: X-API-Key