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

# Declare a custom field

> Declares one of your own transaction attributes, making it usable in rule conditions as `custom_field_<name>` and validated as its declared type on ingest.

`appliesTo` scopes the field to one ingest surface or to all of them, and `isRequired` makes ingest reject a matching transaction that omits it — so declare it required only once your integration always sends it. Keys are matched ignoring case and stored under the spelling declared here, which is also the spelling rules must use.



## OpenAPI

````yaml /openapi/transaction-monitoring.json post /api/v1/custom-fields/
openapi: 3.0.3
info:
  title: iDenfy Transaction Monitoring API
  version: v1
  description: >-
    Submit transactions and events for AML monitoring, and read back the alerts,
    cases and reports they produce.
servers:
  - url: https://ivs-tx-monitoring.idenfy.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Ingest
    description: Submit transactions and events for monitoring.
  - name: Transactions
    description: Read back submitted transactions and their rule hits.
  - name: Rules
    description: Detection rules evaluated against every submission.
  - name: Alerts
    description: Alerts opened when a rule matches.
  - name: Investigations
    description: Cases opened from one or more alerts.
  - name: SARs
    description: Suspicious activity reports and their attachments.
  - name: Sanctions screening
    description: Sanctions and PEP screening of transaction parties.
  - name: AML monitoring
    description: Ongoing AML monitoring of screened parties.
  - name: Party suspensions
    description: ''
  - name: Webhooks
    description: Outbound event delivery to your endpoints.
  - name: Custom fields
    description: Your own transaction attributes, declared so rules can match them.
  - name: Reference lists
    description: Named value lists rules can reference.
  - name: Notification rules
    description: Slack and email notifications for alerts.
  - name: Reports
    description: Generated compliance reports.
paths:
  /api/v1/custom-fields/:
    post:
      tags:
        - Custom fields
      summary: Declare a custom field
      description: >-
        Declares one of your own transaction attributes, making it usable in
        rule conditions as `custom_field_<name>` and validated as its declared
        type on ingest.


        `appliesTo` scopes the field to one ingest surface or to all of them,
        and `isRequired` makes ingest reject a matching transaction that omits
        it — so declare it required only once your integration always sends it.
        Keys are matched ignoring case and stored under the spelling declared
        here, which is also the spelling rules must use.
      operationId: custom_fields_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomFieldWrite'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CustomFieldWrite'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CustomFieldWrite'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomFieldResponse'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CustomFieldWrite:
      type: object
      properties:
        partnerId:
          type: string
          writeOnly: true
          nullable: true
          description: >-
            Target partner id; honored only for multi-partner operators, ignored
            otherwise.
        name:
          type: string
          description: >-
            Name of the attribute. Rules match it as `custom_field_<name>`, and
            ingest stores it under this spelling whatever casing it arrives in.
            Must be unique for your account, ignoring case
          pattern: ^[A-Za-z_][A-Za-z0-9_]*$
          maxLength: 100
        fieldType:
          allOf:
            - $ref: '#/components/schemas/FieldTypeEnum'
          description: |-
            Type the value is validated and stored as on ingest

            * `STRING` - String
            * `NUMBER` - Number
            * `BOOLEAN` - Boolean
            * `DATE` - Date
        appliesTo:
          allOf:
            - $ref: '#/components/schemas/CustomFieldAppliesTo'
          description: |-
            Ingest surface this field applies to, or all of them

            * `ALL` - All
            * `BANK_PAYMENT` - Bank Payment
            * `CREDIT_CARD` - Credit Card
            * `CRYPTO_TRANSFER` - Crypto Transfer
            * `CUSTOM_EVENT` - Custom Event
        isRequired:
          type: boolean
          default: false
          description: >-
            Whether ingest rejects a matching transaction that omits this field.
            Declare it required only once your integration always sends it
        description:
          type: string
          nullable: true
          description: Your own note on what the field holds
          maxLength: 255
      required:
        - appliesTo
        - fieldType
        - name
    CustomFieldResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Primary key
        partnerId:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
          description: >-
            Field name; must match ^[A-Za-z_][A-Za-z0-9_]*$ and be unique per
            partner
        fieldType:
          allOf:
            - $ref: '#/components/schemas/FieldTypeEnum'
          readOnly: true
          description: |-
            Data type of the field value

            * `STRING` - String
            * `NUMBER` - Number
            * `BOOLEAN` - Boolean
            * `DATE` - Date
        appliesTo:
          allOf:
            - $ref: '#/components/schemas/CustomFieldAppliesTo'
          readOnly: true
          description: |-
            Ingest module this field applies to

            * `ALL` - All
            * `BANK_PAYMENT` - Bank Payment
            * `CREDIT_CARD` - Credit Card
            * `CRYPTO_TRANSFER` - Crypto Transfer
            * `CUSTOM_EVENT` - Custom Event
        isRequired:
          type: boolean
          readOnly: true
          description: Whether ingest must supply this field
        description:
          type: string
          readOnly: true
          nullable: true
          description: Optional human-readable description
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
      required:
        - appliesTo
        - createdAt
        - description
        - fieldType
        - id
        - isRequired
        - name
        - partnerId
        - updatedAt
    FieldTypeEnum:
      enum:
        - STRING
        - NUMBER
        - BOOLEAN
        - DATE
      type: string
      description: |-
        * `STRING` - String
        * `NUMBER` - Number
        * `BOOLEAN` - Boolean
        * `DATE` - Date
    CustomFieldAppliesTo:
      enum:
        - ALL
        - BANK_PAYMENT
        - CREDIT_CARD
        - CRYPTO_TRANSFER
        - CUSTOM_EVENT
      type: string
      description: |-
        * `ALL` - All
        * `BANK_PAYMENT` - Bank Payment
        * `CREDIT_CARD` - Credit Card
        * `CRYPTO_TRANSFER` - Crypto Transfer
        * `CUSTOM_EVENT` - Custom Event
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

## Related topics

- [Delete a custom field](https://documentation.idenfy.com/api-reference/transaction-monitoring/custom-fields/delete-a-custom-field.md)
- [List custom fields](https://documentation.idenfy.com/api-reference/transaction-monitoring/custom-fields/list-custom-fields.md)
- [Field Management](https://documentation.idenfy.com/guides/dashboard/general/field-management-individuals-companies.md)
- [Pre-Fill and Update](https://documentation.idenfy.com/kyb/pre-fill.md)
- [Custom Rule Blocklist](https://documentation.idenfy.com/guides/dashboard/risk/custom-rule-blocklist.md)


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