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

# Redaction

> Remove information from a PDF or image according to a redaction spec. The generated PDF is returned when available, including when verification checks fail. Inspect verdict and failing_checks before using it. Completed runs are charged even when verification fails. The report provides counts and check identifiers, without removed text.



## OpenAPI

````yaml https://www.datalab.to/openapi.json post /api/v1/redact
openapi: 3.1.0
info:
  title: Datalab API
  version: 0.0.1
servers:
  - url: https://www.datalab.to
    description: Datalab API
security: []
paths:
  /api/v1/redact:
    post:
      summary: Redaction
      description: >-
        Remove information from a PDF or image according to a redaction spec.
        The generated PDF is returned when available, including when
        verification checks fail. Inspect verdict and failing_checks before
        using it. Completed runs are charged even when verification fails. The
        report provides counts and check identifiers, without removed text.
      operationId: redact_api_v1_redact_post
      parameters:
        - name: wos-session
          in: cookie
          required: false
          schema:
            type: string
            title: Wos-Session
        - name: datalab_active_team
          in: cookie
          required: false
          schema:
            type: string
            title: Datalab Active Team
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_redact_api_v1_redact_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitialResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    Body_redact_api_v1_redact_post:
      properties:
        file_url:
          anyOf:
            - type: string
            - type: 'null'
          title: File Url
          description: >-
            Optional file URL (http/https). If provided, the server will
            download and process it.
        preset:
          anyOf:
            - type: string
            - type: 'null'
          title: Preset
          description: >-
            A built-in spec: 'personal_information' removes a private
            individual's identifiers; 'financial_details' removes account
            identifiers and payment credentials, including business accounts;
            'business_confidentiality' removes counterparties, commercial terms
            and explicitly non-public information; 'manuscript_anonymisation'
            prepares a manuscript for double-blind review. Combined with
            redaction_spec, the spec's fields replace the preset's.
          default: personal_information
          choices:
            - business_confidentiality
            - financial_details
            - manuscript_anonymisation
            - personal_information
          dashboard:
            choices:
              - business_confidentiality
              - financial_details
              - manuscript_anonymisation
              - personal_information
            description: The kind of redaction to run.
            type: select
        redaction_spec:
          anyOf:
            - type: string
            - type: 'null'
          title: Redaction Spec
          description: >-
            Optional JSON spec: {"goal": "...", "rules": [{"id", "label",
            "detail"}], "keep": [{"id", "label", "detail"}]}. "rules" says what
            to remove, "keep" what must stay.
          dashboard:
            description: Custom rules. Leave empty to use the preset as it is.
            type: json
        page_range:
          anyOf:
            - type: string
            - type: 'null'
          title: Page Range
          description: >-
            Not supported for redaction. Omit this field; the whole document is
            reviewed (up to 60 pages).
        skip_cache:
          type: boolean
          title: Skip Cache
          description: Skip the cache and re-run the inference. Defaults to False.
          default: false
        processing_location:
          anyOf:
            - type: string
            - type: 'null'
          title: Processing Location
          description: >-
            Optional residency region override (e.g. us, eu). When provided, use
            file_url or direct-upload; multipart uploads are rejected. When
            omitted, the request uses the team's configured residency and
            profile.
        file:
          anyOf:
            - type: string
              contentMediaType: application/octet-stream
            - type: 'null'
          title: File
          description: >-
            Input PDF, word document, powerpoint, or image file, uploaded as
            multipart form data.  Images must be png, jpg, or webp format.
      type: object
      title: Body_redact_api_v1_redact_post
    InitialResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether the request was successful.
          default: true
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: >-
            If the request was not successful, this will contain an error
            message.
        request_id:
          type: string
          title: Request Id
          description: >-
            The ID of the request. This ID can be used to check the status of
            the request.
        request_check_url:
          type: string
          title: Request Check Url
          description: The URL to check the status of the request and get results.
        versions:
          anyOf:
            - additionalProperties: true
              type: object
            - type: string
            - type: 'null'
          title: Versions
          description: A dictionary of the versions of the libraries used in the request.
        checkpoint_reused:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Checkpoint Reused
          description: >-
            True when this run automatically reused a checkpoint from a previous
            run of the same file, so the conversion step is not re-billed.
            Absent/None otherwise.
      type: object
      required:
        - request_id
        - request_check_url
      title: InitialResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````

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