{"components":{"parameters":{"PageAfter":{"description":"Cursor for pagination - get items after this cursor","in":"query","name":"page[after]","schema":{"type":"string"}},"PageBefore":{"description":"Cursor for pagination - get items before this cursor","in":"query","name":"page[before]","schema":{"type":"string"}},"PageLimit":{"description":"Number of items per page","in":"query","name":"page[limit]","schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},"Tenant":{"description":"The tenant identifier (pre-configured as 'credoai')","in":"path","name":"tenant","required":true,"schema":{"type":"string"}}},"responses":{"BadRequest":{"content":{"application/json":{"schema":{"description":"Error response when the request is malformed or invalid","example":{"errors":[{"code":1004,"detail":"The request could not be understood or was missing required parameters","title":"Bad Request"}]},"properties":{"errors":{"items":{"properties":{"code":{"description":"Domain-specific error code. Ranges: 404 (not found), 1000-1999 (auth), 2000-2999 (validation), 9000-9999 (internal)","example":1004,"type":"integer"},"detail":{"description":"Detailed error message","example":"The request could not be understood or was missing required parameters","type":"string"},"title":{"description":"Short error title","example":"Bad Request","type":"string"}},"required":["code","title","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"BadRequestError","type":"object"}}},"description":"Bad request - malformed or invalid parameters"},"Forbidden":{"content":{"application/json":{"schema":{"description":"Error response when the user lacks permission to perform the action","example":{"errors":[{"code":1003,"detail":"You do not have permission to perform this action","title":"Forbidden"}]},"properties":{"errors":{"items":{"properties":{"code":{"description":"Domain-specific error code. Ranges: 404 (not found), 1000-1999 (auth), 2000-2999 (validation), 9000-9999 (internal)","example":1003,"type":"integer"},"detail":{"description":"Detailed error message","example":"You do not have permission to perform this action","type":"string"},"title":{"description":"Short error title","example":"Forbidden","type":"string"}},"required":["code","title","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"ForbiddenError","type":"object"}}},"description":"Permission denied - authenticated but lacking required permissions"},"NotFound":{"content":{"application/json":{"schema":{"description":"Error response when the requested resource does not exist","example":{"errors":[{"code":404,"detail":"not found","title":"Not found"}]},"properties":{"errors":{"items":{"properties":{"code":{"description":"Domain-specific error code. Ranges: 404 (not found), 1000-1999 (auth), 2000-2999 (validation), 9000-9999 (internal)","example":404,"type":"integer"},"detail":{"description":"Detailed error message","example":"not found","type":"string"},"title":{"description":"Short error title","example":"Not found","type":"string"}},"required":["code","title","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"ResourceNotFoundError","type":"object"}}},"description":"Resource not found"},"Unauthorized":{"content":{"application/json":{"schema":{"description":"Error response when authentication is required but missing or invalid","example":{"errors":[{"code":1100,"detail":"Authentication required","title":"Unauthorized"}]},"properties":{"errors":{"items":{"properties":{"code":{"description":"Domain-specific error code. Ranges: 404 (not found), 1000-1999 (auth), 2000-2999 (validation), 9000-9999 (internal)","example":1100,"type":"integer"},"detail":{"description":"Detailed error message","example":"Authentication required","type":"string"},"title":{"description":"Short error title","example":"Unauthorized","type":"string"}},"required":["code","title","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"UnauthorizedError","type":"object"}}},"description":"Authentication required - missing or invalid token"},"UnprocessableEntity":{"content":{"application/json":{"schema":{"description":"Error response when the request cannot be processed due to validation errors","example":{"errors":[{"code":2000,"detail":"unprocessable_entity","title":"Unprocessable entity"}]},"properties":{"errors":{"items":{"properties":{"code":{"description":"Domain-specific error code. Ranges: 404 (not found), 1000-1999 (auth), 2000-2999 (validation), 9000-9999 (internal)","example":2000,"type":"integer"},"detail":{"description":"Detailed error message","example":"unprocessable_entity","type":"string"},"title":{"description":"Short error title","example":"Unprocessable entity","type":"string"}},"required":["code","title","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"UnprocessableEntityError","type":"object"}}},"description":"Validation error"}},"schemas":{"AIEvent":{"description":"An AI event in the system","properties":{"attributes":{"description":"AI event attributes","properties":{"action":{"description":"Action that was performed","nullable":true,"type":"string"},"app_name":{"description":"Name of the application where the event occurred","nullable":true,"type":"string"},"category":{"description":"Category classification of the event","nullable":true,"type":"string"},"department":{"description":"Department of the user","nullable":true,"type":"string"},"device_hostname":{"description":"Hostname of the device where the event occurred","nullable":true,"type":"string"},"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"referrer_url":{"description":"Referrer URL for the event","nullable":true,"type":"string"},"risk_score":{"description":"Risk score for the event (0-100)","maximum":100,"minimum":0,"nullable":true,"type":"integer"},"timestamp":{"description":"Timestamp of the AI event","format":"date-time","type":"string"},"updated_at":{"description":"Last update timestamp","format":"date-time","type":"string"},"url":{"description":"URL associated with the event","nullable":true,"type":"string"},"user_email":{"description":"Email address of the user associated with the event","nullable":true,"type":"string"}},"required":["timestamp","inserted_at","updated_at"],"type":"object"},"id":{"description":"Unique identifier for the AI event","type":"string"},"type":{"description":"Resource type identifier","example":"ai_event","type":"string"}},"required":["id","type","attributes"],"title":"AIEvent","type":"object"},"AIEventBulkCreateRequest":{"description":"Request schema for creating multiple AI events in bulk. Accepts either JSONAPI format with a 'data' array or simple format with an 'events' array.","properties":{"data":{"description":"Array of AI event data objects in JSONAPI format. Each object should have 'attributes' containing the event data.","items":{"properties":{"attributes":{"properties":{"action":{"nullable":true,"type":"string"},"app_name":{"nullable":true,"type":"string"},"category":{"nullable":true,"type":"string"},"department":{"nullable":true,"type":"string"},"device_hostname":{"nullable":true,"type":"string"},"referrer_url":{"nullable":true,"type":"string"},"risk_score":{"maximum":100,"minimum":0,"nullable":true,"type":"integer"},"timestamp":{"description":"Timestamp of the AI event in ISO-8601 format","format":"date-time","type":"string"},"url":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["timestamp"],"type":"object"},"type":{"example":"ai_event","type":"string"}},"required":["type","attributes"],"type":"object"},"type":"array"},"events":{"description":"Array of AI event objects in simple format","items":{"properties":{"action":{"nullable":true,"type":"string"},"app_name":{"nullable":true,"type":"string"},"category":{"nullable":true,"type":"string"},"department":{"nullable":true,"type":"string"},"device_hostname":{"nullable":true,"type":"string"},"referrer_url":{"nullable":true,"type":"string"},"risk_score":{"maximum":100,"minimum":0,"nullable":true,"type":"integer"},"timestamp":{"description":"Timestamp of the AI event in ISO-8601 format","format":"date-time","type":"string"},"url":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["timestamp"],"type":"object"},"type":"array"}},"title":"AIEventBulkCreateRequest","type":"object"},"AIEventCreateRequest":{"description":"Request schema for creating an AI event","properties":{"data":{"description":"AI event data","properties":{"attributes":{"description":"AI event attributes","properties":{"action":{"description":"Action that was performed","nullable":true,"type":"string"},"app_name":{"description":"Name of the application where the event occurred","nullable":true,"type":"string"},"category":{"description":"Category classification of the event","nullable":true,"type":"string"},"department":{"description":"Department of the user","nullable":true,"type":"string"},"device_hostname":{"description":"Hostname of the device where the event occurred","nullable":true,"type":"string"},"referrer_url":{"description":"Referrer URL for the event","nullable":true,"type":"string"},"risk_score":{"description":"Risk score for the event (0-100)","maximum":100,"minimum":0,"nullable":true,"type":"integer"},"timestamp":{"description":"Timestamp of the AI event in ISO-8601 format","format":"date-time","type":"string"},"url":{"description":"URL associated with the event","nullable":true,"type":"string"},"user_email":{"description":"Email address of the user associated with the event","nullable":true,"type":"string"}},"required":["timestamp"],"type":"object"},"type":{"description":"The JSON-API resource type","example":"ai_event","type":"string"}},"required":["type","attributes"],"type":"object"}},"required":["data"],"title":"AIEventCreateRequest","type":"object"},"AIEventResponse":{"description":"Response containing a single AI event","properties":{"data":{"description":"An AI event in the system","properties":{"attributes":{"description":"AI event attributes","properties":{"action":{"description":"Action that was performed","nullable":true,"type":"string"},"app_name":{"description":"Name of the application where the event occurred","nullable":true,"type":"string"},"category":{"description":"Category classification of the event","nullable":true,"type":"string"},"department":{"description":"Department of the user","nullable":true,"type":"string"},"device_hostname":{"description":"Hostname of the device where the event occurred","nullable":true,"type":"string"},"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"referrer_url":{"description":"Referrer URL for the event","nullable":true,"type":"string"},"risk_score":{"description":"Risk score for the event (0-100)","maximum":100,"minimum":0,"nullable":true,"type":"integer"},"timestamp":{"description":"Timestamp of the AI event","format":"date-time","type":"string"},"updated_at":{"description":"Last update timestamp","format":"date-time","type":"string"},"url":{"description":"URL associated with the event","nullable":true,"type":"string"},"user_email":{"description":"Email address of the user associated with the event","nullable":true,"type":"string"}},"required":["timestamp","inserted_at","updated_at"],"type":"object"},"id":{"description":"Unique identifier for the AI event","type":"string"},"type":{"description":"Resource type identifier","example":"ai_event","type":"string"}},"required":["id","type","attributes"],"title":"AIEvent","type":"object"},"included":{"description":"Included related resources when the 'include' parameter is used","items":{"properties":{"attributes":{"description":"The JSON-API resource attributes","type":"object"},"id":{"description":"The JSON-API resource ID","type":"string"},"type":{"description":"The JSON-API resource type","type":"string"}},"type":"object"},"nullable":true,"type":"array"}},"required":["data"],"title":"AIEventResponse","type":"object"},"AIEventsResponse":{"description":"Response containing a collection of AI events","properties":{"data":{"description":"Array of AI event resources","items":{"description":"An AI event in the system","properties":{"attributes":{"description":"AI event attributes","properties":{"action":{"description":"Action that was performed","nullable":true,"type":"string"},"app_name":{"description":"Name of the application where the event occurred","nullable":true,"type":"string"},"category":{"description":"Category classification of the event","nullable":true,"type":"string"},"department":{"description":"Department of the user","nullable":true,"type":"string"},"device_hostname":{"description":"Hostname of the device where the event occurred","nullable":true,"type":"string"},"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"referrer_url":{"description":"Referrer URL for the event","nullable":true,"type":"string"},"risk_score":{"description":"Risk score for the event (0-100)","maximum":100,"minimum":0,"nullable":true,"type":"integer"},"timestamp":{"description":"Timestamp of the AI event","format":"date-time","type":"string"},"updated_at":{"description":"Last update timestamp","format":"date-time","type":"string"},"url":{"description":"URL associated with the event","nullable":true,"type":"string"},"user_email":{"description":"Email address of the user associated with the event","nullable":true,"type":"string"}},"required":["timestamp","inserted_at","updated_at"],"type":"object"},"id":{"description":"Unique identifier for the AI event","type":"string"},"type":{"description":"Resource type identifier","example":"ai_event","type":"string"}},"required":["id","type","attributes"],"title":"AIEvent","type":"object"},"type":"array"},"included":{"description":"Included related resources when the 'include' parameter is used","items":{"properties":{"attributes":{"description":"The JSON-API resource attributes","type":"object"},"id":{"description":"The JSON-API resource ID","type":"string"},"type":{"description":"The JSON-API resource type","type":"string"}},"type":"object"},"nullable":true,"type":"array"}},"required":["data"],"title":"AIEventsResponse","type":"object"},"AITool":{"description":"An AI tool in the system","properties":{"attributes":{"description":"AI tool attributes","properties":{"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"name":{"description":"Name of the AI tool","type":"string"},"updated_at":{"description":"Last update timestamp","format":"date-time","type":"string"},"use_case_id":{"description":"ID of the associated use case","nullable":true,"type":"string"}},"required":["name","inserted_at","updated_at"],"type":"object"},"id":{"description":"Unique identifier for the AI tool","type":"string"},"type":{"description":"Resource type identifier","example":"ai_tool","type":"string"}},"required":["id","type","attributes"],"title":"AITool","type":"object"},"AIToolResponse":{"description":"Response containing a single AI tool","properties":{"data":{"description":"An AI tool in the system","properties":{"attributes":{"description":"AI tool attributes","properties":{"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"name":{"description":"Name of the AI tool","type":"string"},"updated_at":{"description":"Last update timestamp","format":"date-time","type":"string"},"use_case_id":{"description":"ID of the associated use case","nullable":true,"type":"string"}},"required":["name","inserted_at","updated_at"],"type":"object"},"id":{"description":"Unique identifier for the AI tool","type":"string"},"type":{"description":"Resource type identifier","example":"ai_tool","type":"string"}},"required":["id","type","attributes"],"title":"AITool","type":"object"},"included":{"description":"Included related resources when the 'include' parameter is used","items":{"properties":{"attributes":{"description":"The JSON-API resource attributes","type":"object"},"id":{"description":"The JSON-API resource ID","type":"string"},"type":{"description":"The JSON-API resource type","type":"string"}},"type":"object"},"nullable":true,"type":"array"}},"required":["data"],"title":"AIToolResponse","type":"object"},"AIToolsResponse":{"description":"Response containing a collection of AI tools","properties":{"data":{"description":"Array of AI tool resources","items":{"description":"An AI tool in the system","properties":{"attributes":{"description":"AI tool attributes","properties":{"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"name":{"description":"Name of the AI tool","type":"string"},"updated_at":{"description":"Last update timestamp","format":"date-time","type":"string"},"use_case_id":{"description":"ID of the associated use case","nullable":true,"type":"string"}},"required":["name","inserted_at","updated_at"],"type":"object"},"id":{"description":"Unique identifier for the AI tool","type":"string"},"type":{"description":"Resource type identifier","example":"ai_tool","type":"string"}},"required":["id","type","attributes"],"title":"AITool","type":"object"},"type":"array"},"included":{"description":"Included related resources when the 'include' parameter is used","items":{"properties":{"attributes":{"description":"The JSON-API resource attributes","type":"object"},"id":{"description":"The JSON-API resource ID","type":"string"},"type":{"description":"The JSON-API resource type","type":"string"}},"type":"object"},"nullable":true,"type":"array"}},"required":["data"],"title":"AIToolsResponse","type":"object"},"Audit Log Filter Options Response":{"description":"Enumerates the valid values for audit log filters. Use this to populate\nfilter dropdowns (event name, resource type) on the client. The values\nmirror what `GET /audit_logs?filter[name]=...` and\n`filter[resource_type]=...` accept.\n\n`resource_types` applies to both the `resource_type` and `sub_object_type`\nfilters — they draw from the same enum server-side.\n","properties":{"events":{"description":"All valid audit log event names (snake_case).","items":{"type":"string"},"type":"array"},"resource_types":{"description":"All valid resource type names (also valid for sub_object_type).","items":{"type":"string"},"type":"array"}},"required":["events","resource_types"],"title":"Audit Log Filter Options Response","type":"object"},"Audit Log Response":{"description":"Response containing a single audit log","properties":{"data":{"description":"An audit log entry in the system","example":{"attributes":{"action":{"data":{},"id":"22222222-2222-2222-2222-222222222222","type":"attach"},"action_id":"22222222-2222-2222-2222-222222222222","inserted_at":"2024-01-01T12:00:00Z","message":"Policy pack GDPR was added to use case","metadata":{"policy_pack_key":"gdpr","version":"1.0"},"name":"policy_pack_added","resource_id":"33333333-3333-3333-3333-333333333333","resource_name":"Fraud Detection Model","resource_type":"use_case","source":"platform","sub_object_id":"gdpr","sub_object_name":"GDPR Compliance Pack","sub_object_type":"policy_pack","team_id":null,"use_case_id":"33333333-3333-3333-3333-333333333333","user":{"email":"john@example.com","family_name":"Doe","given_name":"John","id":"11111111-1111-1111-1111-111111111111","role":"admin"},"user_id":"11111111-1111-1111-1111-111111111111"},"id":"12345678-1234-5678-9abc-123456789012","type":"audit_logs"},"properties":{"attributes":{"properties":{"action":{"description":"Action information","nullable":true,"type":"object"},"action_id":{"description":"Action ID","format":"uuid","nullable":true,"type":"string"},"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"message":{"description":"Human-readable audit log message","nullable":true,"type":"string"},"metadata":{"description":"Additional metadata specific to the event","nullable":true,"type":"object"},"name":{"description":"Audit log event name","type":"string"},"resource_id":{"description":"ID of the primary resource affected","nullable":true,"type":"string"},"resource_name":{"description":"Name of the primary resource affected","nullable":true,"type":"string"},"resource_type":{"description":"Type of the primary resource affected","nullable":true,"type":"string"},"source":{"description":"Originating client source (e.g. 'platform', 'sdk:pycredoai@0.3.1', 'mcp:provide_ai_suggestion', 'api', 'trigger', 'unknown')","type":"string"},"sub_object_id":{"description":"ID of the sub-object affected","nullable":true,"type":"string"},"sub_object_name":{"description":"Name of the sub-object affected","nullable":true,"type":"string"},"sub_object_type":{"description":"Type of the sub-object affected","nullable":true,"type":"string"},"team_id":{"description":"Team ID","format":"uuid","nullable":true,"type":"string"},"use_case_id":{"description":"Use case ID","format":"uuid","nullable":true,"type":"string"},"user":{"description":"User information (id, email, name, role, etc.)","nullable":true,"type":"object"},"user_id":{"description":"User ID who performed the action","format":"uuid","nullable":true,"type":"string"}},"required":["name","inserted_at"],"type":"object"},"id":{"description":"Audit log ID","format":"uuid","type":"string"},"type":{"description":"Resource type","enum":["audit_logs"],"type":"string"}},"required":["id","type","attributes"],"title":"AuditLog","type":"object"}},"required":["data"],"title":"Audit Log Response","type":"object"},"Audit Logs Response":{"description":"Response containing a collection of audit logs","properties":{"data":{"items":{"description":"An audit log entry in the system","example":{"attributes":{"action":{"data":{},"id":"22222222-2222-2222-2222-222222222222","type":"attach"},"action_id":"22222222-2222-2222-2222-222222222222","inserted_at":"2024-01-01T12:00:00Z","message":"Policy pack GDPR was added to use case","metadata":{"policy_pack_key":"gdpr","version":"1.0"},"name":"policy_pack_added","resource_id":"33333333-3333-3333-3333-333333333333","resource_name":"Fraud Detection Model","resource_type":"use_case","source":"platform","sub_object_id":"gdpr","sub_object_name":"GDPR Compliance Pack","sub_object_type":"policy_pack","team_id":null,"use_case_id":"33333333-3333-3333-3333-333333333333","user":{"email":"john@example.com","family_name":"Doe","given_name":"John","id":"11111111-1111-1111-1111-111111111111","role":"admin"},"user_id":"11111111-1111-1111-1111-111111111111"},"id":"12345678-1234-5678-9abc-123456789012","type":"audit_logs"},"properties":{"attributes":{"properties":{"action":{"description":"Action information","nullable":true,"type":"object"},"action_id":{"description":"Action ID","format":"uuid","nullable":true,"type":"string"},"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"message":{"description":"Human-readable audit log message","nullable":true,"type":"string"},"metadata":{"description":"Additional metadata specific to the event","nullable":true,"type":"object"},"name":{"description":"Audit log event name","type":"string"},"resource_id":{"description":"ID of the primary resource affected","nullable":true,"type":"string"},"resource_name":{"description":"Name of the primary resource affected","nullable":true,"type":"string"},"resource_type":{"description":"Type of the primary resource affected","nullable":true,"type":"string"},"source":{"description":"Originating client source (e.g. 'platform', 'sdk:pycredoai@0.3.1', 'mcp:provide_ai_suggestion', 'api', 'trigger', 'unknown')","type":"string"},"sub_object_id":{"description":"ID of the sub-object affected","nullable":true,"type":"string"},"sub_object_name":{"description":"Name of the sub-object affected","nullable":true,"type":"string"},"sub_object_type":{"description":"Type of the sub-object affected","nullable":true,"type":"string"},"team_id":{"description":"Team ID","format":"uuid","nullable":true,"type":"string"},"use_case_id":{"description":"Use case ID","format":"uuid","nullable":true,"type":"string"},"user":{"description":"User information (id, email, name, role, etc.)","nullable":true,"type":"object"},"user_id":{"description":"User ID who performed the action","format":"uuid","nullable":true,"type":"string"}},"required":["name","inserted_at"],"type":"object"},"id":{"description":"Audit log ID","format":"uuid","type":"string"},"type":{"description":"Resource type","enum":["audit_logs"],"type":"string"}},"required":["id","type","attributes"],"title":"AuditLog","type":"object"},"type":"array"},"meta":{"description":"Pagination metadata","properties":{"page":{"description":"Current page number","type":"integer"},"per_page":{"description":"Items per page","type":"integer"},"total_count":{"description":"Total number of items","type":"integer"},"total_pages":{"description":"Total number of pages","type":"integer"}},"type":"object"}},"required":["data"],"title":"Audit Logs Response","type":"object"},"AuditLog":{"description":"An audit log entry in the system","example":{"attributes":{"action":{"data":{},"id":"22222222-2222-2222-2222-222222222222","type":"attach"},"action_id":"22222222-2222-2222-2222-222222222222","inserted_at":"2024-01-01T12:00:00Z","message":"Policy pack GDPR was added to use case","metadata":{"policy_pack_key":"gdpr","version":"1.0"},"name":"policy_pack_added","resource_id":"33333333-3333-3333-3333-333333333333","resource_name":"Fraud Detection Model","resource_type":"use_case","source":"platform","sub_object_id":"gdpr","sub_object_name":"GDPR Compliance Pack","sub_object_type":"policy_pack","team_id":null,"use_case_id":"33333333-3333-3333-3333-333333333333","user":{"email":"john@example.com","family_name":"Doe","given_name":"John","id":"11111111-1111-1111-1111-111111111111","role":"admin"},"user_id":"11111111-1111-1111-1111-111111111111"},"id":"12345678-1234-5678-9abc-123456789012","type":"audit_logs"},"properties":{"attributes":{"properties":{"action":{"description":"Action information","nullable":true,"type":"object"},"action_id":{"description":"Action ID","format":"uuid","nullable":true,"type":"string"},"inserted_at":{"description":"Creation timestamp","format":"date-time","type":"string"},"message":{"description":"Human-readable audit log message","nullable":true,"type":"string"},"metadata":{"description":"Additional metadata specific to the event","nullable":true,"type":"object"},"name":{"description":"Audit log event name","type":"string"},"resource_id":{"description":"ID of the primary resource affected","nullable":true,"type":"string"},"resource_name":{"description":"Name of the primary resource affected","nullable":true,"type":"string"},"resource_type":{"description":"Type of the primary resource affected","nullable":true,"type":"string"},"source":{"description":"Originating client source (e.g. 'platform', 'sdk:pycredoai@0.3.1', 'mcp:provide_ai_suggestion', 'api', 'trigger', 'unknown')","type":"string"},"sub_object_id":{"description":"ID of the sub-object affected","nullable":true,"type":"string"},"sub_object_name":{"description":"Name of the sub-object affected","nullable":true,"type":"string"},"sub_object_type":{"description":"Type of the sub-object affected","nullable":true,"type":"string"},"team_id":{"description":"Team ID","format":"uuid","nullable":true,"type":"string"},"use_case_id":{"description":"Use case ID","format":"uuid","nullable":true,"type":"string"},"user":{"description":"User information (id, email, name, role, etc.)","nullable":true,"type":"object"},"user_id":{"description":"User ID who performed the action","format":"uuid","nullable":true,"type":"string"}},"required":["name","inserted_at"],"type":"object"},"id":{"description":"Audit log ID","format":"uuid","type":"string"},"type":{"description":"Resource type","enum":["audit_logs"],"type":"string"}},"required":["id","type","attributes"],"title":"AuditLog","type":"object"},"Error":{"description":"Error response schema","example":{"errors":[{"code":2217,"detail":"This model cannot be deleted because it is part of an Use Case.","title":"Model in use"}]},"properties":{"errors":{"items":{"properties":{"code":{"description":"Domain-specific error code. Ranges: 404 (not found), 1000-1999 (auth), 2000-2999 (validation), 9000-9999 (internal)","example":2217,"type":"integer"},"detail":{"description":"Detailed error message","example":"This model cannot be deleted because it is part of an Use Case.","type":"string"},"title":{"description":"Short error title","example":"Model in use","type":"string"}},"required":["code","title","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"Error","type":"object"}},"securitySchemes":{"BearerAuth":{"bearerFormat":"JWT","description":"JWT access token obtained from [`POST /auth/exchange`](#tag/Auth/operation/CredoAIWeb.Auth.TokenController.exchange).\n\nInclude in the Authorization header: `Authorization: Bearer `\n","scheme":"bearer","type":"http"}}},"info":{"contact":{"email":"support@credo.ai","name":"Credo AI Support","url":"https://credo.ai/contact"},"description":"The Credo AI API provides endpoints for managing AI models, use cases, and policy controls.\n\n## Authentication\nAll API requests must include a valid Bearer token in the Authorization header.\nTo obtain a token, use the [`POST /auth/exchange`](#tag/Auth/operation/CredoAIWeb.Auth.TokenController.exchange) endpoint with your API token and tenant.\n\n## Rate Limiting\nAPI requests are limited based on your subscription plan. Contact support for specific limits.\n\n## Versioning\nThis is version 2.0 of the API. All endpoints are prefixed with `/api/v2/`.\n","license":{"name":"Proprietary","url":"https://credo.ai/terms"},"title":"Credo AI API","version":"2.0.0"},"openapi":"3.0.0","paths":{"/audit_logs":{"get":{"callbacks":{},"description":"Retrieve a paginated list of all audit logs for the tenant.\n\nString filters behave differently per field:\n- `resource_name` and `sub_object_name` perform case-insensitive partial matching\n (SQL `ILIKE '%value%'`) when given a plain string. To force an exact match,\n use the object form `filter[][type]=match&filter[][value]=`.\n- All other string filters (IDs, enums) remain exact match.\n","operationId":"CredoAIWeb.API.V2.AuditLogsController.index","parameters":[{"description":"Filter by name","in":"query","name":"filter[name]","required":false,"schema":{"type":"string"}},{"description":"Filter by user id","in":"query","name":"filter[user_id]","required":false,"schema":{"type":"string"}},{"description":"Filter by use case id","in":"query","name":"filter[use_case_id]","required":false,"schema":{"type":"string"}},{"description":"Filter by resource type","in":"query","name":"filter[resource_type]","required":false,"schema":{"type":"string"}},{"description":"Filter by resource id","in":"query","name":"filter[resource_id]","required":false,"schema":{"type":"string"}},{"description":"Filter by resource name","in":"query","name":"filter[resource_name]","required":false,"schema":{"type":"string"}},{"description":"Filter by sub object id","in":"query","name":"filter[sub_object_id]","required":false,"schema":{"type":"string"}},{"description":"Filter by sub object type","in":"query","name":"filter[sub_object_type]","required":false,"schema":{"type":"string"}},{"description":"Filter by sub object name","in":"query","name":"filter[sub_object_name]","required":false,"schema":{"type":"string"}},{"description":"Filter by start time","in":"query","name":"filter[start_time]","required":false,"schema":{"type":"string"}},{"description":"Filter by end time","in":"query","name":"filter[end_time]","required":false,"schema":{"type":"string"}},{"description":"Sort results by one or more fields. Use ascending order by default, or prefix with '-' for descending order.\\\nMultiple fields can be specified as comma-separated values.","explode":false,"in":"query","name":"sort","required":false,"schema":{"items":{"enum":["inserted_at","-inserted_at"],"type":"string"},"type":"array"},"style":"form"},{"description":"Number of items per page","in":"query","name":"page[limit]","required":false,"schema":{"maximum":1000,"minimum":1,"type":"integer"}},{"description":"Cursor for pagination - get items after this cursor","in":"query","name":"page[after]","required":false,"schema":{"type":"string"}},{"description":"Cursor for pagination - get items before this cursor","in":"query","name":"page[before]","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/Audit Logs Response"}}},"description":"Success"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"}},"summary":"List audit logs","tags":["Audit Logs"]}},"/audit_logs/export":{"get":{"callbacks":{},"description":"Export all audit logs for the tenant as a CSV file.\n\nThe CSV includes all audit log fields (see the AuditLog schema for field definitions):\n- name, user_id, action_id, use_case_id, team_id\n- resource_type, resource_id, resource_name\n- sub_object_type, sub_object_id, sub_object_name\n- user (object with id, email, name, role)\n- action (object with id, type, data)\n- metadata (event-specific data)\n- inserted_at, message\n\nYou can optionally filter which columns to include using the `columns` parameter.\n","operationId":"CredoAIWeb.API.V2.AuditLogsController.export","parameters":[{"description":"Comma-separated list of column names to include in the export (e.g., 'name,user_id,resource_type,inserted_at')","in":"query","name":"columns","required":false,"schema":{"type":"string"}},{"description":"Filter by name","in":"query","name":"filter[name]","required":false,"schema":{"type":"string"}},{"description":"Filter by user id","in":"query","name":"filter[user_id]","required":false,"schema":{"type":"string"}},{"description":"Filter by use case id","in":"query","name":"filter[use_case_id]","required":false,"schema":{"type":"string"}},{"description":"Filter by resource type","in":"query","name":"filter[resource_type]","required":false,"schema":{"type":"string"}},{"description":"Filter by resource id","in":"query","name":"filter[resource_id]","required":false,"schema":{"type":"string"}},{"description":"Filter by resource name","in":"query","name":"filter[resource_name]","required":false,"schema":{"type":"string"}},{"description":"Filter by sub object id","in":"query","name":"filter[sub_object_id]","required":false,"schema":{"type":"string"}},{"description":"Filter by sub object type","in":"query","name":"filter[sub_object_type]","required":false,"schema":{"type":"string"}},{"description":"Filter by sub object name","in":"query","name":"filter[sub_object_name]","required":false,"schema":{"type":"string"}},{"description":"Filter by start time","in":"query","name":"filter[start_time]","required":false,"schema":{"type":"string"}},{"description":"Filter by end time","in":"query","name":"filter[end_time]","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/csv":{"schema":{"description":"CSV file containing audit log data. Column headers correspond to AuditLog schema fields.","format":"binary","type":"string"}}},"description":"CSV file with audit logs (fields match AuditLog schema)"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"}},"summary":"Export audit logs to CSV","tags":["Audit Logs"]}},"/audit_logs/filter_options":{"get":{"callbacks":{},"description":"Returns the canonical lists of event names and resource types accepted by\nthe audit log filters. Intended to drive client-side filter dropdowns so\nthey stay in sync with the server's enum without requiring a frontend\ndeploy each time a new event is added.\n\n`resource_types` applies to both the `resource_type` and `sub_object_type`\nfilter parameters.\n","operationId":"CredoAIWeb.API.V2.AuditLogsController.filter_options","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Audit Log Filter Options Response"}}},"description":"Success"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"}},"summary":"List valid audit log filter values","tags":["Audit Logs"]}},"/audit_logs/{id}":{"get":{"callbacks":{},"description":"Retrieve detailed information about a specific audit log entry","operationId":"CredoAIWeb.API.V2.AuditLogsController.show","parameters":[{"description":"Audit log ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/Audit Log Response"}}},"description":"Success"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not found"}},"summary":"Get audit log details","tags":["Audit Logs"]}},"/shadow_ai/ai_events":{"get":{"callbacks":{},"description":"Retrieve a list of all AI events in the system","operationId":"CredoAIWeb.API.V2.ShadowAI.AIEventController.index","parameters":[{"description":"Filter by action","in":"query","name":"filter[action]","required":false,"schema":{"type":"string"}},{"description":"Filter by app name","in":"query","name":"filter[app_name]","required":false,"schema":{"type":"string"}},{"description":"Filter by category","in":"query","name":"filter[category]","required":false,"schema":{"type":"string"}},{"description":"Filter by department","in":"query","name":"filter[department]","required":false,"schema":{"type":"string"}},{"description":"Filter by device hostname","in":"query","name":"filter[device_hostname]","required":false,"schema":{"type":"string"}},{"description":"Filter by referrer url","in":"query","name":"filter[referrer_url]","required":false,"schema":{"type":"string"}},{"description":"Filter by risk score","in":"query","name":"filter[risk_score]","required":false,"schema":{"type":"number"}},{"description":"Filter by timestamp","in":"query","name":"filter[timestamp]","required":false,"schema":{"type":"string"}},{"description":"Filter by url","in":"query","name":"filter[url]","required":false,"schema":{"type":"string"}},{"description":"Filter by user email","in":"query","name":"filter[user_email]","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/AIEventsResponse"}}},"description":"List of AI events"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"}},"summary":"List AI events","tags":["Shadow AI"]},"post":{"callbacks":{},"description":"Create a new AI event with the provided attributes","operationId":"CredoAIWeb.API.V2.ShadowAI.AIEventController.create","parameters":[],"requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/AIEventCreateRequest"}}},"description":"AI event attributes","required":true},"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/AIEventResponse"}}},"description":"AI event created"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation error"}},"summary":"Create AI event","tags":["Shadow AI"]}},"/shadow_ai/ai_events/bulk":{"post":{"callbacks":{},"description":"Create multiple AI events in bulk. Accepts either JSONAPI format with a 'data' array or simple format with an 'events' array.","operationId":"CredoAIWeb.API.V2.ShadowAI.AIEventController.create_bulk","parameters":[],"requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/AIEventBulkCreateRequest"}}},"description":"Bulk AI event data","required":true},"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/AIEventsResponse"}}},"description":"AI events created"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation error"}},"summary":"Create AI events in bulk","tags":["Shadow AI"]}},"/shadow_ai/ai_events/{id}":{"delete":{"callbacks":{},"description":"Delete an AI event by ID","operationId":"CredoAIWeb.API.V2.ShadowAI.AIEventController.delete","parameters":[{"description":"AI event ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"content":{"":{}},"description":"AI event deleted"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"}},"summary":"Delete AI event","tags":["Shadow AI"]}},"/shadow_ai/ai_tools":{"get":{"callbacks":{},"description":"Retrieve a list of all AI tools available in the system","operationId":"CredoAIWeb.API.V2.ShadowAI.AIToolController.index","parameters":[{"description":"Include related resources in the response\\\nMultiple fields can be specified as comma-separated values.","explode":false,"in":"query","name":"include","required":false,"schema":{"items":{"enum":["use_case"],"type":"string"},"type":"array"},"style":"form"},{"description":"Sort results by one or more fields. Use ascending order by default, or prefix with '-' for descending order.\\\nMultiple fields can be specified as comma-separated values.","explode":false,"in":"query","name":"sort","required":false,"schema":{"items":{"enum":["name","-name","inserted_at","-inserted_at","updated_at","-updated_at"],"type":"string"},"type":"array"},"style":"form"},{"description":"Filter by name","in":"query","name":"filter[name]","required":false,"schema":{"type":"string"}},{"description":"Filter by use case id","in":"query","name":"filter[use_case_id]","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/AIToolsResponse"}}},"description":"List of AI tools"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"}},"summary":"List AI tools","tags":["Shadow AI"]}},"/shadow_ai/ai_tools/{id}/register":{"post":{"callbacks":{},"description":"Register an AI tool with a use case. This associates the AI tool with a specific use case in the system.","operationId":"CredoAIWeb.API.V2.ShadowAI.AIToolController.register","parameters":[{"description":"The unique ID of the AI tool to register","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/AIToolResponse"}}},"description":"AI tool registered"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"}},"summary":"Register AI tool","tags":["Shadow AI"]}},"/shadow_ai/ai_tools/{id}/unregister":{"post":{"callbacks":{},"description":"Unregister an AI tool from its associated use case. This removes the association between the AI tool and the use case.","operationId":"CredoAIWeb.API.V2.ShadowAI.AIToolController.unregister","parameters":[{"description":"The unique ID of the AI tool to unregister","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/AIToolResponse"}}},"description":"AI tool unregistered"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Not Found"}},"summary":"Unregister AI tool","tags":["Shadow AI"]}}},"security":[{"BearerAuth":[]}],"servers":[{"description":"Local development server (with preconfigured tenant 'credoai')","url":"http://localhost:4000/api/v2/{tenant}","variables":{"tenant":{"default":"credoai","description":"The tenant identifier"}}},{"description":"Quality Assurance server (with preconfigured tenant 'credoai')","url":"https://api.credo-qa.com/api/v2/{tenant}","variables":{"tenant":{"default":"credoai","description":"The tenant identifier"}}},{"description":"Production API - Replace {tenant} with your assigned tenant ID","url":"https://api.credo.ai/api/v2/{tenant}","variables":{"tenant":{"default":"","description":"Your tenant identifier (contact support@credo.ai to get yours)"}}},{"description":"Custom On-Premise Server - Enter your full base URL","url":"{custom_base_url}/api/v2/{tenant}","variables":{"custom_base_url":{"default":"https://api.your-company.com","description":"Your complete base URL (e.g., https://api.your-company.com, http://192.168.1.100:8080)"},"tenant":{"default":"","description":"Your tenant identifier"}}}],"tags":[{"name":"Audit Logs"},{"name":"Shadow AI"}]}