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

# Verify an email address

> Check that an email address accepts mail before you send to it

Use this endpoint to check an address you already have, from your CRM, a form
or a list, before sending to it. Pipecorn asks the recipient's mail server
whether the mailbox exists, without sending an email.

Emails that Pipecorn finds through [enrichment](https://docs.pipecorn.com/api-reference/endpoints/enrichments/single.md)
are already verified: you don't need to verify them again.

## Flow

1. Send the `email`, and optionally a `webhook_url`. The response comes back
   right away with `status: "pending"`, a `verification_id` and a `status_url`.
2. Pipecorn checks the address with several verifiers, cheapest first, and
   stops at the first one that is sure. A catch-all or unknown answer goes on
   to the next verifier.
3. Poll `status_url` ([Get an email verification](https://docs.pipecorn.com/api-reference/endpoints/contacts/verify_email_status.md))
   until `status` is `finished`, or wait for the webhook. Most checks finish
   within a minute.

```bash theme={null}
curl -X POST https://app.pipecorn.com/api/v2/contacts/verify_email \
  -H "X-API-Key: $PIPECORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "william.hewish@acme.com",
    "webhook_url": "https://example.com/pipecorn/verifications"
  }'
```

## Reading the result

| `deliverability` | What it means | What to do |
| - | - | - |
| `deliverable` | The mailbox exists and accepts mail. | Send. |
| `catch_all` | The domain accepts mail for every address, so this one can't be confirmed. | Send with care: it may bounce. |
| `undeliverable` | The mailbox does not exist or rejects mail. | Don't send. Find another address with [enrichment](https://docs.pipecorn.com/api-reference/endpoints/enrichments/single.md). |
| `unknown` | No verifier could tell. | Retry later. It cost nothing. |

`disposable`, `role_based` and `free_provider` flag throwaway addresses, shared
mailboxes such as `sales@`, and free providers such as Gmail. They, `score`
and `catch_all_domain` are `null` when the verifier that answered does not
report them.

## Credits

A verification costs 1 enrichment credit when it ends `deliverable`,
`catch_all` or `undeliverable`, charged when it finishes. An `unknown` result
is free. `credits_charged` says what it cost.

## Rate limits

* **60 requests per minute** per user. This endpoint is exempt from your plan's
  per-minute limit (see [Rate Limiting](https://docs.pipecorn.com/essentials/rate-limiting.md)).


## OpenAPI

````yaml api-reference/specs/enrichments.json POST /contacts/verify_email
openapi: 3.0.1
info:
  title: Pipecorn Enrichments API
  description: Pipecorn List API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /contacts/verify_email:
    post:
      summary: Verify an email address
      description: >-
        Check whether an email address accepts mail before you send to it,
        without enriching a contact.


        **How it works:** the request answers `202` right away with a
        `verification_id` and a `status_url`. Pipecorn then checks the address
        with several verifiers, cheapest first, and stops at the first one that
        says `deliverable` or `undeliverable`. A `catch_all` or `unknown` answer
        goes on to the next verifier; when none is sure, the best answer is kept
        (`catch_all` over `unknown`). Most checks finish within a minute; a slow
        mail server can take a few minutes.


        **Result:** poll `status_url` ([`GET
        /contacts/verify_email/{id}`](/api-reference/endpoints/contacts/verify_email_status))
        until `status` is `finished`, or send a `webhook_url`: when the check
        ends, Pipecorn POSTs the same body to it.


        **Statuses:** `deliverable`: the mailbox exists and accepts mail.
        `catch_all`: the server accepts every address at the domain, so this one
        can't be confirmed; sending is a risk. `undeliverable`: the mailbox does
        not exist or rejects mail; don't send to it. `unknown`: no verifier
        could tell; try again later.


        **Credits:** 1 enrichment credit per verification that ends
        `deliverable`, `catch_all` or `undeliverable`, charged when it finishes.
        An `unknown` result is free. The balance must cover 1 credit when you
        send the request; if it runs out before the check ends, the verification
        ends `failed`.


        **Rate limit:** 60 requests per minute per user. The endpoint is exempt
        from your plan's per-minute limit.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                  description: The address to verify, work or personal. Case-insensitive.
                  example: william.hewish@acme.com
                webhook_url:
                  type: string
                  format: uri
                  description: >-
                    Where to POST the result when the check ends. Same body as
                    `GET /contacts/verify_email/{id}`.
      responses:
        '202':
          description: The check started
          headers:
            Location:
              description: The verification's status URL
              schema:
                type: string
                format: uri
          content:
            application/json:
              schema:
                type: object
                properties:
                  verification_id:
                    type: string
                    format: uuid
                    description: >-
                      The verification's ID, for `GET
                      /contacts/verify_email/{id}`
                  status:
                    type: string
                    enum:
                      - pending
                      - finished
                      - failed
                    description: >-
                      `pending` while the check runs, `finished` once the result
                      is in, `failed` when it could not be charged (see
                      `error`).
                  email:
                    type: string
                    format: email
                    description: The address being verified, lowercased
                  deliverability:
                    type: string
                    nullable: true
                    enum:
                      - deliverable
                      - catch_all
                      - undeliverable
                      - unknown
                      - null
                    description: >-
                      `deliverable`: the mailbox accepts mail. `catch_all`: the
                      domain accepts every address, so this one can't be
                      confirmed. `undeliverable`: the mailbox does not exist or
                      rejects mail. `unknown`: no verifier could tell. `null`
                      until `status` is `finished`.
                  score:
                    type: integer
                    nullable: true
                    minimum: 0
                    maximum: 100
                    description: >-
                      Confidence that mail sent to the address is delivered,
                      from 0 to 100, when the verifier gives one
                  catch_all_domain:
                    type: boolean
                    nullable: true
                    description: >-
                      `true` when the domain's server accepts mail for any
                      address. `null` when not known
                  disposable:
                    type: boolean
                    nullable: true
                    description: >-
                      `true` for a throwaway address from a disposable email
                      service. `null` when not known
                  role_based:
                    type: boolean
                    nullable: true
                    description: >-
                      `true` for a shared mailbox such as `sales@` or
                      `support@`. `null` when not known
                  free_provider:
                    type: boolean
                    nullable: true
                    description: >-
                      `true` for a free mailbox provider such as Gmail or
                      Outlook.com. `null` when not known
                  mx_records:
                    type: array
                    nullable: true
                    items:
                      type: string
                    description: The domain's mail servers, when known
                  smtp_provider:
                    type: string
                    nullable: true
                    description: >-
                      Who hosts the domain's email, such as `Google` or
                      `Microsoft`, when known
                  verified_at:
                    type: string
                    nullable: true
                    format: date-time
                    description: When the address was checked
                  credits_charged:
                    type: integer
                    enum:
                      - 0
                      - 1
                    description: >-
                      Credits this verification cost: `1` for a verdict, `0` for
                      `unknown` or while it runs
                  error:
                    type: string
                    nullable: true
                    description: Why the verification failed. `null` otherwise
                  status_url:
                    type: string
                    format: uri
                    description: >-
                      `GET /contacts/verify_email/{id}` for this verification.
                      Also in the `Location` header
              example:
                verification_id: 3f6b2c1e-8d4a-4b7e-9c2f-5a1d0e7b6c48
                status: pending
                email: william.hewish@acme.com
                deliverability: null
                score: null
                catch_all_domain: null
                disposable: null
                role_based: null
                free_provider: null
                mx_records: null
                smtp_provider: null
                verified_at: null
                credits_charged: 0
                error: null
                status_url: >-
                  https://app.pipecorn.com/api/v2/contacts/verify_email/3f6b2c1e-8d4a-4b7e-9c2f-5a1d0e7b6c48
        '400':
          description: >-
            `email` is missing or is not a valid address, or `webhook_url` is
            not an HTTP URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Invalid email
        '402':
          description: >-
            Not enough enrichment credits for a 1-credit verification. Returned
            before the check starts, so nothing is spent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditsError'
              example:
                error: Not enough enrichment credits left
                code: insufficient_credits
                top_up_url: https://app.pipecorn.com/settings/subscriptions/credits
        '403':
          description: >-
            The workspace weekly enrichment credit limit is reached, or your
            workspace role can't enrich. Buying credits does not lift the limit,
            so no `top_up_url` is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceLimitError'
              example:
                error: >-
                  You have reached your weekly enrichment credit limit for this
                  workspace
                code: workspace_limit_exceeded
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '429':
          description: >-
            Rate limit exceeded: 60 requests per minute per user. The request is
            refused before the check starts, so nothing is spent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Rate limit exceeded. Please wait before retrying.
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        A unique value you generate per operation, such as a UUID. Retrying with
        the same key and the same body returns the stored response instead of
        running the request again, so a retry after a timeout never charges
        twice. Successful responses are kept for 24 hours; a failed request is
        not stored and can be retried with the same key.
      schema:
        type: string
        maxLength: 255
        example: 4f1c2e9a-8a7d-4c1b-9f63-2d6e0b5a7c11
  schemas:
    Error:
      required:
        - error
      type: object
      properties:
        error:
          description: >-
            Human-readable error message. A few validation errors return a list
            of messages instead of a single string.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        message:
          type: string
          description: >-
            Longer explanation, sent by validators that add context. Such errors
            may also carry extra top-level keys like `valid_values` or
            `example`.
        details:
          type: string
          description: >-
            Parser message, sent with `"Invalid JSON format in request body"`
            when the request body is not valid JSON.
    InsufficientCreditsError:
      required:
        - error
        - code
        - top_up_url
      type: object
      properties:
        error:
          type: string
          description: >-
            Human-readable message. Endpoints priced per result report the
            shortfall instead, e.g. "Not enough enrichment credits. You need 30
            credits but only have 5 available."
          example: Not enough enrichment credits left
        code:
          type: string
          enum:
            - insufficient_credits
          description: Machine-readable error code
        top_up_url:
          type: string
          format: uri
          description: >-
            Absolute URL of the credits page. Buy credits there, then replay the
            request.
          example: https://app.pipecorn.com/settings/subscriptions/credits
    WorkspaceLimitError:
      required:
        - error
        - code
      type: object
      properties:
        error:
          type: string
          example: >-
            You have reached your weekly enrichment credit limit for this
            workspace
        code:
          type: string
          enum:
            - workspace_limit_exceeded
          description: >-
            Machine-readable error code. A 403 without this code is not a
            spending limit: the account is closed, LinkedIn refused access to
            the resource, or the plan does not include the endpoint.
  responses:
    IdempotencyConflict:
      description: >-
        A request with this `Idempotency-Key` is still being processed. Wait for
        the `Retry-After` delay and retry with the same key.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              code:
                type: string
                enum:
                  - idempotency_key_in_use
          example:
            error: A request with this Idempotency-Key is still being processed
            code: idempotency_key_in_use
  headers:
    Retry-After:
      description: >-
        Seconds to wait before retrying. Sent when the plan limit or a request
        still in progress caused the error.
      schema:
        type: integer
        example: 42
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      description: Your API key
      name: X-API-KEY

````

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