---
title: "CreateScanLogRequest"
method: POST
path: "/v1/namespaces/{tenant_meta.namespace}/scan-log-requests"
tags: ["ScanLogRequestService"]
---

# CreateScanLogRequest

`POST /v1/namespaces/{tenant_meta.namespace}/scan-log-requests`

Create a scan log request.

## Path parameters

- `tenant_meta.namespace` string, required

## Request body

- ScanLogRequestServiceCreateScanLogRequestBody — ScanLogRequest represents a CRUD operation on a message.
  - `meta` V1Meta, required — Common fields for all Endor Labs resources.
    - `annotations` object — Annotations can be used to attach metadata to a resource message. Annotation values can be small or large, structured or unstructured, and may include characters not permitted by labels. The keys may contain alphanumerics, underscores (_), dots (.) and dashes (-). The values of an annotation must be 16384 bytes or smaller.
    - `create_time` string, date-time — Time the resource was created. Format: 2017-01-15T01:30:15.01Z RFC 3339: https://www.ietf.org/rfc/rfc3339.txt.
    - `created_by` string — Name and authentication source of the user who created the object, for example, ewok@endor.ai@google@api-key.
    - `description` string — Resource description. Must be less than 1024 bytes.
    - `index_data` V1IndexData — IndexData is used to index the resource for search. It's an internal object.
      - `data` string[]
      - `search_score` number, float — search_score is the score of the resource for search. Internal use only.
      - `tenant` string
      - `will_be_deleted_at` string, date-time — Time that the resource will be deleted.
    - `kind` string — Resource kind, for example, HelloResponse. Auto-generated using the protobuf message proto.MessageName().Name().
    - `name` string, required — Resource name. Must be 63 characters or less.
    - `parent_kind` string — Parent object resource kind, for example, Project.
    - `parent_uuid` string — Parent object UUID.
    - `references` object — Map of objects referenced in a query API.
    - `tags` string[] — List of tags attached to the resource. Tags can be used to select objects and to find collections of objects that satisfy certain conditions. A tag must be 255 characters or less.
    - `update_time` string, date-time — Time the resource was last updated. Note: Updated on all create/patch/delete operations. Format: 2017-01-15T01:30:15.01Z RFC 3339: https://www.ietf.org/rfc/rfc3339.txt.
    - `updated_by` string — Name and authentication source of the last user who updated the object, for example, vulnerabilityingestor@endor.ai@x509.
    - `upsert_time` string, date-time — Time the resource was last upserted. Note: create_time is only set the first time the resource is created. upsert_time is set every time the resource is upseted. Format: 2017-01-15T01:30:15.01Z RFC 3339: https://www.ietf.org/rfc/rfc3339.txt.
    - `version` string — Message version.
  - `spec` V1ScanLogRequestSpec, required
    - `admin_filter` string — admin_filter is an extra filter that is only available for admin users.
    - `admin_search` boolean — admin_search enables searching logs across all scans within the requested namespace using only admin_filter (e.g., grep for an error string). Requires admin_filter and start_time to be set. Only available to Endor internal accounts.
    - `applied_filter` string — applied_filter is the filter that is applied to the logs.
    - `end_time` string, date-time — Cap the time range of the logs to be returned. Default is 2 days from start_time.
    - `execution_id` string — Execution id of the scan that should be used to filter the logs. This maps to spec.result.ci_run_uuid in the ScanRequest and spec.environment.config.ExecutionID in the ScanResult. Performance optimization: Provide spec.start_time to avoid DB lookups for scan request/result timestamps. Note: If using scan result timestamps, subtract an hour to ensure no logs are missed.
    - `installation_uuid` string — installation_uuid of the installation that should be used to filter the logs.
    - `log_levels` V1LogLevel[] — log_levels are the log levels that should be used to filter the logs. Optional argument.
    - `log_messages` V1ScanLogRequestLogMessage[] — An array of log messages provided as JSON payloads that the output of the request.
      - `json_payload` object — The json payload of the message.
      - `level` 'LOG_LEVEL_UNSPECIFIED' | 'LOG_LEVEL_EMERGENCY' | 'LOG_LEVEL_ALERT' | 'LOG_LEVEL_CRITICAL' | 'LOG_LEVEL_ERROR' | 'LOG_LEVEL_WARNING' | 'LOG_LEVEL_NOTICE' | 'LOG_LEVEL_INFO' | 'LOG_LEVEL_DEBUG' — - LOG_LEVEL_EMERGENCY: System is unusable, for example, a panic condition. - LOG_LEVEL_ALERT: Action must be taken immediately, for example, a corrupted system database. - LOG_LEVEL_CRITICAL: Critical conditions such as hard device errors. - LOG_LEVEL_ERROR: Error conditions. - LOG_LEVEL_WARNING: Warning conditions. - LOG_LEVEL_NOTICE: Normal but significant conditions that may require special handling. - LOG_LEVEL_INFO: Informational messages that confirmation that the program is working as expected. - LOG_LEVEL_DEBUG: Messages that contain information normally of use only for debugging.
      - `tags` object — The tags that are associated with the log message.
      - `timestamp` string, date-time — The timestamp of the log message.
    - `max_entries` integer, required — max_entries is the maximum number of log entries to return.
    - `newest_first` boolean — newest_first asks for log entries to be returned in reverse chronological order.
    - `onprem_scheduler_uuid` string — onprem_scheduler_uuid of the onprem scheduler that should be used to filter the logs.
    - `project_uuid` string — project_uuid of the project that should be used to filter the logs.
    - `scan_request_uuid` string — scan_request_uuid that should be used to filter the logs.
    - `scan_result_uuid` string — UUID of the scan result that should be used to filter the logs.
    - `start_time` string, date-time — start_time is the time that the log should start from. if not defined, the create time of the corresponding scan request will be used.
    - `traverse` boolean — traverse includes child namespaces in the search. Only honored when target_uuid = admin_search. Endor-only.
  - `tenant_meta` object — Namespace of the message that is accessed.
  - `uuid` string — The UUID of scan log request.

