withHuman Audit API
The organization's append-only log of what happened and who did it, and the request timeline it tells.
The organization's append-only log of what happened and who did it, and the request timeline it tells.
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/withhuman-ai:withhuman-ai-audit-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: withHuman provider Audit API
version: 1.0.0
description: Agent Approval Protocol and reviewer product endpoints.
servers:
- url: /
tags:
- name: Audit
description: The organization's append-only log of what happened and who did it, and the request timeline it tells.
paths:
/api/v1/audit:
get:
summary: List audit events
description: 'Returns one page of the organization''s audit log, newest first by default. Every filter is optional and they combine.
Paging is by cursor. When more events follow, the response carries `next_cursor`. Pass it back as `cursor` with the same sort, order and filters to get the next page. The last page has no `next_cursor`. `total_count` is how many events match the filters across every page.'
operationId: listAuditEvents
x-withhuman-permission: audit.read
x-withhuman-credential-kinds:
- session
- personal_api_key
- organization_api_key
tags:
- Audit
security:
- cookieAuth: []
- apiKeyAuth: []
parameters:
- name: sort
in: query
description: What to sort by. Events with the same value are ordered newest first.
schema:
type: string
enum:
- occurred
- event_type
- actor
default: occurred
- name: order
in: query
description: '`desc` for newest first, `asc` for oldest first.'
schema:
type: string
enum:
- asc
- desc
default: desc
- name: cursor
in: query
description: The `next_cursor` from the previous page. Use the same sort, order and filters.
schema:
type: string
- $ref: '#/components/parameters/AuditQuery'
- $ref: '#/components/parameters/AuditEventType'
- $ref: '#/components/parameters/AuditActorType'
- $ref: '#/components/parameters/AuditActorID'
- $ref: '#/components/parameters/AuditSubjectType'
- $ref: '#/components/parameters/AuditSubjectID'
- $ref: '#/components/parameters/AuditOutcome'
- $ref: '#/components/parameters/AuditFromAt'
- $ref: '#/components/parameters/AuditToAt'
- name: limit
in: query
description: How many events to return. Defaults to 100.
schema:
type: integer
minimum: 1
maximum: 500
responses:
'200':
description: One page of events
content:
application/json:
schema:
type: object
required:
- events
- total_count
properties:
events:
type: array
description: The events on this page.
items:
$ref: '#/components/schemas/AuditEvent'
next_cursor:
type: string
description: Present when another page follows.
total_count:
type: integer
format: int64
description: How many events match the filters, across every page.
'400':
$ref: '#/components/responses/Error'
description: A filter is malformed, or `subject_id` was given without `subject_type`
'401':
$ref: '#/components/responses/Error'
description: You are not signed in
'403':
$ref: '#/components/responses/Error'
description: You cannot read the audit log
x-withhuman-edition: hosted
/api/v1/audit/stream:
get:
summary: Stream new audit events
description: 'Server-sent events carrying the organization''s audit events as they are recorded. Takes the same filters as the listing.
Each `audit` event''s data is `{"events": [...]}`, oldest first, and its `id` is the highest `sequence` sent so far. A comment line keeps the connection open while nothing new arrives. Pass the `sequence` of the newest event you already have as `after_sequence`; a reconnecting client''s `Last-Event-ID` header resumes from its last frame.'
operationId: streamAuditEvents
x-withhuman-permission: audit.read
x-withhuman-credential-kinds:
- session
- personal_api_key
- organization_api_key
tags:
- Audit
security:
- cookieAuth: []
- apiKeyAuth: []
parameters:
- name: after_sequence
in: query
description: Only events recorded after the event with this `sequence`. Leave it out to receive every matching event from the start of the log.
schema:
type: integer
format: int64
minimum: 0
- $ref: '#/components/parameters/AuditQuery'
- $ref: '#/components/parameters/AuditEventType'
- $ref: '#/components/parameters/AuditActorType'
- $ref: '#/components/parameters/AuditActorID'
- $ref: '#/components/parameters/AuditSubjectType'
- $ref: '#/components/parameters/AuditSubjectID'
- $ref: '#/components/parameters/AuditOutcome'
- $ref: '#/components/parameters/AuditFromAt'
- $ref: '#/components/parameters/AuditToAt'
- name: Last-Event-ID
in: header
description: Sent by a reconnecting client. Resumes after this `sequence` when it is later than `after_sequence`.
schema:
type: string
responses:
'200':
description: Event stream
content:
text/event-stream:
schema:
type: string
'400':
$ref: '#/components/responses/Error'
description: A filter or `after_sequence` is malformed
'401':
$ref: '#/components/responses/Error'
description: You are not signed in
'403':
$ref: '#/components/responses/Error'
description: You cannot read the audit log
x-withhuman-edition: hosted
/api/v1/audit/{id}:
get:
summary: Retrieve an audit event
description: One entry of the organization's audit log by id, the record behind a deep link. An id from another organization is reported as not found.
operationId: getAuditEvent
x-withhuman-permission: audit.read
x-withhuman-credential-kinds:
- session
- personal_api_key
- organization_api_key
tags:
- Audit
security:
- cookieAuth: []
- apiKeyAuth: []
parameters:
- $ref: '#/components/parameters/AuditEventID'
responses:
'200':
description: The event
content:
application/json:
schema:
$ref: '#/components/schemas/AuditEvent'
'400':
$ref: '#/components/responses/Error'
description: The id is not a UUID
'401':
$ref: '#/components/responses/Error'
description: You are not signed in
'403':
$ref: '#/components/responses/Error'
description: You cannot read the audit log
'404':
$ref: '#/components/responses/Error'
description: No such event in this organization
x-withhuman-edition: hosted
/api/v1/audit/event_types:
get:
summary: List the event types this organization has recorded
description: The vocabulary for the audit log's event filter, sorted. Unlike a fixed list it can never name a type that does not occur.
operationId: listAuditEventTypes
x-withhuman-permission: audit.read
x-withhuman-credential-kinds:
- session
- personal_api_key
- organization_api_key
tags:
- Audit
security:
- cookieAuth: []
- apiKeyAuth: []
responses:
'200':
description: Distinct event types
content:
application/json:
schema:
type: object
required:
- event_types
properties:
event_types:
type: array
items:
type: string
'401':
$ref: '#/components/responses/Error'
'403':
$ref: '#/components/responses/Error'
x-withhuman-edition: hosted
components:
parameters:
AuditSubjectID:
name: subject_id
in: query
description: Only events about one subject. Requires `subject_type`. An agent subject is given by its slug; every other subject by its id.
schema:
type: string
AuditSubjectType:
name: subject_type
in: query
description: Only events about this kind of thing, such as a request or a membership.
schema:
type: string
AuditOutcome:
name: outcome
in: query
description: Only events whose action ended this way. Resolved from the event's data, so you do not need to know its shape.
schema:
type: string
enum:
- approved
- denied
- expired
- cancelled
- human
- blocked
AuditActorType:
name: actor_type
in: query
description: Only events by this kind of actor.
schema:
type: string
enum:
- human
- agent
- system
- api_key
AuditEventType:
name: event_type
in: query
description: Only events of these types. Repeat the parameter to pass several.
schema:
type: array
items:
type: string
style: form
explode: true
AuditEventID:
name: id
in: path
required: true
description: The audit event's id.
schema:
type: string
format: uuid
AuditQuery:
name: q
in: query
description: Free text. Matches the event type, the actor's name and id, the subject id, the event id, and the event's data. Case does not matter.
schema:
type: string
AuditToAt:
name: to_at
in: query
description: Only events before this time.
schema:
type: string
format: date-time
AuditActorID:
name: actor_id
in: query
description: Only events by one actor. A membership id also matches events recorded under its user id, and the other way round. An agent is given by its slug.
schema:
type: string
AuditFromAt:
name: from_at
in: query
description: Only events at or after this time.
schema:
type: string
format: date-time
responses:
Error:
description: Error response. A 403 from a permission check carries ForbiddenDetails in error.details.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
schemas:
ForbiddenDetails:
description: The details on a 403 from a permission check. They name the permission that was needed and the thing it was checked against.
type: object
additionalProperties: false
required:
- permission
- resource_kind
properties:
permission:
type: string
description: The permission you needed.
example: request.decide
resource_kind:
type: string
enum:
- organization
- team
- agent
- pipeline
- request
description: What kind of thing the check was about.
resource_id:
type: string
description: The team, agent slug, pipeline key, or request the check was about. Absent for the organization.
ErrorResponse:
type: object
additionalProperties: false
required:
- error
properties:
error:
type: object
additionalProperties: false
required:
- type
- code
- message
- request_id
properties:
type:
type: string
enum:
- invalid_request
- authentication
- authorization
- not_found
- conflict
- rate_limit
- dependency
- internal
code:
type: string
message:
type: string
param:
type: string
request_id:
type: string
details:
description: Structured detail for codes that carry one. quota_exceeded carries QuotaExceededDetails; a forbidden error from a permission check carries ForbiddenDetails; a decision the routing rule refused carries RoutingRejectionDetails.
anyOf:
- $ref: '#/components/schemas/QuotaExceededDetails'
- $ref: '#/components/schemas/ForbiddenDetails'
- $ref: '#/components/schemas/RoutingRejectionDetails'
- type: object
RoutingRejectionDetails:
description: The details object on a forbidden error raised by the routing rule at decision time. not_targeted means the request was routed to other people; break_glass_only means the organization sends unrouted requests to holders of request.decide.unrouted; outside_routing_required means the reviewer holds break glass but did not send outside_routing.
type: object
additionalProperties: false
required:
- reason
properties:
reason:
type: string
enum:
- not_targeted
- break_glass_only
- outside_routing_required
QuotaExceededDetails:
description: The details object on a quota_exceeded error, so a client can offer the purchase that resolves it.
type: object
additionalProperties: false
required:
- dimension
- limit
- used
properties:
dimension:
type: string
description: The plan dimension that is full, such as seats or agents.
limit:
type: integer
format: int64
minimum: 0
used:
type: integer
format: int64
minimum: 0
AuditEvent:
type: object
description: One entry in the audit log. Entries are never changed or deleted.
required:
- sequence
- id
- organization_id
- event_type
- actor_type
- subject_type
- subject_id
- data
- occurred_at
properties:
sequence:
type: integer
format: int64
description: The event's position in the organization's log. Later events have higher numbers.
id:
type: string
format: uuid
organization_id:
type: string
format: uuid
event_type:
type: string
description: What happened, as a dotted key such as `membership.suspended`.
actor_type:
type: string
description: 'Who did it: `human`, `agent`, `system`, or `api_key`.'
actor_id:
type: string
format: uuid
description: The person, agent, or key that acted. Absent for `system`.
actor_display_name:
type: string
description: The actor's name at the time.
subject_type:
type: string
description: What kind of thing the event is about, such as a request or a membership.
subject_id:
type: string
format: uuid
description: The thing the event is about.
data:
description: Details specific to the event type, as JSON.
occurred_at:
type: string
format: date-time
description: When it happened.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
cookieAuth:
type: apiKey
in: cookie
name: withhuman_session
apiKeyAuth:
type: http
scheme: bearer
bearerFormat: whk_ / who_
description: 'A personal whk_ or organization who_ API key sent as Authorization: Bearer <token>. Personal keys act as their member with live, optionally narrowed access. Organization keys act as themselves with live RBAC permission policies. The x-withhuman-credential-kinds extension lists the kinds supported by each operation. Revocation, expiry, organization status, and the policy switch for that key kind are checked on every request.'