Korey Identity API
Endpoints relating to the authenticated user and their organization.
Endpoints relating to the authenticated user and their organization.
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/korey-ai:korey-ai-identity-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: Korey Identity API
description: 'The Korey API is a REST API that lets you build integrations on top of
Korey threads and messages. All requests are made to:
```
https://api.korey.ai/api/v1
```
All endpoints require a Bearer token and return JSON. Get started by creating a personal access token at **Settings → API Tokens**. ## Authentication
All endpoints require a Bearer token passed in the `Authorization` header:
```
Authorization: Bearer kt_pat_
```
Create a personal access token at **Settings → API Tokens**. Each token
carries a set of scopes that gate access to specific endpoints. If a token
lacks the required scope for an endpoint, the response is `403 Forbidden`
with a `required_scope` field indicating what is needed. ## Pagination
List endpoints use **keyset pagination** based on item IDs. Each response
includes `first_id`, `last_id`, and `has_more`. To fetch the next page, pass `?after=` from the previous response. When `has_more` is `false` there are no further pages. The sort order used on the first request must be kept consistent across
all subsequent page requests. Changing `sort_by` or `sort_dir` mid-pagination
will produce unexpected results. Filters are also **not** carried between pages. If you paginate with filters
(e.g. `?owned=true`), pass the same filters on every request. Cursors do not expire — you can resume pagination at any time. ## Thread State Lifecycle
Every thread has a `state` field that indicates whether it is ready to accept
new messages or is currently processing a response. | State | Meaning |
|---|---|
| `ready` | The thread is idle and accepts new messages via `POST /threads/:id/messages` |
| `waiting` | A message has been queued and is awaiting the AI processor |
| `active` | The LLM is actively generating a response |
| `error` | Processing failed; inspect the response for details |
| `interrupted` | Generation was interrupted (e.g. by a conflicting message) |
**You may only send a new message when the thread is in `ready` state.**
Sending while `waiting` or `active` returns `409 Conflict`. The simplest way to know when a thread is `ready` again after sending a message
is to open the SSE stream (`GET /threads/:id/messages/:msg-id/response/stream`)
and wait for the `done` event — it is only emitted after the thread returns to
`ready`. Alternatively, poll `GET /threads/:id` and check the `state` field. ## Feedback
You can rate any AI response with a thumbs up or down via
`POST /threads/:id/messages/:msg-id/feedback`. Optionally include a short
free-text comment. One rating per user per message — submitting again
updates the previous rating. ## Conversational Continuity
Threads are persistent conversations. For multi-turn interactions, reuse the
same thread by sending subsequent messages to
`POST /threads/:thread-id/messages` rather than creating a new thread each
time. Store the `thread_id` from the initial response and pass it to all
follow-up messages. Every thread and message includes an `app_url` field — a direct link to that
item in the Korey web app, useful for surfacing context to users. Set a meaningful `name` when creating a thread. It appears in the Korey UI
and helps users identify the conversation later. ## Error State Recovery
A thread in `error` state is still readable — you can fetch its messages via
`GET /threads/:id/messages` — but it cannot receive new messages. There is
currently no way to resume or reset a thread in `error` state. To continue work after an error, create a new thread and seed it with a
summary of the previous conversation. A useful pattern:
1. Fetch the messages from the errored thread. 2. Summarize the relevant context (e.g. what was being worked on, what was
decided, where it left off). 3. Create a new thread with that summary as the initial message. ## File attachments
To include files in the first message, create a thread with `POST /threads`
without `text`. The response contains `thread_id` and `message_id: null`;
no AI response starts until you send a message.'
version: v1
servers:
- url: https://api.korey.ai/api/v1
description: Current environment
security:
- bearerAuth: []
tags:
- name: Identity
description: Endpoints relating to the authenticated user and their organization.
paths:
/me:
get:
summary: Get current user
description: Returns the authenticated user's identity and organization.
responses:
'401':
description: Unauthorized — Bearer token required or invalid
'403':
description: Forbidden — token does not have required scope
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
sub:
description: JWT subject — stable string ID for the user.
type: string
name:
description: Display name of the user.
oneOf:
- type: string
- type: 'null'
email:
description: Email address of the user.
oneOf:
- type: string
- type: 'null'
korey_user_id:
description: Internal numeric user ID.
type: integer
korey_organization_id:
description: Internal numeric organization ID.
type: integer
korey_organization_slug:
description: URL-safe organization slug.
type: string
role:
description: User role within the organization.
type: string
required:
- sub
- name
- email
- korey_user_id
- korey_organization_id
- korey_organization_slug
- role
additionalProperties: false
tags:
- Identity
security:
- bearerAuth: []
operationId: getMe
x-operation-id-source: derived
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Personal access token (`kt_pat_...`). Create one at Settings → API Tokens.