{
  "openapi": "3.1.0",
  "info": {
    "title": "FNF Device-reported SIM Check API",
    "version": "1.1.0",
    "description": "Android device-reported evidence, not carrier-verified proof. verified=false. Only matched/unmatched results consume a billable use. Nil/expired checks are free. Pending checks reserve capacity/credit until completion or expiry cleanup on next access. No SIM collection from a backend-only request, browser or iOS."
  },
  "servers": [
    {
      "url": "https://fnfmeet.com/api/v1/sim-check"
    }
  ],
  "paths": {
    "/checks": {
      "post": {
        "summary": "Create one metered check; same-input idempotent retries do not add uses",
        "security": [
          {
            "ServerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/CreateResponse"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "account_ref",
                  "account_number"
                ],
                "properties": {
                  "account_ref": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "account_number": {
                    "type": "string",
                    "pattern": "^\\+[1-9][0-9]{6,14}$"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ]
      }
    },
    "/checks/{check_id}": {
      "parameters": [
        {
          "in": "path",
          "name": "check_id",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
          }
        }
      ],
      "get": {
        "summary": "Read your application check; returns account and detected numbers while retained",
        "security": [
          {
            "ServerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/CheckResult"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/device/{check_id}": {
      "parameters": [
        {
          "in": "path",
          "name": "check_id",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "SDK only: get scoped configuration without the expected number",
        "security": [
          {
            "CheckToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/DeviceConfig"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/device/{check_id}/report": {
      "parameters": [
        {
          "in": "path",
          "name": "check_id",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "summary": "SDK only: complete a check once; identical report retries are idempotent",
        "security": [
          {
            "CheckToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReportResult"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Request denied or unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "state",
                  "sim_count",
                  "numbers"
                ],
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "present",
                      "absent",
                      "unknown",
                      "permission_denied",
                      "unsupported"
                    ]
                  },
                  "sim_count": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4
                  },
                  "numbers": {
                    "type": "array",
                    "maxItems": 4,
                    "items": {
                      "type": "string",
                      "pattern": "^\\+[1-9][0-9]{6,14}$"
                    }
                  },
                  "lookup_methods": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 4
                    }
                  },
                  "sim_presence": {
                    "type": "string",
                    "enum": [
                      "present",
                      "absent",
                      "unknown",
                      "permission_denied",
                      "unsupported"
                    ],
                    "description": "Device-reported presence, independent of number readability. Optional in SDK reports for backward compatibility."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ServerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Server-only sk_fnfsim_ key. Never ship in an app."
      },
      "CheckToken": {
        "type": "apiKey",
        "in": "header",
        "name": "X-FNF-Check-Token",
        "description": "Single-check capability, expires after five minutes."
      }
    },
    "schemas": {
      "CreateResponse": {
        "type": "object",
        "properties": {
          "check_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "complete",
              "expired"
            ]
          },
          "proof_level": {
            "type": "string",
            "const": "device_report_only"
          },
          "check_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short-lived secret for this check; never a server key"
          },
          "expires_at": {
            "type": "string"
          },
          "idempotent_replay": {
            "type": "boolean"
          },
          "billing": {
            "type": "object",
            "properties": {
              "new_use": {
                "type": "boolean"
              },
              "billable_units": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "charged_micro": {
                "type": "integer"
              },
              "reserved_micro": {
                "type": "integer",
                "description": "Temporary refundable hold, not a final charge"
              },
              "state": {
                "type": "string",
                "enum": [
                  "reserved",
                  "billable",
                  "free"
                ]
              }
            }
          }
        }
      },
      "CheckResult": {
        "type": "object",
        "properties": {
          "check_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "complete",
              "expired"
            ]
          },
          "proof_level": {
            "type": "string",
            "const": "device_report_only"
          },
          "account_ref": {
            "type": "string"
          },
          "account_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "detected_numbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "result": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "matched",
              "unmatched",
              "not_detected",
              null
            ]
          },
          "reason": {
            "type": "string"
          },
          "verified": {
            "type": "boolean",
            "const": false
          },
          "details_retained": {
            "type": "boolean"
          },
          "sim_count": {
            "type": "integer"
          },
          "numbers_read": {
            "type": "integer"
          },
          "lookup_methods": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "currency": {
            "type": "string",
            "enum": [
              "USD",
              "EUR",
              "INR"
            ]
          },
          "charged_micro": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "description": "UTC SQL timestamp"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "type": "string"
          },
          "reserved_micro": {
            "type": "integer",
            "description": "Pending refundable prepaid hold"
          },
          "billing_state": {
            "type": "string",
            "enum": [
              "reserved",
              "billable",
              "free"
            ]
          },
          "sim_presence": {
            "type": "string",
            "enum": [
              "present",
              "absent",
              "unknown",
              "permission_denied",
              "unsupported"
            ],
            "description": "Device-reported presence, independent of number readability. Optional in SDK reports for backward compatibility."
          },
          "sim_present": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True=present, false=absent, null=undetermined."
          }
        }
      },
      "DeviceConfig": {
        "type": "object",
        "properties": {
          "check_id": {
            "type": "string"
          },
          "package_name": {
            "type": "string"
          },
          "country_hint": {
            "type": "string"
          },
          "ussd_enabled": {
            "type": "boolean"
          },
          "proof_level": {
            "type": "string",
            "const": "device_report_only"
          }
        }
      },
      "ReportResult": {
        "type": "object",
        "properties": {
          "check_id": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "complete",
              "expired"
            ]
          },
          "proof_level": {
            "type": "string",
            "const": "device_report_only"
          },
          "result": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "matched",
              "unmatched",
              "not_detected",
              null
            ]
          },
          "reason": {
            "type": "string"
          },
          "verified": {
            "type": "boolean",
            "const": false
          },
          "sim_count": {
            "type": "integer"
          },
          "numbers_read": {
            "type": "integer"
          },
          "lookup_methods": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "sim_presence": {
            "type": "string",
            "enum": [
              "present",
              "absent",
              "unknown",
              "permission_denied",
              "unsupported"
            ],
            "description": "Device-reported presence, independent of number readability. Optional in SDK reports for backward compatibility."
          },
          "sim_present": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True=present, false=absent, null=undetermined."
          }
        }
      }
    }
  }
}
