openapi: 3.2.0 info: description: Credo AI server API title: Credo AI server Use Case Policy Packs API servers: - url: /api/v2/credoai tags: - name: use_case_policy_packs description: Operations related to policy packs for a specific use case paths: /use_cases/{use_case_id}/{policy_pack_key}/audit_logs: get: description: Retrieve a list of all audit logs associated with a specific use case and policy pack. operationId: CredoAIWeb.API.V2.UseCase.AuditLogController.index parameters: - description: page after cursor in: query name: page[after] required: false schema: type: string - description: page before cursor in: query name: page[before] required: false schema: type: string - description: page limit in: query name: page[limit] required: false schema: type: integer - description: The unique ID of the use case for which audit logs are being retrieved. in: path name: use_case_id required: true schema: type: string - description: The unique ID of the policy pack associated with the audit logs. in: path name: policy_pack_key required: true schema: type: string responses: '200': description: OK content: application/vnd.api+json: schema: $ref: '#/components/schemas/AuditLogsPageResponse' '401': description: Unauthorized content: application/vnd.api+json: schema: $ref: '#/components/schemas/AuthError' '404': description: Not Found content: application/vnd.api+json: schema: $ref: '#/components/schemas/NotFoundError' security: - Bearer: [] summary: '' tags: - use_case_policy_packs /use_cases/{use_case_id}/policy_packs: get: description: Retrieve a list of all policy packs associated with a specific use case. operationId: CredoAIWeb.API.V2.UseCase.PolicyPackController.index parameters: - description: The unique ID of the use case. in: path name: use_case_id required: true schema: type: string responses: '200': description: OK content: application/vnd.api+json: schema: $ref: '#/components/schemas/UseCasePolicyPacksResponse' '401': description: Unauthorized content: application/vnd.api+json: schema: $ref: '#/components/schemas/AuthError' '404': description: Not Found content: application/vnd.api+json: schema: $ref: '#/components/schemas/NotFoundError' security: - Bearer: [] summary: '' tags: - use_case_policy_packs post: description: Create a new policy pack for the specified use case, resulting in the creation of related policy packs and controls. operationId: CredoAIWeb.API.V2.UseCase.PolicyPackController.create parameters: - description: The unique ID of the use case. in: path name: use_case_id required: true schema: type: string responses: '201': description: Created content: application/vnd.api+json: schema: $ref: '#/components/schemas/UseCasePolicyPackResponse' '401': description: Unauthorized content: application/vnd.api+json: schema: $ref: '#/components/schemas/AuthError' '403': description: Forbidden content: application/vnd.api+json: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: Not Found content: application/vnd.api+json: schema: $ref: '#/components/schemas/NotFoundError' security: - Bearer: [] summary: '' tags: - use_case_policy_packs requestBody: content: application/vnd.api+json: schema: $ref: '#/components/schemas/UseCasePolicyPackCreateRequest' description: Attributes for the new policy pack. /use_cases/{use_case_id}/policy_packs/{id}: delete: description: Delete a policy pack from the specified use case, which also removes related policy packs and controls. operationId: CredoAIWeb.API.V2.UseCase.PolicyPackController.delete parameters: - description: The unique ID of the use case. in: path name: use_case_id required: true schema: type: string - description: The unique ID of the policy pack to delete. in: path name: id required: true schema: type: string responses: '204': description: No Content '401': description: Unauthorized content: application/vnd.api+json: schema: $ref: '#/components/schemas/AuthError' '403': description: Forbidden content: application/vnd.api+json: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: Not Found content: application/vnd.api+json: schema: $ref: '#/components/schemas/NotFoundError' security: - Bearer: [] summary: '' tags: - use_case_policy_packs patch: description: 'Update an existing policy pack. If a version is provided, the policy pack will be upgraded to that version, ignoring other attributes. If a due date is provided, it will update the due date of the policy pack. ' operationId: CredoAIWeb.API.V2.UseCase.PolicyPackController.update parameters: - description: The unique ID of the use case. in: path name: use_case_id required: true schema: type: string - description: The unique ID of the policy pack to update. in: path name: id required: true schema: type: string responses: '200': description: OK content: application/vnd.api+json: schema: $ref: '#/components/schemas/UseCasePolicyPackResponse' '401': description: Unauthorized content: application/vnd.api+json: schema: $ref: '#/components/schemas/AuthError' '403': description: Forbidden content: application/vnd.api+json: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: Not Found content: application/vnd.api+json: schema: $ref: '#/components/schemas/NotFoundError' security: - Bearer: [] summary: '' tags: - use_case_policy_packs requestBody: content: application/vnd.api+json: schema: $ref: '#/components/schemas/UseCasePolicyPackUpdateRequest' description: Attributes to update the policy pack. components: schemas: UseCasePolicyPackResource: description: '' properties: attributes: properties: due_date: description: '' type: string entity_id: description: '' type: string inserted_at: description: '' type: string key: description: '' type: string timezone: description: '' type: string updated_at: description: '' type: string use_case_id: description: '' type: string version: description: '' type: string type: object id: description: The JSON-API resource ID example: 64YUaLWSviHgibJaRWr3ZE type: string relationships: properties: use_case: properties: data: properties: id: description: Related use_case resource id type: string type: description: Type of related use_case resource type: string type: object type: object type: object type: description: The JSON-API resource type example: use_case_policy_packs type: string type: object AuditLogResource: description: '' properties: attributes: properties: action: description: '' type: string action_id: description: '' type: string inserted_at: description: '' type: string message: description: '' type: string metadata: description: '' type: string name: description: '' type: string resource_id: description: '' type: string resource_name: description: '' type: string resource_type: description: '' type: string source: description: '' type: string sub_object_id: description: '' type: string sub_object_name: description: '' type: string sub_object_type: description: '' type: string use_case_id: description: '' type: string user: description: '' type: string user_id: description: '' type: string type: object id: description: The JSON-API resource ID example: 64YUaLWSviHgibJaRWr3ZE type: string relationships: properties: {} type: object type: description: The JSON-API resource type example: audit_logs type: string type: object UseCasePolicyPackCreateRequest: description: '' properties: data: description: '' properties: attributes: properties: key: description: policy_pack key example: QUES type: string version: description: quetionnaire version type: integer required: - key - version type: object type: description: The JSON-API resource type example: resource-type type: string type: object type: object UseCasePolicyPackResponse: description: A JSON-API document with a single [UseCasePolicyPackResource](#usecasepolicypackresource) resource properties: data: $ref: '#/components/schemas/UseCasePolicyPackResource' included: description: Included resources items: properties: id: description: The JSON-API resource ID type: string type: description: The JSON-API resource type type: string type: object type: array required: - data type: object AuthError: properties: errors: description: Errors items: properties: code: description: an application-specific error code, expressed as a string value. type: integer detail: description: a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized. type: string title: description: a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. type: string type: object type: array type: object UseCasePolicyPackUpdateRequest: description: '' properties: data: description: '' properties: attributes: properties: due_date: description: due date example: '2024-01-30T17:00:00.000Z' type: string timezone: description: timezone example: Asia/Seoul type: string version: description: policy pack version type: integer type: object id: description: The JSON-API resource ID example: 64YUaLWSviHgibJaRWr3ZE type: string type: description: The JSON-API resource type example: resource-type type: string type: object type: object ForbiddenError: properties: errors: description: Errors items: properties: code: description: an application-specific error code, expressed as a string value. type: integer detail: description: a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized. type: string title: description: a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. type: string type: object type: array type: object NotFoundError: properties: errors: description: Errors items: properties: code: description: an application-specific error code, expressed as a string value. type: integer detail: description: a human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized. type: string title: description: a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. type: string type: object type: array type: object AuditLogsPageResponse: description: A page of [AuditLogResource](#auditlogresource) results properties: data: description: Content with [AuditLogResource](#auditlogresource) objects items: $ref: '#/components/schemas/AuditLogResource' type: array meta: properties: after: description: after cursor for the next page resources type: string before: description: before cursor for the previous page resources type: string limit: description: number of resources limit applied to this request type: integer type: object required: - data type: object UseCasePolicyPacksResponse: description: A collection of [UseCasePolicyPackResource](#usecasepolicypackresource) properties: data: description: Content with [UseCasePolicyPackResource](#usecasepolicypackresource) objects items: $ref: '#/components/schemas/UseCasePolicyPackResource' type: array required: - data type: object securitySchemes: Bearer: in: header name: Authorization type: apiKey