> ## Documentation Index
> Fetch the complete documentation index at: https://docs.knotapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Request Log By ID

> Get a request log by ID.



## OpenAPI

````yaml GET /request-logs/{id}
openapi: 3.1.0
info:
  title: Knot API
  description: An API to interact with the Knot merchant connectivity platform.
  version: 1.0.0
servers:
  - url: https://development.knotapi.com
    description: Development server
security:
  - basicAuth: []
paths:
  /request-logs/{id}:
    servers:
      - url: https://api.dashboard.knotapi.com
    get:
      summary: Get Request Log By ID
      description: Get a request log by ID.
      operationId: request_log_get_by_id
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            example: 98231774
          description: Unique identifier for the request log.
        - name: environment
          in: query
          required: true
          schema:
            type: string
            enum:
              - development
              - production
            example: development
          description: >-
            The environment to read logs from. Must match your access token's
            environment.
      responses:
        '200':
          description: Successful request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestLogDetail'
              examples:
                WebhookLog:
                  summary: Webhook log
                  value:
                    id: 98231774
                    type: webhook
                    datetime: '2026-10-15T14:32:08Z'
                    method: POST
                    path: null
                    url: https://example.com/webhooks/knot?token=********
                    event: AUTHENTICATED
                    status_code: 200
                    latency_ms: 184
                    session_id: 915efe72-5136-4652-9a1f-d9d48003c102
                    task_id: 7754123
                    external_user_id: user-123
                    request_body: >-
                      {"event":"AUTHENTICATED","session_id":"915efe72-5136-4652-9a1f-d9d48003c102","task_id":7754123,"external_user_id":"user-123","merchant":{"id":19,"name":"DoorDash"}}
                    request_body_truncated: false
                    response_body: '{"received":true}'
                    response_body_truncated: false
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                NotFound:
                  summary: Request log not found
                  value:
                    error_type: REQUEST_LOG_ERROR
                    error_code: REQUEST_LOG_NOT_FOUND
                    error_message: >-
                      The request log was not found. Please check the ID and
                      environment provided.
                EnvironmentRequired:
                  summary: environment is required
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_FIELD
                    error_message: The environment field is required.
                QueryTimeout:
                  summary: Query took too long
                  value:
                    error_type: REQUEST_LOG_ERROR
                    error_code: REQUEST_LOG_QUERY_TIMEOUT
                    error_message: >-
                      The query took too long. Narrow the time range or add a
                      filter.
        '401':
          description: Unauthorized request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InvalidAccessToken:
                  summary: Invalid or expired access token
                  value:
                    error_type: INVALID_INPUT
                    error_code: INVALID_ACCESS_TOKEN
                    error_message: >-
                      The access token is invalid or has expired. Request a new
                      access token.
        '403':
          description: Forbidden request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InsufficientScope:
                  summary: Missing scope
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INSUFFICIENT_SCOPE
                    error_message: The access token does not include the logs:read scope.
                EnvironmentMismatch:
                  summary: Access token is for another environment
                  value:
                    error_type: INVALID_REQUEST
                    error_code: ENVIRONMENT_MISMATCH
                    error_message: >-
                      This access token can only access development data.
                      Request a new access token with your production client_id.
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                RateLimitExceeded:
                  summary: Rate limit exceeded
                  value:
                    error_type: INVALID_REQUEST
                    error_code: RATE_LIMIT_EXCEEDED
                    error_message: Too many requests. Retry after 30 seconds.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                InternalServerError:
                  summary: Unexpected server error
                  value:
                    message: Server Error
      security:
        - agentAccessToken:
            - logs:read
