---
title: "Creates a new data redaction for the bucket."
method: POST
path: "/v1/accounts/{accountSid}/redactions"
tags: ["Redactions"]
---

# Creates a new data redaction for the bucket.

`POST /v1/accounts/{accountSid}/redactions`

## Request

- Base URL: `https://api.apitraffic.io`
- URL: `https://api.apitraffic.io/v1/accounts/{accountSid}/redactions`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apitraffic/apis/apitraffic-api-documentation/docs/v1/accounts/:accountSid/redactions/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns the redaction.

## Path parameters

- `accountSid` string, required: accountSid

## Request body

- Redaction20Payload (unresolved $ref)

## Response `200`

Successful

- Redaction
  - `sid` string, required: Sid of the redaction
  - `accountSid` string, required: accountSid
  - `description` string, nullable: A short description for the redaction.
  - `buckets` union: An array of bucketSids that this redaction should apply to.
    - Buckets (unresolved $ref)
    - Model6 (unresolved $ref)
  - `scopes` union: The scopes for the redaction.
    - Scopes (unresolved $ref)
    - Model8 (unresolved $ref)
  - `pattern` string, nullable, required: The pattern that will be applied to find the data to redact.
  - `type` string, required: The type of redaction, this can be one of the predefined types or custom.
  - `redactAt` 'client' | 'server', required: Where the data should be redacted.
  - `level` 'full' | 'mask' | 'partial', required: The level of redaction that is applied to the data that is being redacted.
  - `applyTo` 'key' | 'value', nullable, required: When using a custom type, where the pattern should apply. If key, the pattern will look for a JSON or XML key/property. If value, the pattern will look for any data in the payload that matches the pattern/regular and redact it.
  - `environments` union: An array of environments to apply this to. This should be omitted to apply to all environments.
    - Environments (unresolved $ref)
    - Model10 (unresolved $ref)
  - `enabled` boolean, required: If the redaction is currently enabled or not.
  - `createdAt` string, required
  - `updatedAt` string, nullable
  - `deletedAt` string, nullable

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/apitraffic/apis/apitraffic-api-documentation.md) - [All operations](https://skmtc.dev/apitraffic/apis/apitraffic-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/apitraffic/apis/apitraffic-api-documentation/revisions/b2a22a9b5c98?raw)
