{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "https:\/\/dev.scrapii.net"
        }
    ],
    "info": {
        "name": "Scrapii API Documentation",
        "_postman_id": "59fee567-4c41-4fd8-9eee-4703a170ea92",
        "description": "Scrapii is a secure PII redaction and tokenization API built for privacy-first AI workflows. It detects and replaces sensitive data with non-sensitive tokens, allowing documents to be safely processed by public AI services and frontier LLMs without exposing regulated or personal information.\n<br\/><br\/>\nScrapii supports authorized detokenization, enabling clients to securely restore original values when required for downstream workflows, audits, or human review. For maximum trust and data sovereignty, Scrapii also supports client-controlled token encryption, ensuring sensitive values can only be decrypted by the client\u2014never the platform.\n<br\/><br\/>\nDesigned for developers, Scrapii integrates seamlessly into automated pipelines via REST APIs, n8n workflows, or any existing processing pipeline, enabling low-friction redaction and de-identification across text, PDFs, and images. Deterministic token mapping preserves referential integrity while maintaining strict data boundaries.\n<br\/><br\/>\nScrapii is ideal for compliance-driven industries such as healthcare, legal, and finance, helping teams meet GDPR, HIPAA, SOC 2, and PIPEDA requirements while still leveraging modern AI, document processing, and automation tools.",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Endpoints",
            "description": "",
            "item": [
                {
                    "name": "GET api\/v1\/test",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/test",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/test"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [
                                {
                                    "key": "cache-control",
                                    "value": "no-cache, private"
                                },
                                {
                                    "key": "content-type",
                                    "value": "application\/json"
                                },
                                {
                                    "key": "vary",
                                    "value": "Origin"
                                }
                            ],
                            "code": 401,
                            "body": "{\"message\":\"Unauthenticated.\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Upload and tokenize a document.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/document",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/document"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "multipart\/form-data"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "formdata",
                            "formdata": [
                                {
                                    "key": "confidence_threshold",
                                    "value": "0.85",
                                    "type": "text",
                                    "description": "Minimum confidence score (0.0-1.0) for PII detection."
                                },
                                {
                                    "key": "entity_types[0]",
                                    "value": "EMAIL_ADDRESS",
                                    "type": "text",
                                    "description": ""
                                },
                                {
                                    "key": "entity_types[1]",
                                    "value": "PHONE_NUMBER",
                                    "type": "text",
                                    "description": ""
                                },
                                {
                                    "key": "file",
                                    "src": [],
                                    "type": "file"
                                }
                            ]
                        },
                        "description": "Upload a document for PII detection and tokenization."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\n  \"message\": \"Document uploaded successfully.\",\n  \"data\": {\n    \"id\": \"9d3a5c8e-4b2f-4a1e-8c3d-5e6f7a8b9c0d\",\n    \"user_id\": 1,\n    \"mode\": \"token\",\n    \"status\": \"queued\",\n    \"original_filename\": \"example.pdf\",\n    \"confidence_threshold\": 0.85,\n    \"entity_types\": [\"EMAIL_ADDRESS\", \"PHONE_NUMBER\"],\n    \"progress_percentage\": 0,\n    \"current_step\": \"Queued for processing\",\n    \"created_at\": \"2024-01-01T00:00:00.000000Z\",\n    \"updated_at\": \"2024-01-01T00:00:00.000000Z\"\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get the tokenized document content.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/document\/:document_id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/document\/:document_id",
                            "variable": [
                                {
                                    "id": "document_id",
                                    "key": "document_id",
                                    "value": "019c021d-7090-7225-b07e-57103dc4e9f6",
                                    "description": "The ID of the document."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"message\": \"Document content retrieved successfully.\",\n  \"data\": {\n    \"content\": \"Contact [TOKEN:EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e] for more information.\",\n    \"document_id\": \"9d3a5c8e-4b2f-4a1e-8c3d-5e6f7a8b9c0d\",\n    \"original_filename\": \"example.pdf\"\n  }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"message\": \"You do not have permission to access this document.\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\": \"Processed document file not found.\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"message\": \"Document is not ready for download.\"}",
                            "name": "Not Ready"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"message\": \"Document processing failed and cannot be downloaded.\"}",
                            "name": "Failed"
                        }
                    ]
                },
                {
                    "name": "Get document status and details.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/document\/:document_id\/status",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/document\/:document_id\/status",
                            "variable": [
                                {
                                    "id": "document_id",
                                    "key": "document_id",
                                    "value": "019c021d-7090-7225-b07e-57103dc4e9f6",
                                    "description": "The ID of the document."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"data\": {\n    \"id\": \"9d3a5c8e-4b2f-4a1e-8c3d-5e6f7a8b9c0d\",\n    \"user_id\": 1,\n    \"mode\": \"token\",\n    \"status\": \"completed\",\n    \"original_filename\": \"example.pdf\",\n    \"confidence_threshold\": 0.85,\n    \"entity_types\": [\"EMAIL_ADDRESS\", \"PHONE_NUMBER\"],\n    \"progress_percentage\": 100,\n    \"current_step\": \"Processing complete\",\n    \"created_at\": \"2024-01-01T00:00:00.000000Z\",\n    \"updated_at\": \"2024-01-01T00:00:01.000000Z\"\n  }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"message\": \"You do not have permission to access this document.\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Detokenize a processed document and return the original content.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/document\/:document_id\/detokenize",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/document\/:document_id\/detokenize",
                            "variable": [
                                {
                                    "id": "document_id",
                                    "key": "document_id",
                                    "value": "019c021d-7090-7225-b07e-57103dc4e9f6",
                                    "description": "The ID of the document."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"message\": \"Document detokenized successfully.\",\n  \"data\": {\n    \"content\": \"Contact john.doe@example.com for more information.\",\n    \"document_id\": \"9d3a5c8e-4b2f-4a1e-8c3d-5e6f7a8b9c0d\",\n    \"original_filename\": \"example.pdf\",\n    \"tokens_found\": [\"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\"],\n    \"tokens_replaced\": [\"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\"],\n    \"tokens_failed\": [],\n    \"total_detokenizations\": 1\n  }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 400,
                            "body": "{\"message\": \"Document is not tokenized\"}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"message\": \"Unauthorized\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Download multiple tokenized documents as a single combined file.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/documents",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/documents"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"document_ids\":[\"6ff8f7f6-1eb3-3525-be4a-3932c805afed\"],\"separator\":\"g\"}"
                        },
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "Returns a combined text file containing all requested tokenized documents.",
                            "name": "Success"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\n  \"message\": \"Some documents were not found or do not belong to you.\",\n  \"missing_document_ids\": [\"9d3a5c8e-4b2f-4a1e-8c3d-5e6f7a8b9c0d\"]\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\n  \"message\": \"Some documents are not ready for download.\",\n  \"not_ready_documents\": [\n    {\n      \"id\": \"9d3a5c8e-4b2f-4a1e-8c3d-5e6f7a8b9c0d\",\n      \"status\": \"processing\",\n      \"error_message\": null\n    }\n  ]\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get a single token's original PII value.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/detokenize\/:token",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/detokenize\/:token",
                            "variable": [
                                {
                                    "id": "token",
                                    "key": "token",
                                    "value": "architecto",
                                    "description": ""
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"message\": \"Token retrieved successfully.\",\n  \"data\": {\n    \"token_id\": \"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\",\n    \"pii_value\": \"john.doe@example.com\"\n  }\n}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"message\": \"Token not found or access denied.\"}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Detokenize text content by replacing tokens with original PII values.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/detokenize",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/detokenize"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"content\":\"b\"}"
                        },
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"message\": \"Content detokenized successfully.\",\n  \"data\": {\n    \"detokenized_content\": \"Contact John Doe at john.doe@example.com or (555) 123-4567.\",\n    \"tokens_found\": [\n      \"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\",\n      \"PHONE_NUMBER:07bf49bd8a8796e3e120e873e51da7156904ffdf6049c74c37da599609a7caf4\"\n    ],\n    \"tokens_replaced\": [\n      \"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\",\n      \"PHONE_NUMBER:07bf49bd8a8796e3e120e873e51da7156904ffdf6049c74c37da599609a7caf4\"\n    ],\n    \"tokens_failed\": [],\n    \"total_detokenizations\": 2\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Detokenize uploaded text\/csv files by replacing tokens with original PII values.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/detokenize\/file",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/detokenize\/file"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "multipart\/form-data"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "formdata",
                            "formdata": [
                                {
                                    "key": "file",
                                    "src": [],
                                    "type": "file"
                                }
                            ]
                        },
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"message\": \"File detokenized successfully.\",\n  \"data\": {\n    \"detokenized_content\": \"Contact John Doe at john.doe@example.com or (555) 123-4567.\",\n    \"tokens_found\": [\n      \"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\",\n      \"PHONE_NUMBER:07bf49bd8a8796e3e120e873e51da7156904ffdf6049c74c37da599609a7caf4\"\n    ],\n    \"tokens_replaced\": [\n      \"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\",\n      \"PHONE_NUMBER:07bf49bd8a8796e3e120e873e51da7156904ffdf6049c74c37da599609a7caf4\"\n    ],\n    \"tokens_failed\": [],\n    \"total_detokenizations\": 2\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Detokenize tokens.",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/detokenize\/tokens",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/detokenize\/tokens"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"tokens\":[\"PHONE_NUMBER:07bf49bd8a8796e3e120e873e51da7156904ffdf6049c74c37da599609a7caf4\",\"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\"]}"
                        },
                        "description": "Supply an array of token IDs to retrieve their original PII values.\nToken IDs follow the format: `TYPE:hash` (e.g., `PHONE_NUMBER:abc123...`).\n\nTo extract token IDs from tokenized content, use this regex pattern:\n`\/\\[TOKEN:([A-Z_]+:[a-f0-9]+)\\]\/g`\n\nThis will match tokens like:\n`[TOKEN:US_SSN:1d593fdba2209408e11e0384a9a257d2e058d1532ade7ac8c47e0f447b1edaaa]`\n\nAnd capture the token ID:\n`US_SSN:1d593fdba2209408e11e0384a9a257d2e058d1532ade7ac8c47e0f447b1edaaa`"
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\n  \"message\": \"Token retrieval completed.\",\n  \"data\": {\n    \"tokens\": [\n      {\n        \"token\": \"PHONE_NUMBER:07bf49bd8a8796e3e120e873e51da7156904ffdf6049c74c37da599609a7caf4\",\n        \"value\": \"(555) 123-4567\",\n        \"found\": true\n      },\n      {\n        \"token\": \"EMAIL_ADDRESS:f26ab8cf5a26d76fd04f4f7a740b0c0e596975c528cb0028a365898fae44915e\",\n        \"value\": \"john.doe@example.com\",\n        \"found\": true\n      }\n    ],\n    \"total_requested\": 2,\n    \"total_found\": 2,\n    \"total_not_found\": 0\n  }\n}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "GET api\/openapi.json",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/openapi.json",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/openapi.json"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [
                                {
                                    "key": "cache-control",
                                    "value": "no-cache, private"
                                },
                                {
                                    "key": "location",
                                    "value": "https:\/\/dev.scrapii.net\/docs\/openapi.json"
                                },
                                {
                                    "key": "content-type",
                                    "value": "text\/html; charset=utf-8"
                                },
                                {
                                    "key": "vary",
                                    "value": "X-Inertia, Origin"
                                },
                                {
                                    "key": "set-cookie",
                                    "value": "XSRF-TOKEN=eyJpdiI6IitrQzhVRnFhNS9PMU9lWkM3NXdMUnc9PSIsInZhbHVlIjoicmZRekM5dm9zcmdDVDErcW9SVmpCb1ZKSks5OE1ZOUMzV3pkakRIWFRJSVQvdVg5ZGc1dzFFOG1ZNDhUU3RFVWlqbGMxbW1IZThJaloySHpqdkk5cXFFRjBaWktWZ2RXL0dtODFUNm1MWTJRNFdWVlU4a2h1LzgxWmJ2dEVuUUEiLCJtYWMiOiIxNjVhMTg2Y2UwMjgyZDUwMDA5NjdkNGRkNjVlYmFjZjhjZGM0YTRjM2E4ODJiMDU0OGRkNDJkMzA0ODg3ZTQ5IiwidGFnIjoiIn0%3D; expires=Tue, 10 Mar 2026 01:34:24 GMT; Max-Age=7200; path=\/; secure; samesite=lax; scrapii-session=eyJpdiI6IlUxRUxTM3pVeWQyZ1NvNTFPRzVvUHc9PSIsInZhbHVlIjoiUFI1MWZkVXNZV2IwWmZaSmU3dy9CYmJwM1RQQmhEWUVkOWlwd2V1UnlQOHFpOS8wNXc4ODJtWDgvRUtBL29aVzlacXU0N2xIZjVNbG1zKzYweUsvajI0czY2NWU2d3RuZS9pTmE4cjhHRWdGSlFmdWFLdy94WkJsUlgwQnZzaGMiLCJtYWMiOiJhZjlmOTUwNGQxZjMyNTU2MjhjNmQ2YTJkMjVkMDVmMDQ5NzU5ZTIwODBmYTQ1OTE3MDhkNzJhOTYwMWVjNTAzIiwidGFnIjoiIn0%3D; expires=Tue, 10 Mar 2026 01:34:24 GMT; Max-Age=7200; path=\/; secure; httponly; samesite=lax"
                                }
                            ],
                            "code": 302,
                            "body": "<!DOCTYPE html>\n<html>\n    <head>\n        <meta charset=\"UTF-8\" \/>\n        <meta http-equiv=\"refresh\" content=\"0;url='https:\/\/dev.scrapii.net\/docs\/openapi.json'\" \/>\n\n        <title>Redirecting to https:\/\/dev.scrapii.net\/docs\/openapi.json<\/title>\n    <\/head>\n    <body>\n        Redirecting to <a href=\"https:\/\/dev.scrapii.net\/docs\/openapi.json\">https:\/\/dev.scrapii.net\/docs\/openapi.json<\/a>.\n    <\/body>\n<\/html>",
                            "name": ""
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "Authorization",
                "type": "string"
            }
        ]
    }
}