components:
  schemas:
    RequestLogDetail:
      allOf:
        - $ref: '#/components/schemas/RequestLog'
        - type: object
          properties:
            request_body:
              type:
                - string
                - 'null'
              description: >-
                The request body as a string. Card data, credentials, tokens,
                email addresses, phone numbers, and addresses are replaced by
                `********`. `external_user_id`, merchant names, and account
                details are not masked. For `request` logs, this is the body you
                sent to Knot. For `webhook` logs, this is the webhook payload
                Knot sent to your endpoint.
            request_body_truncated:
              type: boolean
              description: '`true` if `request_body` was cut to 8 KB.'
              example: false
            response_body:
              type:
                - string
                - 'null'
              description: >-
                The response body as a string, masked like `request_body`. For
                `request` logs, this is Knot's response. For `webhook` logs,
                this is your endpoint's response. Successful Knot responses
                larger than 5 KB are not stored and appear as `response too
                large`.
            response_body_truncated:
              type: boolean
              description: '`true` if `response_body` was cut to 8 KB.'
              example: false
          required:
            - request_body
            - request_body_truncated
            - response_body
            - response_body_truncated
    Error:
      type: object
      properties:
        error_type:
          type: string
          description: Type of error.
          enum:
            - INVALID_INPUT
            - INVALID_REQUEST
            - USER_ERROR
            - SESSION_ERROR
            - MERCHANT_ACCOUNT_ERROR
            - MERCHANT_ERROR
            - SUBSCRIPTION_ERROR
            - TRANSACTION_ERROR
            - CART_ERROR
            - WEBHOOK_ENDPOINT_ERROR
            - REQUEST_LOG_ERROR
          example: INVALID_REQUEST
        error_code:
          type: string
          description: Error code.
          enum:
            - INVALID_API_KEYS
            - INVALID_FIELD
            - INVALID_JWE
            - INVALID_CURSOR_FORMAT
            - USER_NOT_FOUND
            - MERCHANT_ACCOUNT_NOT_FOUND
            - MERCHANT_ACCOUNT_DISCONNECTED
            - SESSION_NOT_FOUND
            - EXTEND_NOT_SUPPORTED
            - MERCHANT_UNAVAILABLE
            - NO_ACCESS
            - TRANSACTION_NOT_FOUND
            - NO_TRANSACTIONS
            - SUBSCRIPTION_NOT_FOUND
            - CANCELLABLE_SUBSCRIPTION_NOT_FOUND
            - MULTIPLE_CANCELLABLE_SUBSCRIPTIONS_FOUND
            - ONGOING_OPERATION
            - CART_NOT_FOUND
            - FULFILLMENT_NOT_FOUND
            - INVALID_ACCESS_TOKEN
            - INSUFFICIENT_SCOPE
            - INSUFFICIENT_ROLE
            - WEBHOOK_ENDPOINT_NOT_FOUND
            - WEBHOOK_ENDPOINT_LIMIT_REACHED
            - WEBHOOK_ENDPOINT_ALREADY_EXISTS
            - RATE_LIMIT_EXCEEDED
            - ENVIRONMENT_MISMATCH
            - REQUEST_LOG_NOT_FOUND
            - REQUEST_LOG_QUERY_TIMEOUT
          example: INVALID_FIELD
        error_message:
          type: string
          description: Detailed error message.
          example: The limit may not be greater than 10.
    RequestLog:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the request log.
          example: 98231774
        type:
          type: string
          enum:
            - request
            - webhook
          description: >-
            `request` for an API request to Knot. `webhook` for a webhook
            delivery attempt to your endpoint. Each webhook retry is a separate
            log.
          example: webhook
        datetime:
          type: string
          format: date-time
          description: >-
            When the request was made, in ISO 8601 format
            (YYYY-MM-DDTHH:MM:SSZ).
          example: '2026-10-15T14:32:08Z'
        method:
          type:
            - string
            - 'null'
          description: HTTP method of the request.
          example: POST
        path:
          type:
            - string
            - 'null'
          description: >-
            For `request` logs, the Knot API path that was called, including its
            query string. Sensitive query parameter values are masked. `null`
            for `webhook` logs.
          example: null
        url:
          type:
            - string
            - 'null'
          description: >-
            For `webhook` logs, the endpoint URL Knot sent the webhook to. Query
            parameter values and credentials are masked. `null` for `request`
            logs.
          example: https://example.com/webhooks/knot?token=********
        event:
          type:
            - string
            - 'null'
          description: For `webhook` logs, the webhook event. `null` for `request` logs.
          example: AUTHENTICATED
        status_code:
          type: integer
          description: >-
            HTTP status code of the response. For `webhook` logs, this is the
            status code your endpoint returned. Knot records `504` when your
            endpoint times out or can't be reached.
          example: 200
        latency_ms:
          type:
            - integer
            - 'null'
          description: Time taken to respond, in milliseconds.
          example: 184
        session_id:
          type:
            - string
            - 'null'
          description: The session the log belongs to, if any.
          example: 915efe72-5136-4652-9a1f-d9d48003c102
        task_id:
          type:
            - integer
            - 'null'
          description: The task the log belongs to, if any.
          example: 7754123
        external_user_id:
          type:
            - string
            - 'null'
          description: Your unique identifier for the user, if any.
          example: user-123
      required:
        - id
        - type
        - datetime
        - method
        - path
        - url
        - event
        - status_code
        - latency_ms
        - session_id
        - task_id
        - external_user_id
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication header of the form `Basic <encoded-value>`, where
        `<encoded-value>` is the base64-encoded string `username:password`. Use
        your `client_id` as the `username` and your `secret` as the `password`
        value.
    agentAccessToken:
      type: http
      scheme: bearer
      description: >-
        Short-lived access token from the [device authorization
        flow](/api-reference/agent-authorization/overview). Expires after 15
        minutes. Accesses only the environment of the client ID it was issued
        for.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.