|
openapi: 3.0.0 |
|
info: |
|
title: Incident Management API |
|
version: 1.0.0 |
|
description: | |
|
API for managing organizational incidents including failures, critical events, and security events. |
|
|
|
## Rate Limiting |
|
- 200 requests per minute per client |
|
- Rate limit headers included in responses |
|
|
|
## Performance |
|
- P95 response time: < 200ms |
|
contact: |
|
name: API Support |
|
email: [email protected] |
|
|
|
servers: |
|
- url: https://api.example.com/v1 |
|
description: Production server |
|
- url: https://staging-api.example.com/v1 |
|
description: Staging server |
|
|
|
security: |
|
- ApiKeyAuth: [] |
|
- OAuth2: [read, write] |
|
|
|
paths: |
|
/incidents: |
|
post: |
|
summary: Create new incident |
|
description: Creates a new incident record in the system |
|
operationId: createIncident |
|
tags: |
|
- Incidents |
|
security: |
|
- ApiKeyAuth: [] |
|
- OAuth2: [write] |
|
requestBody: |
|
required: true |
|
content: |
|
application/json: |
|
schema: |
|
type: object |
|
required: |
|
- title |
|
- severity |
|
- occurredAt |
|
properties: |
|
title: |
|
type: string |
|
description: Brief title of the incident |
|
minLength: 1 |
|
maxLength: 200 |
|
example: "Database connection timeout in production" |
|
description: |
|
type: string |
|
description: Detailed description of the incident |
|
maxLength: 5000 |
|
example: "Multiple users reported timeout errors when accessing the dashboard. Database connection pool exhausted." |
|
severity: |
|
type: string |
|
enum: [critical, high, medium, low] |
|
description: Severity level of the incident |
|
example: "high" |
|
occurredAt: |
|
type: string |
|
format: date-time |
|
description: Timestamp when the incident occurred |
|
example: "2024-01-15T14:30:00Z" |
|
service: |
|
type: string |
|
description: Service or component affected |
|
maxLength: 100 |
|
example: "user-service" |
|
tags: |
|
type: array |
|
description: Tags for categorization |
|
items: |
|
type: string |
|
example: ["database", "timeout", "production"] |
|
status: |
|
type: string |
|
enum: [open, investigating, resolved, closed] |
|
description: Current status of the incident |
|
default: open |
|
example: "open" |
|
responses: |
|
'201': |
|
description: Incident created successfully |
|
headers: |
|
X-RateLimit-Limit: |
|
schema: |
|
type: integer |
|
description: Request limit per minute |
|
X-RateLimit-Remaining: |
|
schema: |
|
type: integer |
|
description: Remaining requests in current window |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Incident' |
|
example: |
|
id: "inc_1a2b3c4d5e6f" |
|
title: "Database connection timeout in production" |
|
description: "Multiple users reported timeout errors when accessing the dashboard. Database connection pool exhausted." |
|
severity: "high" |
|
status: "open" |
|
service: "user-service" |
|
tags: ["database", "timeout", "production"] |
|
occurredAt: "2024-01-15T14:30:00Z" |
|
resolvedAt: null |
|
createdAt: "2024-01-15T14:35:00Z" |
|
updatedAt: "2024-01-15T14:35:00Z" |
|
createdBy: "user_123" |
|
updatedBy: "user_123" |
|
isDeleted: false |
|
'400': |
|
description: Validation error |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
example: |
|
error: "ValidationError" |
|
message: "Invalid request body" |
|
details: |
|
- field: "severity" |
|
message: "severity must be one of: critical, high, medium, low" |
|
'401': |
|
description: Unauthorized |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
example: |
|
error: "Unauthorized" |
|
message: "Invalid or missing API key" |
|
'429': |
|
description: Rate limit exceeded |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
example: |
|
error: "RateLimitExceeded" |
|
message: "Rate limit of 200 requests per minute exceeded" |
|
|
|
get: |
|
summary: Search and list incidents |
|
description: Retrieve a paginated list of incidents with optional filtering and sorting |
|
operationId: listIncidents |
|
tags: |
|
- Incidents |
|
security: |
|
- ApiKeyAuth: [] |
|
- OAuth2: [read] |
|
parameters: |
|
- name: status |
|
in: query |
|
description: Filter by incident status |
|
schema: |
|
type: string |
|
enum: [open, investigating, resolved, closed] |
|
example: "open" |
|
- name: severity |
|
in: query |
|
description: Filter by severity level |
|
schema: |
|
type: string |
|
enum: [critical, high, medium, low] |
|
example: "high" |
|
- name: service |
|
in: query |
|
description: Filter by service name |
|
schema: |
|
type: string |
|
example: "user-service" |
|
- name: keyword |
|
in: query |
|
description: Search keyword in title and description |
|
schema: |
|
type: string |
|
example: "database" |
|
- name: fromOccurredAt |
|
in: query |
|
description: Filter incidents that occurred after this timestamp |
|
schema: |
|
type: string |
|
format: date-time |
|
example: "2024-01-01T00:00:00Z" |
|
- name: toOccurredAt |
|
in: query |
|
description: Filter incidents that occurred before this timestamp |
|
schema: |
|
type: string |
|
format: date-time |
|
example: "2024-01-31T23:59:59Z" |
|
- name: limit |
|
in: query |
|
description: Maximum number of results to return |
|
schema: |
|
type: integer |
|
minimum: 1 |
|
maximum: 100 |
|
default: 20 |
|
example: 20 |
|
- name: offset |
|
in: query |
|
description: Number of results to skip for pagination |
|
schema: |
|
type: integer |
|
minimum: 0 |
|
default: 0 |
|
example: 0 |
|
- name: sort |
|
in: query |
|
description: Sort order (field:direction) |
|
schema: |
|
type: string |
|
default: "occurredAt:desc" |
|
example: "occurredAt:desc" |
|
responses: |
|
'200': |
|
description: List of incidents retrieved successfully |
|
headers: |
|
X-RateLimit-Limit: |
|
schema: |
|
type: integer |
|
description: Request limit per minute |
|
X-RateLimit-Remaining: |
|
schema: |
|
type: integer |
|
description: Remaining requests in current window |
|
content: |
|
application/json: |
|
schema: |
|
type: object |
|
properties: |
|
data: |
|
type: array |
|
items: |
|
$ref: '#/components/schemas/Incident' |
|
pagination: |
|
$ref: '#/components/schemas/Pagination' |
|
example: |
|
data: |
|
- id: "inc_1a2b3c4d5e6f" |
|
title: "Database connection timeout in production" |
|
description: "Multiple users reported timeout errors" |
|
severity: "high" |
|
status: "investigating" |
|
service: "user-service" |
|
tags: ["database", "timeout", "production"] |
|
occurredAt: "2024-01-15T14:30:00Z" |
|
resolvedAt: null |
|
createdAt: "2024-01-15T14:35:00Z" |
|
updatedAt: "2024-01-15T15:00:00Z" |
|
createdBy: "user_123" |
|
updatedBy: "user_456" |
|
isDeleted: false |
|
- id: "inc_2b3c4d5e6f7g" |
|
title: "API gateway returning 503 errors" |
|
description: "Gateway health check failing" |
|
severity: "critical" |
|
status: "open" |
|
service: "api-gateway" |
|
tags: ["gateway", "503", "production"] |
|
occurredAt: "2024-01-15T13:00:00Z" |
|
resolvedAt: null |
|
createdAt: "2024-01-15T13:05:00Z" |
|
updatedAt: "2024-01-15T13:05:00Z" |
|
createdBy: "user_789" |
|
updatedBy: "user_789" |
|
isDeleted: false |
|
pagination: |
|
totalCount: 45 |
|
limit: 20 |
|
offset: 0 |
|
hasMore: true |
|
'400': |
|
description: Invalid query parameters |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
example: |
|
error: "ValidationError" |
|
message: "Invalid query parameters" |
|
details: |
|
- field: "limit" |
|
message: "limit must be between 1 and 100" |
|
'401': |
|
description: Unauthorized |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
'429': |
|
description: Rate limit exceeded |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
|
|
/incidents/{id}: |
|
get: |
|
summary: Get incident details |
|
description: Retrieve detailed information about a specific incident |
|
operationId: getIncident |
|
tags: |
|
- Incidents |
|
security: |
|
- ApiKeyAuth: [] |
|
- OAuth2: [read] |
|
parameters: |
|
- name: id |
|
in: path |
|
required: true |
|
description: Unique identifier of the incident |
|
schema: |
|
type: string |
|
example: "inc_1a2b3c4d5e6f" |
|
responses: |
|
'200': |
|
description: Incident details retrieved successfully |
|
headers: |
|
X-RateLimit-Limit: |
|
schema: |
|
type: integer |
|
description: Request limit per minute |
|
X-RateLimit-Remaining: |
|
schema: |
|
type: integer |
|
description: Remaining requests in current window |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Incident' |
|
example: |
|
id: "inc_1a2b3c4d5e6f" |
|
title: "Database connection timeout in production" |
|
description: "Multiple users reported timeout errors when accessing the dashboard. Database connection pool exhausted." |
|
severity: "high" |
|
status: "resolved" |
|
service: "user-service" |
|
tags: ["database", "timeout", "production"] |
|
occurredAt: "2024-01-15T14:30:00Z" |
|
resolvedAt: "2024-01-15T16:45:00Z" |
|
createdAt: "2024-01-15T14:35:00Z" |
|
updatedAt: "2024-01-15T16:45:00Z" |
|
createdBy: "user_123" |
|
updatedBy: "user_456" |
|
isDeleted: false |
|
'404': |
|
description: Incident not found |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
example: |
|
error: "NotFound" |
|
message: "Incident with id 'inc_1a2b3c4d5e6f' not found" |
|
'401': |
|
description: Unauthorized |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
'429': |
|
description: Rate limit exceeded |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
|
|
patch: |
|
summary: Update incident |
|
description: Partially update an existing incident |
|
operationId: updateIncident |
|
tags: |
|
- Incidents |
|
security: |
|
- ApiKeyAuth: [] |
|
- OAuth2: [write] |
|
parameters: |
|
- name: id |
|
in: path |
|
required: true |
|
description: Unique identifier of the incident |
|
schema: |
|
type: string |
|
example: "inc_1a2b3c4d5e6f" |
|
requestBody: |
|
required: true |
|
content: |
|
application/json: |
|
schema: |
|
type: object |
|
properties: |
|
title: |
|
type: string |
|
minLength: 1 |
|
maxLength: 200 |
|
description: |
|
type: string |
|
maxLength: 5000 |
|
severity: |
|
type: string |
|
enum: [critical, high, medium, low] |
|
status: |
|
type: string |
|
enum: [open, investigating, resolved, closed] |
|
service: |
|
type: string |
|
maxLength: 100 |
|
tags: |
|
type: array |
|
items: |
|
type: string |
|
occurredAt: |
|
type: string |
|
format: date-time |
|
resolvedAt: |
|
type: string |
|
format: date-time |
|
nullable: true |
|
example: |
|
status: "resolved" |
|
resolvedAt: "2024-01-15T16:45:00Z" |
|
description: "Issue resolved by increasing database connection pool size from 50 to 100." |
|
responses: |
|
'200': |
|
description: Incident updated successfully |
|
headers: |
|
X-RateLimit-Limit: |
|
schema: |
|
type: integer |
|
description: Request limit per minute |
|
X-RateLimit-Remaining: |
|
schema: |
|
type: integer |
|
description: Remaining requests in current window |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Incident' |
|
example: |
|
id: "inc_1a2b3c4d5e6f" |
|
title: "Database connection timeout in production" |
|
description: "Issue resolved by increasing database connection pool size from 50 to 100." |
|
severity: "high" |
|
status: "resolved" |
|
service: "user-service" |
|
tags: ["database", "timeout", "production"] |
|
occurredAt: "2024-01-15T14:30:00Z" |
|
resolvedAt: "2024-01-15T16:45:00Z" |
|
createdAt: "2024-01-15T14:35:00Z" |
|
updatedAt: "2024-01-15T16:45:00Z" |
|
createdBy: "user_123" |
|
updatedBy: "user_456" |
|
isDeleted: false |
|
'400': |
|
description: Validation error |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
example: |
|
error: "ValidationError" |
|
message: "Invalid request body" |
|
details: |
|
- field: "status" |
|
message: "status must be one of: open, investigating, resolved, closed" |
|
'404': |
|
description: Incident not found |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
example: |
|
error: "NotFound" |
|
message: "Incident with id 'inc_1a2b3c4d5e6f' not found" |
|
'401': |
|
description: Unauthorized |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
'429': |
|
description: Rate limit exceeded |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
|
|
delete: |
|
summary: Delete incident |
|
description: Perform a logical delete of an incident (sets isDeleted flag) |
|
operationId: deleteIncident |
|
tags: |
|
- Incidents |
|
security: |
|
- ApiKeyAuth: [] |
|
- OAuth2: [write] |
|
parameters: |
|
- name: id |
|
in: path |
|
required: true |
|
description: Unique identifier of the incident |
|
schema: |
|
type: string |
|
example: "inc_1a2b3c4d5e6f" |
|
responses: |
|
'204': |
|
description: Incident deleted successfully |
|
headers: |
|
X-RateLimit-Limit: |
|
schema: |
|
type: integer |
|
description: Request limit per minute |
|
X-RateLimit-Remaining: |
|
schema: |
|
type: integer |
|
description: Remaining requests in current window |
|
'404': |
|
description: Incident not found |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
example: |
|
error: "NotFound" |
|
message: "Incident with id 'inc_1a2b3c4d5e6f' not found" |
|
'401': |
|
description: Unauthorized |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
'429': |
|
description: Rate limit exceeded |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/Error' |
|
|
|
components: |
|
securitySchemes: |
|
ApiKeyAuth: |
|
type: apiKey |
|
in: header |
|
name: X-API-Key |
|
description: API key for authentication |
|
OAuth2: |
|
type: oauth2 |
|
flows: |
|
authorizationCode: |
|
authorizationUrl: https://auth.example.com/oauth/authorize |
|
tokenUrl: https://auth.example.com/oauth/token |
|
scopes: |
|
read: Read access to incidents |
|
write: Write access to incidents |
|
|
|
schemas: |
|
Incident: |
|
type: object |
|
required: |
|
- id |
|
- title |
|
- severity |
|
- status |
|
- occurredAt |
|
- createdAt |
|
- updatedAt |
|
- createdBy |
|
- updatedBy |
|
- isDeleted |
|
properties: |
|
id: |
|
type: string |
|
description: Unique identifier for the incident |
|
example: "inc_1a2b3c4d5e6f" |
|
title: |
|
type: string |
|
description: Brief title of the incident |
|
minLength: 1 |
|
maxLength: 200 |
|
example: "Database connection timeout in production" |
|
description: |
|
type: string |
|
description: Detailed description of the incident |
|
maxLength: 5000 |
|
nullable: true |
|
example: "Multiple users reported timeout errors when accessing the dashboard." |
|
severity: |
|
type: string |
|
enum: [critical, high, medium, low] |
|
description: Severity level of the incident |
|
example: "high" |
|
status: |
|
type: string |
|
enum: [open, investigating, resolved, closed] |
|
description: Current status of the incident |
|
example: "open" |
|
service: |
|
type: string |
|
description: Service or component affected |
|
maxLength: 100 |
|
nullable: true |
|
example: "user-service" |
|
tags: |
|
type: array |
|
description: Tags for categorization |
|
items: |
|
type: string |
|
example: ["database", "timeout", "production"] |
|
occurredAt: |
|
type: string |
|
format: date-time |
|
description: Timestamp when the incident occurred |
|
example: "2024-01-15T14:30:00Z" |
|
resolvedAt: |
|
type: string |
|
format: date-time |
|
description: Timestamp when the incident was resolved |
|
nullable: true |
|
example: "2024-01-15T16:45:00Z" |
|
createdAt: |
|
type: string |
|
format: date-time |
|
description: Timestamp when the incident record was created |
|
example: "2024-01-15T14:35:00Z" |
|
updatedAt: |
|
type: string |
|
format: date-time |
|
description: Timestamp when the incident record was last updated |
|
example: "2024-01-15T16:45:00Z" |
|
createdBy: |
|
type: string |
|
description: User ID who created the incident record |
|
example: "user_123" |
|
updatedBy: |
|
type: string |
|
description: User ID who last updated the incident record |
|
example: "user_456" |
|
isDeleted: |
|
type: boolean |
|
description: Flag indicating if the incident is logically deleted |
|
default: false |
|
example: false |
|
|
|
Error: |
|
type: object |
|
required: |
|
- error |
|
- message |
|
properties: |
|
error: |
|
type: string |
|
description: Error type or code |
|
example: "ValidationError" |
|
message: |
|
type: string |
|
description: Human-readable error message |
|
example: "Invalid request body" |
|
details: |
|
type: array |
|
description: Additional error details |
|
items: |
|
type: object |
|
properties: |
|
field: |
|
type: string |
|
description: Field that caused the error |
|
message: |
|
type: string |
|
description: Specific error message for the field |
|
example: |
|
- field: "severity" |
|
message: "severity must be one of: critical, high, medium, low" |
|
|
|
Pagination: |
|
type: object |
|
required: |
|
- totalCount |
|
- limit |
|
- offset |
|
- hasMore |
|
properties: |
|
totalCount: |
|
type: integer |
|
description: Total number of items matching the query |
|
example: 45 |
|
limit: |
|
type: integer |
|
description: Maximum number of items returned |
|
example: 20 |
|
offset: |
|
type: integer |
|
description: Number of items skipped |
|
example: 0 |
|
hasMore: |
|
type: boolean |
|
description: Indicates if there are more items available |
|
example: true |
|
|
|
tags: |
|
- name: Incidents |
|
description: Operations for managing incidents |