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

# Create a country block

> Blocks or quarantines mail by country. `match_type` chooses the signal: `ip` is the connecting server (GeoIP; mail relayed through a provider in that country is blocked too), `tld` is the sender domain's country-code TLD, `any` is either. Received headers are never consulted.



## OpenAPI

````yaml /openapi.json post /inbound/filters/country-blocks
openapi: 3.0.0
info:
  title: JetEmail API
  version: 1.0.0
  description: API documentation for JetEmail's transactional email service.
servers:
  - url: https://api.jetemail.com
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Email
    description: Send transactional email
  - name: Outbound
    description: 'Outbound sending: keys, SMTP users, domains, logs, suppression'
  - name: Inbound
    description: Inbound routing, domains and forward destinations
  - name: DMARC
    description: DMARC aggregate-report domain setup, DNS verification and analytics
  - name: Marketing
    description: >-
      Marketing suite: templates, audiences, contacts, broadcasts, themes,
      assets and signup forms
  - name: Signup Forms
    description: Hosted signup pages and form submissions
externalDocs:
  description: Download OpenAPI Specification
  url: /openapi.json
paths:
  /inbound/filters/country-blocks:
    post:
      tags:
        - Inbound
      summary: Create a country block
      description: >-
        Blocks or quarantines mail by country. `match_type` chooses the signal:
        `ip` is the connecting server (GeoIP; mail relayed through a provider in
        that country is blocked too), `tld` is the sender domain's country-code
        TLD, `any` is either. Received headers are never consulted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - country
              properties:
                country:
                  type: string
                  example: RU
                  description: ISO 3166-1 alpha-2, uppercase
                match_type:
                  type: string
                  enum:
                    - ip
                    - tld
                    - any
                  default: any
                action:
                  type: string
                  enum:
                    - DENY
                    - QUARANTINE
                  default: DENY
                domain:
                  type: string
                  nullable: true
                  description: Recipient domain to scope to. Omit for the whole account.
                enabled:
                  type: boolean
                  default: true
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  uuid:
                    type: string
                    format: uuid
                  rule:
                    $ref: '#/components/schemas/CountryBlock'
        '400':
          description: Validation error
        '401':
          description: Unauthorized
        '403':
          description: Domain is owned by another account
        '404':
          description: Domain not found
        '409':
          description: An identical block already exists
components:
  schemas:
    CountryBlock:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        userId:
          type: string
          nullable: true
        organizationId:
          type: string
          nullable: true
        domain:
          type: string
          nullable: true
          description: >-
            Recipient domain the block is scoped to, or null for the whole
            account
        country:
          type: string
          example: RU
          description: ISO 3166-1 alpha-2
        match_type:
          type: string
          enum:
            - ip
            - tld
            - any
        action:
          type: string
          enum:
            - DENY
            - QUARANTINE
        enabled:
          type: integer
          enum:
            - 0
            - 1
        created_at:
          type: integer
          description: Unix seconds
        last_modified:
          type: integer
          description: Unix seconds
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: API key for account management endpoints. Use your api_ prefixed token.

````

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