# Create tags rule

Creates a tags rule.

Endpoint: POST /tags-rules
Version: latest
Security: SecretApiKey, JWT

## Security:

  - `SecretApiKey` (unknown)
    apiKey in header REB-APIKEY

  - `JWT` (unknown)
    http bearer JWT

## Request body:

  - `application/json` (unknown)
    Tags rule resource.

## Request fields (application/json):

  - `name` (string, required)
    Name of the rule.

  - `eventType` (string, required)
    Type of event.
    Enum: "aml-list-possibly-matched", "application-instance-disabled", "application-instance-enabled", "autodeposit-lookup-performed", "balance-transaction-settled", "coupon-application-removed", "coupon-applied", "coupon-expiration-modified", "coupon-expired", "coupon-issued", "coupon-modified", "coupon-redeemed", "coupon-redemption-canceled", "credit-memo-applied", "credit-memo-created", "credit-memo-modified", "credit-memo-partially-applied", "credit-memo-voided", "customer-created", "customer-merged", "customer-one-time-password-requested", "customer-redirected-offsite", "customer-returned", "customer-tax-number-validated", "customer-updated", "data-export-completed", "data-export-failed", "dispute-created", "dispute-modified", "experian-check-performed", "gateway-account-downtime-ended", "gateway-account-downtime-started", "gateway-account-limit-reached", "gateway-account-onboarding-completed", "gateway-account-onboarding-failed", "gateway-account-requested", "hard-usage-limit-reached", "invoice-abandoned", "invoice-created", "invoice-issued", "invoice-modified", "invoice-paid", "invoice-partially-paid", "invoice-partially-refunded", "invoice-past-due", "invoice-past-due-reminder", "invoice-refunded", "invoice-reissued", "invoice-tax-calculation-failed", "invoice-voided", "kyc-document-accepted", "kyc-document-archived", "kyc-document-created", "kyc-document-modified", "kyc-document-rejected", "kyc-document-reviewed", "kyc-request-attempted", "kyc-request-failed", "kyc-request-fulfilled", "kyc-request-partially-fulfilled", "lead-source-changed", "offsite-payment-completed", "order-abandon-reminder", "order-abandoned", "order-completed", "order-delinquency-reached", "organization-tax-number-validated", "payment-card-created", "payment-card-expiration-reminder", "payment-card-expired", "payment-instrument-modified", "payout-request-canceled", "payout-request-created", "payout-request-fulfilled", "payout-request-modified", "quote-accepted", "quote-canceled", "quote-created", "quote-expired", "quote-issued", "quote-recalled", "quote-rejected", "quote-updated", "ready-to-pay-requested", "renewal-invoice-issued", "renewal-invoice-payment-canceled", "renewal-invoice-payment-declined", "risk-score-changed", "soft-usage-limit-reached", "subscription-activated", "subscription-canceled", "subscription-churned", "subscription-created", "subscription-downgraded", "subscription-items-changed", "subscription-modified", "subscription-pause-created", "subscription-pause-modified", "subscription-pause-revoked", "subscription-paused", "subscription-quantity-filled-limit-reached", "subscription-reactivated", "subscription-renewal-reminder", "subscription-renewed", "subscription-resumed", "subscription-trial-converted", "subscription-trial-end-reminder", "subscription-trial-ended", "subscription-upgraded", "transaction-amount-discrepancy-found", "transaction-declined", "transaction-discrepancy-found", "transaction-process-requested", "transaction-processed", "transaction-reconciled", "transaction-partially-refunded", "transaction-refunded", "transaction-timeout-resolved", "transaction-voided", "trial-usage-limit-reached", "waiting-gateway-transaction-completed"

  - `filter` (string | null)
    Filter that determines whether to tag or untag.
