openapi: 3.0.1 info: title: Endor Labs REST Authentication Policies API description: The Endor Labs REST API is a uniform resource API over namespaces. Every resource kind (Project, PackageVersion, DependencyMetadata, Finding, Policy, ScanResult, Metric, and more) is addressed under /v1/namespaces/{namespace}/{resource}, with consistent list (GET), get (GET /{uuid}), create (POST), update (PATCH /{uuid}), and delete (DELETE /{uuid}) semantics. List endpoints share a common set of list_parameters (filter, mask, page_size, page_token, sort, count, group). Authentication is a bearer access token obtained by exchanging an API key and secret at POST /v1/auth/api-key. termsOfService: https://www.endorlabs.com/terms contact: name: Endor Labs Support url: https://docs.endorlabs.com/rest-api/ version: '1.0' servers: - url: https://api.endorlabs.com/v1 security: - bearerAuth: [] tags: - name: Policies description: Governance rules over resources. paths: /namespaces/{namespace}/policies: get: operationId: listPolicies tags: - Policies summary: List Policy resources in a namespace. parameters: - $ref: '#/components/parameters/Namespace' - $ref: '#/components/parameters/Filter' - $ref: '#/components/parameters/Mask' - $ref: '#/components/parameters/PageSize' - $ref: '#/components/parameters/PageToken' responses: '200': description: A list of Policy resources. content: application/json: schema: $ref: '#/components/schemas/PolicyList' '401': $ref: '#/components/responses/Unauthorized' post: operationId: createPolicy tags: - Policies summary: Create a Policy resource in a namespace. parameters: - $ref: '#/components/parameters/Namespace' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Policy' responses: '200': description: The created Policy resource. content: application/json: schema: $ref: '#/components/schemas/Policy' '401': $ref: '#/components/responses/Unauthorized' /namespaces/{namespace}/policies/{uuid}: get: operationId: getPolicy tags: - Policies summary: Get a Policy resource by UUID. parameters: - $ref: '#/components/parameters/Namespace' - $ref: '#/components/parameters/Uuid' responses: '200': description: The requested Policy resource. content: application/json: schema: $ref: '#/components/schemas/Policy' '404': $ref: '#/components/responses/NotFound' patch: operationId: updatePolicy tags: - Policies summary: Update a Policy resource by UUID. parameters: - $ref: '#/components/parameters/Namespace' - $ref: '#/components/parameters/Uuid' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Policy' responses: '200': description: The updated Policy resource. content: application/json: schema: $ref: '#/components/schemas/Policy' '404': $ref: '#/components/responses/NotFound' delete: operationId: deletePolicy tags: - Policies summary: Delete a Policy resource by UUID. parameters: - $ref: '#/components/parameters/Namespace' - $ref: '#/components/parameters/Uuid' responses: '200': description: The Policy resource was deleted. '404': $ref: '#/components/responses/NotFound' components: parameters: Uuid: name: uuid in: path required: true description: The UUID of the resource. schema: type: string Filter: name: list_parameters.filter in: query required: false description: Endor query-language filter expression applied to the resource list. schema: type: string Mask: name: list_parameters.mask in: query required: false description: Comma-separated field mask selecting which fields to return. schema: type: string PageToken: name: list_parameters.page_token in: query required: false description: Opaque token to retrieve the next page of results. schema: type: string Namespace: name: namespace in: path required: true description: The tenant namespace (tenant_meta.namespace) that scopes the resource. schema: type: string PageSize: name: list_parameters.page_size in: query required: false description: Maximum number of resources to return per page. schema: type: integer format: int32 schemas: ListResponse: type: object properties: next_page_token: type: string count: type: integer format: int32 TenantMeta: type: object properties: namespace: type: string description: The namespace the resource belongs to. ResourceMeta: type: object properties: name: type: string kind: type: string description: type: string version: type: string create_time: type: string format: date-time update_time: type: string format: date-time Policy: type: object properties: uuid: type: string meta: $ref: '#/components/schemas/ResourceMeta' tenant_meta: $ref: '#/components/schemas/TenantMeta' spec: type: object properties: policy_type: type: string resource_kinds: type: array items: type: string query_statements: type: array items: type: string rule: type: string disable: type: boolean Error: type: object properties: code: type: integer format: int32 message: type: string PolicyList: type: object properties: list: type: object properties: objects: type: array items: $ref: '#/components/schemas/Policy' response: $ref: '#/components/schemas/ListResponse' responses: Unauthorized: description: Missing or invalid bearer access token. content: application/json: schema: $ref: '#/components/schemas/Error' NotFound: description: The requested resource was not found. content: application/json: schema: $ref: '#/components/schemas/Error' securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT description: Bearer access token obtained from POST /v1/auth/api-key by exchanging an Endor Labs API key and secret.