External API docs

Check deny rules

Look up whether specific emails or phone numbers are currently blocked by your deny rules.

Overview

Use this endpoint to confirm which values are currently denied for your API key. The response maps each requested value to true (actively denied) or false (no rule). Useful as a pre-flight check, or for reconciling a local cache against server state.

The server always returns one entry per requested value, so you don’t need to special-case missing keys.

Before you start

Make sure you have:

  • an Openmart account
  • an API key
  • a tool to send API requests, such as Postman or curl

Authentication: send your key in the X-API-Key header. Authorization: Bearer <key> is also accepted. Deny rules are scoped per-user (per-key), so rules you create only apply to your own enrichment requests.

1

Example: Check two email addresses

Endpoint
POST https://api.openmart.ai/api/v2/deny-rules/check

Parameters

Parameter
type
Type
string (enum)
Required
Yes
Example
"email"
Description
Identifier kind. Must be exactly "email" or "phone"; any other value returns 400 detail:"Type must be one of [email phone]".
Parameter
values
Type
array[string]
Required
Yes
Example
["blocked@example.com"]
Description
Literal identifiers to add, remove, or check. Emails are matched case-insensitively at lookup time. Phones should be E.164 formatted.

cURL request

cURL
curl --request POST \
  --url https://api.openmart.ai/api/v2/deny-rules/check \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "type": "email",
    "values": ["blocked@example.com", "ok@example.com"]
  }'

Response example

JSON
{
  "denied": {
    "blocked@example.com": true,
    "ok@example.com": false
  }
}

Key elements of the API response

Response element
denied
Description
Object keyed by each requested value. The value is true if there is a matching active deny rule for your API key, false otherwise.
Response element
denied[<value>]
Description
One entry per input value. The server always populates every requested value, so the result has the same size as the request’s values array.

All request parameters

Request body for POST /api/v2/deny-rules/check. Same shape as create and delete.

Request body

All three deny-rules endpoints (create, delete, check) share the same body shape.

typestring (enum)Required: Yes
Example: "email"

Identifier kind. Allowed: "email", "phone". Validated via binding:"required,oneof=email phone" — invalid values return HTTP 400 with {"detail":"Type must be one of [email phone]"}.

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v2/deny-rules \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '{"type":"email","values":["blocked@example.com"]}'
valuesarray[string]Required: Yes
Example: ["blocked@example.com","spam@example.com"]

One or more literal identifiers. No wildcards. Rules are scoped per-user (via your API key), so another team’s rules do not affect you.

cURL example
cURL
curl --request POST \
  --url https://api.openmart.ai/api/v2/deny-rules \
  --header 'Accept: application/json' \
  --header 'X-API-Key: <your_api_key>' \
  --header 'Content-Type: application/json' \
  --data '{"type":"email","values":["blocked@example.com","spam@example.com"]}'
# Check Deny Rules

## Endpoint

POST https://api.openmart.ai/api/v2/deny-rules/check

## Description

Look up whether specific values are currently denied for your API key.
The server always returns one entry per requested value, so the output
map has the same size as the input `values` array.

## Authentication

- `X-API-Key: <your_api_key>` (recommended)
- `Authorization: Bearer <your_api_key>` (also accepted)

## Request body

```json
{
  "type":   "email",
  "values": ["a@x.com", "b@y.com"]
}
```

Same shape as create and delete.

## Example Request

```bash
curl -X POST "https://api.openmart.ai/api/v2/deny-rules/check" \
  -H "Accept: application/json" \
  -H "X-API-Key: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{"type": "email", "values": ["blocked@example.com", "ok@example.com"]}'
```

## Example Response

```json
{
  "denied": {
    "blocked@example.com": true,
    "ok@example.com": false
  }
}
```

## Errors

- 400 — bad JSON or bad `type` (`{"detail":"..."}`)
- 401 — missing or invalid API key
- 500 — persistence read failure