This field requires a special format.
Use `,` for multiple allowed values.
Use `;` for multiple fields.
For more information,
see [Using filters](https://api-reference.rebilly.com/#section/Using-filter-with-collections).

  - `addTags` (array, required)
    List of tags to add to the customer.

  - `removeTags` (array, required)
    List of tags to remove for the customer.

  - `status` (string)
    Status of the rule.
    Enum: "active", "inactive"

## Response 201:

  - `201` (unknown)
    Tags rule created.

## Response 201 fields (application/json):

  - `id` (string)
    ID of the rule.
    Example: tag_rule_0YVCEE5APAD7V84MK3P9CCJVYY

  - `name` (string, required)
    Name of the rule.

  - `eventType` (string, required)
    Type of event.
    Enum: "aml-list-possibly-matched", "application-instance-disabled", "application-instance-enabled", "autodeposit-lookup-performed", "balance-transaction-settled", "coupon-application-removed", "coupon-applied", "coupon-expiration-modified", "coupon-expired", "coupon-issued", "coupon-modified", "coupon-redeemed", "coupon-redemption-canceled", "credit-memo-applied", "credit-memo-created", "credit-memo-modified", "credit-memo-partially-applied", "credit-memo-voided", "customer-created", "customer-merged", "customer-one-time-password-requested", "customer-redirected-offsite", "customer-returned", "customer-tax-number-validated", "customer-updated", "data-export-completed", "data-export-failed", "dispute-created", "dispute-modified", "experian-check-performed", "gateway-account-downtime-ended", "gateway-account-downtime-started", "gateway-account-limit-reached", "gateway-account-onboarding-completed", "gateway-account-onboarding-failed", "gateway-account-requested", "hard-usage-limit-reached", "invoice-abandoned", "invoice-created", "invoice-issued", "invoice-modified", "invoice-paid", "invoice-partially-paid", "invoice-partially-refunded", "invoice-past-due", "invoice-past-due-reminder", "invoice-refunded", "invoice-reissued", "invoice-tax-calculation-failed", "invoice-voided", "kyc-document-accepted", "kyc-document-archived", "kyc-document-created", "kyc-document-modified", "kyc-document-rejected", "kyc-document-reviewed", "kyc-request-attempted", "kyc-request-failed", "kyc-request-fulfilled", "kyc-request-partially-fulfilled", "lead-source-changed", "offsite-payment-completed", "order-abandon-reminder", "order-abandoned", "order-completed", "order-delinquency-reached", "organization-tax-number-validated", "payment-card-created", "payment-card-expiration-reminder", "payment-card-expired", "payment-instrument-modified", "payout-request-canceled", "payout-request-created", "payout-request-fulfilled", "payout-request-modified", "quote-accepted", "quote-canceled", "quote-created", "quote-expired", "quote-issued", "quote-recalled", "quote-rejected", "quote-updated", "ready-to-pay-requested", "renewal-invoice-issued", "renewal-invoice-payment-canceled", "renewal-invoice-payment-declined", "risk-score-changed", "soft-usage-limit-reached", "subscription-activated", "subscription-canceled", "subscription-churned", "subscription-created", "subscription-downgraded", "subscription-items-changed", "subscription-modified", "subscription-pause-created", "subscription-pause-modified", "subscription-pause-revoked", "subscription-paused", "subscription-quantity-filled-limit-reached", "subscription-reactivated", "subscription-renewal-reminder", "subscription-renewed", "subscription-resumed", "subscription-trial-converted", "subscription-trial-end-reminder", "subscription-trial-ended", "subscription-upgraded", "transaction-amount-discrepancy-found", "transaction-declined", "transaction-discrepancy-found", "transaction-process-requested", "transaction-processed", "transaction-reconciled", "transaction-partially-refunded", "transaction-refunded", "transaction-timeout-resolved", "transaction-voided", "trial-usage-limit-reached", "waiting-gateway-transaction-completed"

  - `filter` (string | null)
    Filter that determines whether to tag or untag.
This field requires a special format.
Use `,` for multiple allowed values.
Use `;` for multiple fields.
For more information,
see [Using filters](https://api-reference.rebilly.com/#section/Using-filter-with-collections).

  - `addTags` (array, required)
    List of tags to add to the customer.

  - `removeTags` (array, required)
    List of tags to remove for the customer.

  - `status` (string)
    Status of the rule.
    Enum: "active", "inactive"

  - `createdTime` (string)
    Date and time when the resource is created.
This value is set automatically when the resource is created.

  - `updatedTime` (string)
    Date and time when the resource is updated.
This value is set automatically when the resource is updated.

  - `_links` (array)
    Related resource links.

  - `_links.href` (string)
    Link URL.

  - `_links.rel` (string)
    Type of link.
    Enum: "self"

## Response 201 headers (application/json):

  - `Location` (string)
    Location of the related resource.
    Example: https://api.rebilly.com/example

  - `X-RateLimit-Limit` (integer)
    Total number of rate limit tokens for this request within a rate limit period.
For more information, see [Rate limits](#section/Rate-limits).
    Example: 3600

  - `X-RateLimit-Remaining` (integer)
    Remaining number of rate limit tokens for this request within the rate limit period. 
For example, in the sandbox environment, rate limits for non-GET endpoints are set at 3000 requests per 10 minutes.
    Example: 3600

## Response 401:

  - `401` (unknown)
    Unauthorized access.
Invalid credentials used.

## Response 401 fields (application/json):

  - `status` (integer)
    HTTP status code.

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

## Response 403:

  - `403` (unknown)
    Access forbidden.

## Response 403 fields (application/json):

  - `status` (integer)
    HTTP status code.

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

## Response 422:

  - `422` (unknown)
    Invalid data sent.

## Response 422 fields (application/json):

  - `status` (integer)
    HTTP status code.

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

  - `invalidFields` (array)
    Invalid field details.
    Example: [{"field":"field1","message":"field1 is invalid"},{"field":"subObject.field2","message":"field2 is invalid"},{"field":"subObject.field2","message":"another error in the field2"}]

  - `invalidFields.field` (string)
    Name of the field.
Dot notation is used for nested object field names.

  - `invalidFields.message` (string)
    Message field.

## Response 429:

  - `429` (unknown)
    Request rate limit exceeded.

## Response 429 fields (application/json):

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".
    Example: about:blank

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.
    Example: Rate Limit Exceeded

  - `status` (integer)
    HTTP status code.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.
    Example: A request cannot be executed because the user has sent too many requests within a certain period of time

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

## Response 429 headers (application/json):

  - `X-RateLimit-Retry-After` (integer)
    UTC timestamp after which the rate limit resets and the request can be retried.
    Example: 1713187500

