openapi: 3.1.0
info:
  title: InboxFound API
  version: "1"
  description: |
    Find a person's work email from a name and a company domain, or verify an
    address you already have. Every submission is asynchronous: you receive a
    job at once and poll it until `execution_state` is terminal.

    Base URL: `https://inboxfound.com`.
  contact:
    email: jarvis@newbizbot.ai
servers:
  - url: https://inboxfound.com
    description: Production
security:
  - apiKey: []
tags:
  - name: Lookups
    description: Submit work and read results.
  - name: Account
    description: Read your wallet.

paths:
  /api/v1/verify:
    post:
      tags: [Lookups]
      operationId: verify
      summary: Verify an email address
      description: |
        Ask the receiving mail host whether one specific mailbox is accepted.
        On an accept-all domain, where SMTP acceptance proves nothing, an
        identity lane looks for a real account profile behind the exact
        address.

        Charged only for a definite `valid` or `invalid`. Catch-all without
        identity evidence, unknown and every failure mode are released.
      parameters:
        - $ref: "#/components/parameters/IdempotencyKey"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [email]
              additionalProperties: false
              properties:
                email:
                  type: string
                  format: email
                  maxLength: 254
                  example: r.okafor@example.com
      responses:
        "202":
          description: Job accepted. Poll `GET /api/v1/jobs/{id}`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Job"
              example:
                id: 3f6b1c2e-8d47-4a0b-9e21-6c5d4b3a2f10
                operation: verify
                execution_state: queued
                billing: reserved
                charged_micros: 0
                rate_micros: 2000
                result: null
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "402": { $ref: "#/components/responses/InsufficientFunds" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "409": { $ref: "#/components/responses/Conflict" }
        "429": { $ref: "#/components/responses/RateLimited" }
        "503": { $ref: "#/components/responses/Unavailable" }

  /api/v1/verify/batch:
    post:
      tags: [Lookups]
      operationId: verifyBatch
      summary: Verify up to 1,000 email addresses
      description: |
        Admit up to 1,000 email verification jobs under one authentication check
        (max 1 MB request body). Each item supplies its own `key` (16–100
        chars, same idempotency rules as `Idempotency-Key`). Existing keys with
        matching inputs replay their original jobs before new items consume
        rate limits or funds. Per-item validation, conflict, capacity or
        balance failures are returned inline without aborting valid items.
        Poll returned job IDs with `POST /api/v1/jobs/batch`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [jobs]
              additionalProperties: false
              properties:
                jobs:
                  type: array
                  minItems: 1
                  maxItems: 1000
                  items:
                    type: object
                    required: [key, email]
                    additionalProperties: false
                    properties:
                      key:
                        type: string
                        minLength: 16
                        maxLength: 100
                        pattern: "^[a-zA-Z0-9_-]{16,100}$"
                        example: 4f1d9c2a-7b30-4a11-9f5e-2c8d6a0b3e77
                      email:
                        type: string
                        format: email
                        maxLength: 254
                        example: r.okafor@example.com
      responses:
        "202":
          description: Per-item admission results in request order.
          content:
            application/json:
              schema:
                type: object
                required: [results]
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      required: [key, email, job, error]
                      properties:
                        key: { type: string }
                        email: { type: [string, "null"] }
                        job:
                          oneOf:
                            - $ref: "#/components/schemas/Job"
                            - type: "null"
                        error: { type: [string, "null"] }
              example:
                results:
                  - key: 4f1d9c2a-7b30-4a11-9f5e-2c8d6a0b3e77
                    email: r.okafor@example.com
                    job:
                      id: 3f6b1c2e-8d47-4a0b-9e21-6c5d4b3a2f10
                      operation: verify
                      execution_state: queued
                      billing: reserved
                      charged_micros: 0
                      rate_micros: 2000
                      result: null
                    error: null
                  - key: 9a2e4b1c-3d58-4f6a-8c01-7e2b9d4f1a88
                    email: null
                    job: null
                    error: invalid_email
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "413": { $ref: "#/components/responses/TooLarge" }
        "429": { $ref: "#/components/responses/RateLimited" }
        "503": { $ref: "#/components/responses/Unavailable" }

  /api/v1/find:
    post:
      tags: [Lookups]
      operationId: find
      summary: Find a person's email address
      description: |
        Give a full name and the domain the company receives mail at. We try
        the likely address formats for that name, ask the mail host about each,
        and return the one that qualifies.

        Charged only when exactly one candidate qualifies (`status: "found"`).
        Ambiguous, not-found and every failure mode are released.
      parameters:
        - $ref: "#/components/parameters/IdempotencyKey"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [name, domain]
              additionalProperties: false
              properties:
                name:
                  type: string
                  minLength: 2
                  maxLength: 160
                  description: Full name as the company would write it.
                  example: Rachel Okafor
                domain:
                  type: string
                  maxLength: 254
                  description: Bare domain, no scheme or path.
                  example: example.com
      responses:
        "202":
          description: Job accepted. Poll `GET /api/v1/jobs/{id}`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Job"
              example:
                id: b7d2e9a4-1c3f-4e8a-a5b6-2d9f0c1e7a34
                operation: find
                execution_state: queued
                billing: reserved
                charged_micros: 0
                rate_micros: 8000
                result: null
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "402": { $ref: "#/components/responses/InsufficientFunds" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "409": { $ref: "#/components/responses/Conflict" }
        "429": { $ref: "#/components/responses/RateLimited" }
        "503": { $ref: "#/components/responses/Unavailable" }

  /api/v1/find/batch:
    post:
      tags: [Lookups]
      operationId: findBatch
      summary: Find up to 1,000 email addresses
      description: |
        Admit up to 1,000 email find jobs under one authentication check (max
        1 MB request body). Each item supplies its own `key` (16–100 chars,
        same idempotency rules as `Idempotency-Key`), `name`, and bare company
        `domain`. Existing keys with matching inputs replay their original jobs
        before new items consume rate limits or funds. Per-item validation,
        personal-domain rejection, conflict, capacity or balance failures are
        returned inline without aborting valid items. Poll returned job IDs
        with `POST /api/v1/jobs/batch`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [jobs]
              additionalProperties: false
              properties:
                jobs:
                  type: array
                  minItems: 1
                  maxItems: 1000
                  items:
                    type: object
                    required: [key, name, domain]
                    additionalProperties: false
                    properties:
                      key:
                        type: string
                        minLength: 16
                        maxLength: 100
                        pattern: "^[a-zA-Z0-9_-]{16,100}$"
                        example: 7c3a2d1e-5f40-4b92-8a11-0e6c4b2a9f55
                      name:
                        type: string
                        minLength: 2
                        maxLength: 160
                        example: Rachel Okafor
                      domain:
                        type: string
                        maxLength: 254
                        example: example.com
      responses:
        "202":
          description: Per-item admission results in request order.
          content:
            application/json:
              schema:
                type: object
                required: [results]
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      required: [key, name, domain, job, error]
                      properties:
                        key: { type: string }
                        name: { type: [string, "null"] }
                        domain: { type: [string, "null"] }
                        job:
                          oneOf:
                            - $ref: "#/components/schemas/Job"
                            - type: "null"
                        error: { type: [string, "null"] }
              example:
                results:
                  - key: 7c3a2d1e-5f40-4b92-8a11-0e6c4b2a9f55
                    name: Rachel Okafor
                    domain: example.com
                    job:
                      id: b7d2e9a4-1c3f-4e8a-a5b6-2d9f0c1e7a34
                      operation: find
                      execution_state: queued
                      billing: reserved
                      charged_micros: 0
                      rate_micros: 8000
                      result: null
                    error: null
                  - key: 1b8f5e2c-9a04-4d77-b312-6f4a8e1c5d90
                    name: Sam Patel
                    domain: gmail.com
                    job: null
                    error: personal_provider_find_not_supported
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "413": { $ref: "#/components/responses/TooLarge" }
        "429": { $ref: "#/components/responses/RateLimited" }
        "503": { $ref: "#/components/responses/Unavailable" }

  /api/v1/jobs/{id}:
    get:
      tags: [Lookups]
      operationId: getJob
      summary: Read a job
      description: |
        Returns the job's execution state, billing state and result. Checking
        status is free and may advance a pending lookup. Poll every few seconds
        until `execution_state` is `complete` or `incomplete`.
      parameters:
        - name: id
          in: path
          required: true
          schema: { type: string, format: uuid }
      responses:
        "200":
          description: The job.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Job"
              examples:
                verify:
                  summary: Verify, complete
                  value:
                    id: 3f6b1c2e-8d47-4a0b-9e21-6c5d4b3a2f10
                    operation: verify
                    execution_state: complete
                    billing: charged
                    charged_micros: 2000
                    rate_micros: 2000
                    result:
                      operation: verify
                      email: r.okafor@example.com
                      status: valid
                      reason: recipient_accepted
                      provider: google
                      domain: example.com
                      catch_all: false
                      role: false
                      free: false
                      disposable: false
                      retryable: false
                      checked_at: "2026-09-14T10:02:41.000Z"
                find:
                  summary: Find, complete
                  value:
                    id: b7d2e9a4-1c3f-4e8a-a5b6-2d9f0c1e7a34
                    operation: find
                    execution_state: complete
                    billing: charged
                    charged_micros: 8000
                    rate_micros: 8000
                    result:
                      operation: find
                      email: r.okafor@example.com
                      status: found
                      reason: qualified
                      confidence: high
                      mailbox: valid
                      provider: microsoft
                      domain: example.com
                      role: false
                      free: false
                      disposable: false
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }

  /api/v1/jobs/batch:
    post:
      tags: [Lookups]
      operationId: getJobsBatch
      summary: Read up to 20 jobs
      description: |
        Read and advance up to 20 owned jobs in one authenticated request.
        Results are returned in the exact order requested (including duplicate
        IDs). Every ID must belong to your account and match your key's scope,
        or the entire request is refused before any job is advanced.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [ids]
              additionalProperties: false
              properties:
                ids:
                  type: array
                  minItems: 1
                  maxItems: 20
                  items:
                    type: string
                    format: uuid
      responses:
        "200":
          description: Jobs in request order.
          content:
            application/json:
              schema:
                type: object
                required: [jobs]
                properties:
                  jobs:
                    type: array
                    items:
                      $ref: "#/components/schemas/Job"
        "400": { $ref: "#/components/responses/BadRequest" }
        "401": { $ref: "#/components/responses/Unauthorized" }
        "403": { $ref: "#/components/responses/Forbidden" }
        "404": { $ref: "#/components/responses/NotFound" }
        "429": { $ref: "#/components/responses/RateLimited" }

  /api/v1/account:
    get:
      tags: [Account]
      operationId: getAccount
      summary: Read your wallet, live rates, and key scopes
      description: Live available balance in micro-dollars, current find/verify rates, lookup estimates, effective API key scopes, and Auto top-up status. Free and safe to use as an agent pre-flight check.
      responses:
        "200":
          description: Live wallet and key snapshot.
          content:
            application/json:
              schema:
                type: object
                required: [id, currency, availableMicros, purchasedMicros, reservedMicros, estimates, rates, scopes, autoTopUpEnabled, checkedAt]
                properties:
                  id: { type: string }
                  currency: { type: string, example: USD }
                  availableMicros: { type: integer, description: Spendable now, promotional plus purchased. }
                  purchasedMicros: { type: integer }
                  reservedMicros: { type: integer, description: Held against jobs in flight. }
                  estimates:
                    type: object
                    properties:
                      finds: { type: integer }
                      verifies: { type: integer }
                  rates:
                    type: object
                    properties:
                      findMicros: { type: integer, example: 8000 }
                      verifyMicros: { type: integer, example: 2000 }
                      findChargingEnabled: { type: boolean, example: true }
                  scopes:
                    type: array
                    items: { type: string, enum: [find, verify] }
                  autoTopUpEnabled: { type: boolean }
                  checkedAt: { type: string, format: date-time }
        "401": { $ref: "#/components/responses/Unauthorized" }

components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: "Server-side API key created in the dashboard. Send as `Authorization: Bearer ak_…`."
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: |
        16 to 100 characters, letters, digits, underscore and hyphen only.
        A UUID fits. Anything outside that returns `400`
        `idempotency_key_required_16_to_100_characters`.

        Retrying with the same key and the same input returns the original job
        instead of starting or charging a second one. The same key with a
        different input returns `409`.
      schema:
        type: string
        minLength: 16
        maxLength: 100
        pattern: "^[a-zA-Z0-9_-]{16,100}$"
      example: 4f1d9c2a-7b30-4a11-9f5e-2c8d6a0b3e77
  responses:
    BadRequest:
      description: The body could not be used. Nothing was reserved.
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: invalid_email, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }
    Unauthorized:
      description: Missing, revoked or unknown key.
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: valid_api_key_required, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }
    Forbidden:
      description: The key or account cannot do this right now.
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: key_scope_denied, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }
    NotFound:
      description: No job with that ID on this account.
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: job_not_found, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }
    InsufficientFunds:
      description: Not enough available credit to reserve the job. Nothing was reserved.
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: insufficient_funds, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }
    Conflict:
      description: The same idempotency key was reused with a different input.
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: idempotency_conflict, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }
    TooLarge:
      description: Request payload exceeded the route's size limit (16 KB for single routes, 1 MB for batch routes).
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: request_too_large, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }
    RateLimited:
      description: Too many submissions or jobs in flight. Retry after `Retry-After` seconds.
      headers:
        Retry-After:
          schema: { type: integer }
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: rate_limit_exceeded, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }
    Unavailable:
      description: Execution is paused or unreachable. No funds are reserved.
      content:
        application/json:
          schema: { $ref: "#/components/schemas/Error" }
          example: { error: engine_temporarily_unavailable, requestId: 6c1e0b2a-4d3f-4a7e-9b8c-1f2e3d4c5b6a }

  schemas:
    Error:
      type: object
      required: [error, requestId]
      properties:
        error:
          type: string
          description: Stable machine-readable code. See Errors.
        requestId:
          type: string
          description: Quote this in a support message. It identifies the request without exposing your input.

    Job:
      type: object
      required: [id, operation, execution_state, billing, charged_micros, rate_micros, result]
      properties:
        id:
          type: string
          format: uuid
        operation:
          type: string
          enum: [find, verify]
        execution_state:
          type: string
          enum: [queued, running, complete, incomplete, review]
          description: |
            Whether the work finished. `complete` and `incomplete` are terminal.
            `incomplete` means a stage did not finish and the result may be
            missing or partial; it is never presented as a confident negative.
            `review` means the job is parked for an operator; do not resubmit it.
        billing:
          type: string
          enum: [reserved, charged, released]
          description: What happened to the reservation. Independent of `execution_state`.
        charged_micros:
          type: integer
          description: Micro-dollars captured. Zero until `billing` is `charged`.
        rate_micros:
          type: integer
          description: The rate reserved for this job, fixed at submission.
        result:
          oneOf:
            - $ref: "#/components/schemas/VerifyResult"
            - $ref: "#/components/schemas/FindResult"
            - type: "null"
          description: Null until the engine has answered.

    VerifyResult:
      type: object
      required: [operation, email, status, reason, provider, domain, catch_all, role, free, disposable, retryable, checked_at]
      properties:
        operation: { type: string, enum: [verify] }
        email: { type: [string, "null"] }
        status:
          type: string
          enum: [valid, invalid, catch_all, unknown]
          description: |
            `valid` and `invalid` are definite answers and are charged.
            `catch_all` means the domain accepts every address and we found no
            profile tying this one to a real account. `unknown` covers
            everything else, including a host that refuses checks. See
            `reason` for which.
        reason:
          type: string
          enum: [recipient_accepted, profile_linked, recipient_rejected, domain_cannot_receive, catch_all_domain, policy_block, temporary_failure, insufficient_evidence]
          description: |
            Why the status landed where it did. `profile_linked` is the
            interesting one: an accept-all domain where our identity lane tied
            this exact address to a real account profile and a control address
            to none. That is a `valid`, and it is charged.
        provider:
          type: [string, "null"]
          description: Mail provider inferred from MX, e.g. `google`, `microsoft`, `proofpoint`. Null when unknown or self-hosted.
        domain: { type: [string, "null"] }
        catch_all:
          type: [boolean, "null"]
          description: True when the domain accepts every address. Can be true on a `valid` result when identity evidence settled the mailbox anyway.
        role: { type: boolean, description: Shared mailbox such as info@ or sales@. }
        free: { type: boolean, description: Consumer mailbox provider such as gmail.com. }
        disposable: { type: boolean, description: Throwaway mailbox provider. }
        retryable: { type: boolean, description: The host asked us to try again later. }
        checked_at: { type: [string, "null"], format: date-time }

    FindResult:
      type: object
      required: [operation, email, status, reason, confidence, mailbox, provider, domain, role, free, disposable]
      properties:
        operation: { type: string, enum: [find] }
        email: { type: [string, "null"], description: The address, when exactly one qualified. Null otherwise. }
        status:
          type: string
          enum: [found, not_found, unknown]
          description: |
            `found` means exactly one candidate qualified; it is the only
            charged outcome. `not_found` means every candidate was rejected by
            the host. `unknown` means we could not tell: several qualified, or
            the domain accepts everything, or the search could not run.
            **`unknown` is never evidence that the person has no address.**
        reason:
          type: string
          enum: [qualified, all_rejected, ambiguous, unconfirmed, unavailable]
          description: Which flavour of the status above.
        confidence:
          type: [string, "null"]
          enum: [high, medium, low, null]
          description: |
            `high` means confirmed by profile linkage or as the sole verified
            address across a complete search. `medium` means a verified address
            from a partial search or disambiguated among multiple valid aliases.
            `low` means accepted, but ambiguous or from an unfinished search
            without a full name match. Null when no address was emitted.
        mailbox:
          type: string
          enum: [valid, invalid, catch_all, unknown, unverified]
          description: Mailbox validity of the emitted address. `unverified` means no probe ran.
        provider: { type: [string, "null"] }
        domain: { type: [string, "null"] }
        role: { type: boolean }
        free: { type: boolean }
        disposable: { type: boolean }
