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

# Retrieve a Request Log

> Get one logged API call, including its request input and response body.

<Badge color="green">0 Credits</Badge>

Find the `request_id` in [List Request Logs](/api-reference/logs/list), in the `request_id` field of any API response, or in the `X-Request-Id` response header.


## OpenAPI

````yaml GET /logs/{request_id}
openapi: 3.1.0
info:
  title: Context.dev API
  description: API for retrieving context data from any website
  version: 1.0.0
servers:
  - url: https://api.context.dev/v1
security: []
tags:
  - name: Webhooks
    description: Inspect and retry webhook deliveries. These endpoints cost no credits.
  - name: Logs
    description: >-
      Read your organization's API request logs to debug failed calls. These
      endpoints cost no credits and use a separate rate limit.
  - name: Batch
    description: Scrape many pages or crawl a site asynchronously.
  - name: Monitors
    description: >-
      Monitor pages, sitemaps, and extracted website data for exact or semantic
      changes. Webhook payloads are documented by the
      MonitorsChangeDetectedWebhookPayload and
      MonitorsRunCompletedWebhookPayload schemas.
  - name: News
    description: >-
      Search live first-party RSS and free historical news data by company
      identity.
paths:
  /logs/{request_id}:
    get:
      tags:
        - Logs
      summary: Get a request log
      description: Get one logged API call, including its request input and response body.
      operationId: getLog
      parameters:
        - schema:
            type: string
            format: uuid
            description: The request ID of the logged API call.
          required: true
          description: The request ID of the logged API call.
          name: request_id
          in: path
      responses:
        '200':
          description: Log entry
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLogResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          description: Rate limit exceeded (60 requests per minute per organization).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Log storage is temporarily unavailable.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  headers:
    RequestId:
      description: >-
        Unique id of this API call, sent on every response and mirrored as
        request_id in JSON bodies. Quote it when contacting support.
      schema:
        type: string
        format: uuid
    RateLimitLimit:
      description: Maximum requests per minute.
      schema:
        type: integer
        minimum: 1
    RateLimitRemaining:
      description: Requests remaining in the current minute.
      schema:
        type: integer
        minimum: 0
    RateLimitReset:
      description: Unix timestamp in seconds when the rate limit resets.
      schema:
        type: integer
  schemas:
    GetLogResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/LogDetail'
        key_metadata:
          $ref: '#/components/schemas/KeyMetadata'
        request_id:
          $ref: '#/components/schemas/RequestId'
      required:
        - data
        - request_id
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
        error_code:
          type: string
          enum:
            - INTERNAL_ERROR
            - VALID
            - NOT_FOUND
            - FORBIDDEN
            - USAGE_EXCEEDED
            - RATE_LIMITED
            - UNAUTHORIZED
            - DISABLED
            - PAID_PLAN_REQUIRED
            - INSUFFICIENT_PERMISSIONS
            - TIMEOUT_EXCEEDS_MAXIMUM
            - TIMEOUT_TOO_SHORT_FOR_WAIT
            - WEBSITE_ACCESS_ERROR
            - WEBSITE_BLOCKED
            - WEBSITE_NOT_FOUND
            - PDF_SKIPPED
            - PDF_IMAGES_ONLY
            - EXTERNAL_PROVIDER_ERROR
            - INPUT_VALIDATION_ERROR
            - ZDR_NOT_SUPPORTED
            - ZDR_NOT_ENABLED
            - FREE_EMAIL_DETECTED
            - DISPOSABLE_EMAIL_DETECTED
            - REQUEST_TIMEOUT
            - COLD_DOMAIN_TIMEOUT_TOO_LOW
            - UNSUPPORTED_CONTENT
            - CONTENT_TOO_LARGE
            - MONITOR_PAUSED
            - MONITOR_NO_WEBHOOK
            - COLLECTION_PAUSED
            - MONITOR_LIMIT_EXCEEDED
            - SEARCH_UNAVAILABLE
            - BATCH_LIMIT_EXCEEDED
            - BATCH_NOT_CANCELLABLE
            - BATCH_NOT_COMPLETED
            - IDEMPOTENCY_KEY_CONFLICT
            - DELIVERY_IN_PROGRESS
            - DELIVERY_ALREADY_DELIVERED
            - DELIVERY_EXPIRED
            - DELIVERY_CANCELLED
          description: Error code indicating the type of error
        key_metadata:
          $ref: '#/components/schemas/KeyMetadata'
        request_id:
          $ref: '#/components/schemas/RequestId'
      required:
        - request_id
    LogDetail:
      allOf:
        - $ref: '#/components/schemas/LogEntry'
        - type: object
          properties:
            input:
              type: object
              properties:
                query:
                  type: object
                  additionalProperties: {}
                  description: Query parameters as sent.
                body:
                  description: Request body with credentials and uploaded content redacted.
              required:
                - query
              description: What was sent with the request.
            response:
              description: >-
                The retained JSON response with credentials redacted, or null
                when unavailable.
            user_agent:
              type:
                - string
                - 'null'
              description: User-Agent header of the request.
            key_metadata:
              $ref: '#/components/schemas/KeyMetadata'
          required:
            - input
            - user_agent
    KeyMetadata:
      type: object
      properties:
        credits_consumed:
          type: integer
          description: Credits used by this request.
        credits_remaining:
          type: integer
          description: Credits remaining for your organization.
      required:
        - credits_consumed
        - credits_remaining
      description: Credit usage, included whenever a valid API key is provided.
    RequestId:
      type: string
      format: uuid
      description: >-
        Unique id of this API call, also sent in the X-Request-Id response
        header. Quote it when contacting support about a failed request.
      example: 3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91
    LogEntry:
      type: object
      properties:
        request_id:
          type: string
          description: Request ID of the logged API call.
        timestamp:
          type: string
          format: date-time
          description: When the request completed.
        method:
          type: string
          description: HTTP method.
          example: GET
        path:
          type: string
          description: Endpoint path as called.
          example: /v1/brand/retrieve
        status_code:
          type: integer
          description: HTTP status code returned.
          example: 500
        error_code:
          type:
            - string
            - 'null'
          description: The `error_code` from the response, or null on success.
          example: WEBSITE_ACCESS_ERROR
        latency_ms:
          type: number
          description: Server-side processing time in milliseconds.
        credits_used:
          type: integer
          description: Credits charged for this request.
        key_id:
          type:
            - string
            - 'null'
          description: ID of the API key that made the request.
        tags:
          type: array
          items:
            type: string
          description: Request tags supplied by the caller.
        zdr:
          type: boolean
          description: Whether the request was made under zero data retention.
      required:
        - request_id
        - timestamp
        - method
        - path
        - status_code
        - error_code
        - latency_ms
        - credits_used
        - key_id
        - tags
        - zdr
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
    Unauthorized:
      description: Unauthorized
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'

````