## Response `200`

A successful response.

- V1ScanLogRequest — ScanLogRequest represents a CRUD operation on a message.
  - `meta` V1Meta, required — Common fields for all Endor Labs resources.
    - `annotations` object — Annotations can be used to attach metadata to a resource message. Annotation values can be small or large, structured or unstructured, and may include characters not permitted by labels. The keys may contain alphanumerics, underscores (_), dots (.) and dashes (-). The values of an annotation must be 16384 bytes or smaller.
    - `create_time` string, date-time — Time the resource was created. Format: 2017-01-15T01:30:15.01Z RFC 3339: https://www.ietf.org/rfc/rfc3339.txt.
    - `created_by` string — Name and authentication source of the user who created the object, for example, ewok@endor.ai@google@api-key.
    - `description` string — Resource description. Must be less than 1024 bytes.
    - `index_data` V1IndexData — IndexData is used to index the resource for search. It's an internal object.
      - `data` string[]
      - `search_score` number, float — search_score is the score of the resource for search. Internal use only.
      - `tenant` string
      - `will_be_deleted_at` string, date-time — Time that the resource will be deleted.
    - `kind` string — Resource kind, for example, HelloResponse. Auto-generated using the protobuf message proto.MessageName().Name().
    - `name` string, required — Resource name. Must be 63 characters or less.
    - `parent_kind` string — Parent object resource kind, for example, Project.
    - `parent_uuid` string — Parent object UUID.
    - `references` object — Map of objects referenced in a query API.
    - `tags` string[] — List of tags attached to the resource. Tags can be used to select objects and to find collections of objects that satisfy certain conditions. A tag must be 255 characters or less.
    - `update_time` string, date-time — Time the resource was last updated. Note: Updated on all create/patch/delete operations. Format: 2017-01-15T01:30:15.01Z RFC 3339: https://www.ietf.org/rfc/rfc3339.txt.
    - `updated_by` string — Name and authentication source of the last user who updated the object, for example, vulnerabilityingestor@endor.ai@x509.
    - `upsert_time` string, date-time — Time the resource was last upserted. Note: create_time is only set the first time the resource is created. upsert_time is set every time the resource is upseted. Format: 2017-01-15T01:30:15.01Z RFC 3339: https://www.ietf.org/rfc/rfc3339.txt.
    - `version` string — Message version.
  - `spec` V1ScanLogRequestSpec, required
    - `admin_filter` string — admin_filter is an extra filter that is only available for admin users.
    - `admin_search` boolean — admin_search enables searching logs across all scans within the requested namespace using only admin_filter (e.g., grep for an error string). Requires admin_filter and start_time to be set. Only available to Endor internal accounts.
    - `applied_filter` string — applied_filter is the filter that is applied to the logs.
    - `end_time` string, date-time — Cap the time range of the logs to be returned. Default is 2 days from start_time.
    - `execution_id` string — Execution id of the scan that should be used to filter the logs. This maps to spec.result.ci_run_uuid in the ScanRequest and spec.environment.config.ExecutionID in the ScanResult. Performance optimization: Provide spec.start_time to avoid DB lookups for scan request/result timestamps. Note: If using scan result timestamps, subtract an hour to ensure no logs are missed.
    - `installation_uuid` string — installation_uuid of the installation that should be used to filter the logs.
    - `log_levels` V1LogLevel[] — log_levels are the log levels that should be used to filter the logs. Optional argument.
    - `log_messages` V1ScanLogRequestLogMessage[] — An array of log messages provided as JSON payloads that the output of the request.
      - `json_payload` object — The json payload of the message.
      - `level` 'LOG_LEVEL_UNSPECIFIED' | 'LOG_LEVEL_EMERGENCY' | 'LOG_LEVEL_ALERT' | 'LOG_LEVEL_CRITICAL' | 'LOG_LEVEL_ERROR' | 'LOG_LEVEL_WARNING' | 'LOG_LEVEL_NOTICE' | 'LOG_LEVEL_INFO' | 'LOG_LEVEL_DEBUG' — - LOG_LEVEL_EMERGENCY: System is unusable, for example, a panic condition. - LOG_LEVEL_ALERT: Action must be taken immediately, for example, a corrupted system database. - LOG_LEVEL_CRITICAL: Critical conditions such as hard device errors. - LOG_LEVEL_ERROR: Error conditions. - LOG_LEVEL_WARNING: Warning conditions. - LOG_LEVEL_NOTICE: Normal but significant conditions that may require special handling. - LOG_LEVEL_INFO: Informational messages that confirmation that the program is working as expected. - LOG_LEVEL_DEBUG: Messages that contain information normally of use only for debugging.
      - `tags` object — The tags that are associated with the log message.
      - `timestamp` string, date-time — The timestamp of the log message.
    - `max_entries` integer, required — max_entries is the maximum number of log entries to return.
    - `newest_first` boolean — newest_first asks for log entries to be returned in reverse chronological order.
    - `onprem_scheduler_uuid` string — onprem_scheduler_uuid of the onprem scheduler that should be used to filter the logs.
    - `project_uuid` string — project_uuid of the project that should be used to filter the logs.
    - `scan_request_uuid` string — scan_request_uuid that should be used to filter the logs.
    - `scan_result_uuid` string — UUID of the scan result that should be used to filter the logs.
    - `start_time` string, date-time — start_time is the time that the log should start from. if not defined, the create time of the corresponding scan request will be used.
    - `traverse` boolean — traverse includes child namespaces in the search. Only honored when target_uuid = admin_search. Endor-only.
  - `tenant_meta` V1TenantMeta — Tenant related data for the tenant containing the resource.
    - `namespace` string, required — Namespaces are a way to organize organizational units into virtual groupings of resources. Namespaces must be a fully qualified name, for example, the child namespace of namespace "endor.prod" called "app" is called "endor.prod.app".
  - `uuid` string — The UUID of scan log request.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/endorlabs/apis/endor-labs-rest-api-reference.md) · [All operations](https://skmtc.net/endorlabs/apis/endor-labs-rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/endorlabs/endor-labs-rest-api-reference/revisions/2fe1f84213b3/schema)
