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: Optimly Api Keys API
version: 0.1.0
tags:
- name: API Keys
paths:
/api/api-keys:
get:
summary: List Api Keys
description: 'The caller''s own keys, or the whole org''s for an admin.
Scoped by ownership for the same reason the connections list is: a key
belongs to whoever minted it, so a member sees theirs and an admin sees
every one — which is what keeps a key whose owner has left the company
findable and revocable at all.'
operationId: list_api_keys_api_api_keys_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties: true
type: object
title: Response List Api Keys Api Api Keys Get
tags:
- API Keys
post:
summary: Create Api Key
description: 'Any member. The raw key appears in this response **once** — the store
keeps only its SHA-256 hash, and it is attributed to whoever minted it.
**A body that names no brand gets an org-wide key**, which is the
MCP-improvements decision that a customer does one auth and can then ask
about any of their brands: the brand is named per request
(`X-Optimly-Brand` on the REST API, the `brand` tool argument on MCP). Brand
scope stays available and stays what an explicit `brand_id` means, so
`{"brand_id": …}` — every request the app has ever sent — still creates
exactly the key it always did; only a body with neither field, which used to
be a 400, is now a created org key.'
operationId: create_api_key_api_api_keys_post
requestBody:
content:
application/json:
schema:
additionalProperties: true
type: object
title: Payload
required: true
responses:
'201':
description: Successful Response
content:
application/json:
schema:
additionalProperties: true
type: object
title: Response Create Api Key Api Api Keys Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- API Keys
/api/api-keys/{key_id}:
delete:
summary: Revoke Api Key
description: 'Immediate revocation: `is_active=false`, `revoked_at=now`.
The key''s owner or an admin. Without the ownership check, opening minting to
members would have opened revocation with it — any member able to reach this
route could kill a production integration another team minted. 403 rather
than 404 for a colleague''s key: it is in their own org, so its existence is
not the secret, and 404 would read as "already revoked".'
operationId: revoke_api_key_api_api_keys__key_id__delete
parameters:
- name: key_id
in: path
required: true
schema:
type: string
format: uuid
title: Key Id
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- API Keys
components:
schemas:
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
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError