Coder Audit API
The Audit API from Coder — 2 operation(s) for audit.
The Audit API from Coder — 2 operation(s) for audit.
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/coder:coder-audit-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
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. 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:
description: Coderd is the service created by running coder server. It is a thin API that connects workspaces, provisioners and users. coderd stores its state in Postgres and is the only service that communicates with Postgres.
title: Coder Audit API
termsOfService: https://coder.com/legal/terms-of-service
contact:
name: API Support
url: https://coder.com
email: support@coder.com
license:
name: AGPL-3.0
url: https://github.com/coder/coder/blob/main/LICENSE
version: '2.0'
servers:
- url: /
tags:
- name: Audit
paths:
/api/v2/audit:
get:
tags:
- Audit
summary: Get audit logs
operationId: get-audit-logs
parameters:
- description: Search query
name: q
in: query
schema:
type: string
- description: Page limit
name: limit
in: query
required: true
schema:
type: integer
- description: Page offset
name: offset
in: query
schema:
type: integer
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.AuditLogResponse'
security:
- CoderSessionToken: []
/api/v2/audit/testgenerate:
post:
tags:
- Audit
summary: Generate fake audit log
operationId: generate-fake-audit-log
responses:
'204':
description: No Content
security:
- CoderSessionToken: []
x-apidocgen:
skip: true
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.CreateTestAuditLogRequest'
description: Audit log request
required: true
components:
schemas:
codersdk.ResourceType:
type: string
enum:
- template
- template_version
- user
- workspace
- workspace_build
- git_ssh_key
- api_key
- group
- license
- convert_login
- health_settings
- notifications_settings
- prebuilds_settings
- oauth2_provider_settings
- workspace_proxy
- organization
- oauth2_provider_app
- oauth2_provider_app_secret
- custom_role
- organization_member
- notification_template
- idp_sync_settings_organization
- idp_sync_settings_group
- idp_sync_settings_role
- workspace_agent
- workspace_app
- task
- ai_seat
- ai_provider
- ai_provider_key
- ai_gateway_key
- group_ai_budget
- user_ai_budget_override
- chat
- chat_project
- chat_project_memory
- mcp_server_config
- chat_model_config
- chat_automation
- user_secret
- user_skill
- organization_skill
- chat_instruction_settings
- chat_operational_settings
- chat_organization_system_prompt
- chat_project_instructions
- chat_project_skill
- experiment_rule
x-enum-varnames:
- ResourceTypeTemplate
- ResourceTypeTemplateVersion
- ResourceTypeUser
- ResourceTypeWorkspace
- ResourceTypeWorkspaceBuild
- ResourceTypeGitSSHKey
- ResourceTypeAPIKey
- ResourceTypeGroup
- ResourceTypeLicense
- ResourceTypeConvertLogin
- ResourceTypeHealthSettings
- ResourceTypeNotificationsSettings
- ResourceTypePrebuildsSettings
- ResourceTypeOAuth2ProviderSettings
- ResourceTypeWorkspaceProxy
- ResourceTypeOrganization
- ResourceTypeOAuth2ProviderApp
- ResourceTypeOAuth2ProviderAppSecret
- ResourceTypeCustomRole
- ResourceTypeOrganizationMember
- ResourceTypeNotificationTemplate
- ResourceTypeIdpSyncSettingsOrganization
- ResourceTypeIdpSyncSettingsGroup
- ResourceTypeIdpSyncSettingsRole
- ResourceTypeWorkspaceAgent
- ResourceTypeWorkspaceApp
- ResourceTypeTask
- ResourceTypeAISeat
- ResourceTypeAIProvider
- ResourceTypeAIProviderKey
- ResourceTypeAIGatewayKey
- ResourceTypeGroupAIBudget
- ResourceTypeUserAIBudgetOverride
- ResourceTypeChat
- ResourceTypeChatProject
- ResourceTypeChatProjectMemory
- ResourceTypeMCPServerConfig
- ResourceTypeChatModelConfig
- ResourceTypeChatAutomation
- ResourceTypeUserSecret
- ResourceTypeUserSkill
- ResourceTypeOrganizationSkill
- ResourceTypeChatInstructionSettings
- ResourceTypeChatOperationalSettings
- ResourceTypeChatOrganizationSystemPrompt
- ResourceTypeChatProjectInstructions
- ResourceTypeChatProjectSkill
- ResourceTypeExperimentRule
codersdk.SlimRole:
type: object
properties:
display_name:
type: string
name:
type: string
organization_id:
type: string
codersdk.UserStatus:
type: string
enum:
- active
- dormant
- suspended
x-enum-varnames:
- UserStatusActive
- UserStatusDormant
- UserStatusSuspended
codersdk.User:
type: object
required:
- created_at
- email
- id
- username
properties:
avatar_url:
type: string
format: uri
created_at:
type: string
format: date-time
email:
type: string
format: email
has_ai_seat:
description: 'HasAISeat intentionally omits omitempty so the API always includes the
field, even when false.'
type: boolean
id:
type: string
format: uuid
is_service_account:
type: boolean
last_seen_at:
type: string
format: date-time
login_type:
$ref: '#/components/schemas/codersdk.LoginType'
name:
type: string
organization_ids:
type: array
items:
type: string
format: uuid
roles:
type: array
items:
$ref: '#/components/schemas/codersdk.SlimRole'
status:
enum:
- active
- suspended
allOf:
- $ref: '#/components/schemas/codersdk.UserStatus'
theme_preference:
description: 'Deprecated: this value should be retrieved from
`codersdk.UserPreferenceSettings` instead.'
type: string
updated_at:
type: string
format: date-time
username:
type: string
codersdk.AuditLogResponse:
type: object
properties:
audit_logs:
type: array
items:
$ref: '#/components/schemas/codersdk.AuditLog'
count:
type: integer
count_cap:
type: integer
codersdk.LoginType:
type: string
enum:
- ''
- password
- github
- oidc
- token
- none
x-enum-varnames:
- LoginTypeUnknown
- LoginTypePassword
- LoginTypeGithub
- LoginTypeOIDC
- LoginTypeToken
- LoginTypeNone
codersdk.CreateTestAuditLogRequest:
type: object
properties:
action:
enum:
- create
- write
- delete
- start
- stop
allOf:
- $ref: '#/components/schemas/codersdk.AuditAction'
additional_fields:
type: array
items:
type: integer
build_reason:
enum:
- autostart
- autostop
- initiator
allOf:
- $ref: '#/components/schemas/codersdk.BuildReason'
organization_id:
type: string
format: uuid
request_id:
type: string
format: uuid
resource_id:
type: string
format: uuid
resource_type:
enum:
- template
- template_version
- user
- workspace
- workspace_build
- git_ssh_key
- auditable_group
allOf:
- $ref: '#/components/schemas/codersdk.ResourceType'
time:
type: string
format: date-time
codersdk.BuildReason:
type: string
enum:
- initiator
- autostart
- autostop
- dormancy
- dashboard
- cli
- ssh_connection
- vscode_connection
- jetbrains_connection
x-enum-varnames:
- BuildReasonInitiator
- BuildReasonAutostart
- BuildReasonAutostop
- BuildReasonDormancy
- BuildReasonDashboard
- BuildReasonCLI
- BuildReasonSSHConnection
- BuildReasonVSCodeConnection
- BuildReasonJetbrainsConnection
codersdk.AuditDiff:
type: object
additionalProperties:
$ref: '#/components/schemas/codersdk.AuditDiffField'
codersdk.AuditLog:
type: object
properties:
action:
$ref: '#/components/schemas/codersdk.AuditAction'
additional_fields:
type: object
description:
type: string
diff:
$ref: '#/components/schemas/codersdk.AuditDiff'
id:
type: string
format: uuid
ip:
type: string
is_deleted:
type: boolean
organization:
$ref: '#/components/schemas/codersdk.MinimalOrganization'
organization_id:
description: 'Deprecated: Use ''organization.id'' instead.'
type: string
format: uuid
request_id:
type: string
format: uuid
resource_icon:
type: string
resource_id:
type: string
format: uuid
resource_link:
type: string
resource_target:
description: ResourceTarget is the name of the resource.
type: string
resource_type:
$ref: '#/components/schemas/codersdk.ResourceType'
status_code:
type: integer
time:
type: string
format: date-time
user:
$ref: '#/components/schemas/codersdk.User'
user_agent:
type: string
codersdk.AuditDiffField:
type: object
properties:
new: {}
old: {}
secret:
type: boolean
codersdk.AuditAction:
type: string
enum:
- create
- write
- delete
- start
- stop
- login
- logout
- register
- request_password_reset
- connect
- disconnect
- open
- close
x-enum-varnames:
- AuditActionCreate
- AuditActionWrite
- AuditActionDelete
- AuditActionStart
- AuditActionStop
- AuditActionLogin
- AuditActionLogout
- AuditActionRegister
- AuditActionRequestPasswordReset
- AuditActionConnect
- AuditActionDisconnect
- AuditActionOpen
- AuditActionClose
codersdk.MinimalOrganization:
type: object
required:
- id
properties:
display_name:
type: string
icon:
type: string
id:
type: string
format: uuid
name:
type: string
securitySchemes:
AIGatewayKey:
type: apiKey
name: X-AI-Governance-Gateway-Key
in: header
Authorization:
type: apiKey
name: Authorization
in: header
CoderSessionToken:
type: apiKey
name: Coder-Session-Token
in: header
x-provenance:
method: harvested
publisher: Coder
source: https://raw.githubusercontent.com/coder/coder/main/coderd/apidoc/swagger.json
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)