{
  "openapi": "3.1.0",
  "info": {
    "title": "DeepSearch API",
    "version": "1.0.0",
    "summary": "People research from public web sources: candidate matches, cited profiles and follow-up questions.",
    "description": "The DeepSearch REST API runs the same lookups as the app and the MCP server, with the same plans and limits. Authenticate with an API key from https://www.deepsearch.bio/settings/developers (`Authorization: Bearer dsb_live_...`) or an OAuth access token.\n\nTypical flow: `POST /lookups` with a name and context, show the candidates to the user, `POST /lookups/{id}/select` with their choice, then read the cited profile and ask follow-ups with `POST /lookups/{id}/questions`.\n\nAcceptable use:\n- Public web sources only. DeepSearch does not search private databases or records.\n- Results are candidate matches from public sources, not proof of identity, and may be incomplete or out of date.\n- Not a background check: DeepSearch is not a consumer reporting agency under the FCRA. Never use results for employment, tenant screening, credit, insurance or any other FCRA purpose.\n- No stalking, harassment, doxxing or discrimination. Refuse requests that aim to locate, track or intimidate someone.\n- People can ask to be removed from DeepSearch results at the opt-out page.\n\nLegal use and FCRA: https://www.deepsearch.bio/help/fcra-and-legal-use. Opt-out: https://www.deepsearch.bio/remove-me.",
    "termsOfService": "https://www.deepsearch.bio/terms",
    "contact": {
      "name": "DeepSearch",
      "url": "https://www.deepsearch.bio/developers"
    },
    "x-logo": {
      "url": "https://www.deepsearch.bio/android-chrome-512x512.png"
    }
  },
  "servers": [
    {
      "url": "https://www.deepsearch.bio/api/v1",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Guide and examples",
    "url": "https://www.deepsearch.bio/developers"
  },
  "tags": [
    {
      "name": "Lookups",
      "description": "Search people, build cited profiles and ask follow-up questions."
    },
    {
      "name": "Phone lookups",
      "description": "Reverse phone lookups, paid with Pro Plus credits."
    },
    {
      "name": "Account",
      "description": "Plan, usage and credits."
    }
  ],
  "security": [
    {
      "apiKey": []
    },
    {
      "oauth2": [
        "openid",
        "email"
      ]
    }
  ],
  "paths": {
    "/lookups": {
      "post": {
        "operationId": "createLookup",
        "summary": "Search people",
        "description": "Find candidate matches for a name in public web sources. Waits up to `wait_seconds` (default 50, 0 returns at once) for candidates; a lookup still running comes back with status `pending` or `finding` and keeps going, so poll `GET /lookups/{id}`. Uses one of the account's 25 daily lookups and needs DeepSearch Pro. Results are candidate matches from public sources, not proof of identity. Never use them for employment, tenant screening, credit or insurance decisions (FCRA).\n\nAPI key permission: `lookups:write`.",
        "tags": [
          "Lookups"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 200,
                    "description": "Full name of the person to research, e.g. \"Jane Doe\"."
                  },
                  "location": {
                    "description": "City, region or country, e.g. \"Austin, TX\".",
                    "type": "string",
                    "maxLength": 120
                  },
                  "company": {
                    "description": "Current or past employer.",
                    "type": "string",
                    "maxLength": 120
                  },
                  "job_title": {
                    "description": "Job title or role, e.g. \"Head of Product\".",
                    "type": "string",
                    "maxLength": 120
                  },
                  "education": {
                    "description": "School or university.",
                    "type": "string",
                    "maxLength": 120
                  },
                  "field": {
                    "description": "Industry or field, e.g. \"biotech\".",
                    "type": "string",
                    "maxLength": 120
                  },
                  "wait_seconds": {
                    "default": 50,
                    "description": "Seconds to wait for the job before returning (0-120, default 50). The job keeps running if time runs out.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 120
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Path of the new resource.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupStarted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-mcp-tool": "search_people",
        "x-api-key-permission": "lookups:write"
      },
      "get": {
        "operationId": "listLookups",
        "summary": "List finished profiles",
        "description": "List the account's finished profiles, newest first.\n\nAPI key permission: `lookups:read`.",
        "tags": [
          "Lookups"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return (1-50).",
            "schema": {
              "default": 10,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-mcp-tool": "list_lookups",
        "x-api-key-permission": "lookups:read"
      }
    },
    "/lookups/{id}": {
      "get": {
        "operationId": "getLookup",
        "summary": "Get a lookup",
        "description": "Status, candidates and (once finished) the profile for a lookup. Pass `wait_seconds` (up to 120) to wait for a running search or profile build instead of polling in a tight loop.\n\nAPI key permission: `lookups:read`.",
        "tags": [
          "Lookups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The lookup_id.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          },
          {
            "name": "wait_seconds",
            "in": "query",
            "required": false,
            "description": "Seconds to wait for the job before returning (0-120, default 0). The job keeps running if time runs out.",
            "schema": {
              "default": 0,
              "type": "integer",
              "minimum": 0,
              "maximum": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lookup"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-mcp-tool": "get_lookup",
        "x-api-key-permission": "lookups:read"
      }
    },
    "/lookups/{id}/select": {
      "post": {
        "operationId": "selectCandidate",
        "summary": "Build the profile for a candidate",
        "description": "Build a cited profile for the candidate the user picked. Use a `candidate_id` from the lookup. Waits up to `wait_seconds` (default 90); if the profile is still building, the response has status `building` and `GET /lookups/{id}` returns it when done. Choosing a different candidate after a profile exists returns 409. Results are candidate matches from public sources, not proof of identity. Never use them for employment, tenant screening, credit or insurance decisions (FCRA).\n\nAPI key permission: `lookups:write`.",
        "tags": [
          "Lookups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The lookup_id.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "candidate_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "The candidate_id the user chose from search_people or get_lookup."
                  },
                  "wait_seconds": {
                    "default": 90,
                    "description": "Seconds to wait for the job before returning (0-120, default 90). The job keeps running if time runs out.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 120
                  }
                },
                "required": [
                  "candidate_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileBuild"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-mcp-tool": "build_profile",
        "x-api-key-permission": "lookups:write"
      }
    },
    "/lookups/{id}/questions": {
      "post": {
        "operationId": "askQuestion",
        "summary": "Ask a follow-up question",
        "description": "Ask a follow-up question about a finished profile. Answers use only that profile's public sources and say so when the sources don't cover the question. Each profile allows 20 questions; questions_remaining says how many are left.\n\nAPI key permission: `lookups:write`.",
        "tags": [
          "Lookups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The lookup_id.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 1000,
                    "description": "A question about the person. Answers come only from the profile's sources."
                  }
                },
                "required": [
                  "question"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        },
        "x-mcp-tool": "ask_about_person",
        "x-api-key-permission": "lookups:write"
      }
    },
    "/me": {
      "get": {
        "operationId": "getAccount",
        "summary": "Get the account",
        "description": "Show the account's plan, lookups used and left today, the follow-up question limit, Pro Plus credits, and manage or upgrade links.\n\nAPI key permission: `account:read`.",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-mcp-tool": "get_account",
        "x-api-key-permission": "account:read"
      }
    },
    "/phone-lookups": {
      "post": {
        "operationId": "createPhoneLookup",
        "summary": "Run a phone lookup",
        "description": "Reverse phone lookup: who a number likely belongs to, plus carrier, line type, location and spam reports from caller ID sources. Needs Pro Plus and costs 3 credits per lookup, refunded if nothing is found. Confirm with the user before spending credits. Results are candidate matches from public sources, not proof of identity. Never use them for employment, tenant screening, credit or insurance decisions (FCRA).\n\nAPI key permission: `phone:write`.",
        "tags": [
          "Phone lookups"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phone": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 40,
                    "description": "Phone number, ideally in international format, e.g. \"+1 512 555 0100\"."
                  },
                  "country": {
                    "description": "Two-letter country code for numbers without a \"+\" prefix, e.g. \"US\".",
                    "type": "string",
                    "pattern": "^[A-Za-z]{2}$"
                  }
                },
                "required": [
                  "phone"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Path of the new resource.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneLookupResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "x-mcp-tool": "phone_lookup",
        "x-api-key-permission": "phone:write"
      }
    },
    "/phone-lookups/{id}": {
      "get": {
        "operationId": "getPhoneLookup",
        "summary": "Get a phone lookup",
        "description": "A phone lookup this account ran earlier, with its result.\n\nAPI key permission: `lookups:read`.",
        "tags": [
          "Phone lookups"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The search_id returned when the phone lookup ran.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhoneLookup"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-api-key-permission": "lookups:read"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A DeepSearch API key (`dsb_live_...`) from https://www.deepsearch.bio/settings/developers. Keys always carry read access; lookups:write and phone:write are chosen when the key is created."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.1 authorization code with PKCE. Users sign in to DeepSearch and approve the app; tokens carry every DeepSearch permission listed on the consent screen.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://dralyvdyghtsskxqpxvd.supabase.co/auth/v1/oauth/authorize",
            "tokenUrl": "https://dralyvdyghtsskxqpxvd.supabase.co/auth/v1/oauth/token",
            "refreshUrl": "https://dralyvdyghtsskxqpxvd.supabase.co/auth/v1/oauth/token",
            "scopes": {
              "openid": "Confirm it's you",
              "email": "See your email address"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable code, e.g. subscription_required, daily_limit_reached, not_found, invalid_input."
              },
              "message": {
                "type": "string",
                "description": "A short explanation you can show the user."
              },
              "upgrade_url": {
                "description": "Where the user can upgrade, when a plan or credits are missing.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "LookupStarted": {
        "type": "object",
        "properties": {
          "lookup_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "finding",
              "selecting",
              "building",
              "completed",
              "failed",
              "no_results"
            ],
            "description": "pending/finding: searching public sources. selecting: several people match, so the user must pick one. building: the profile is being written. completed: the profile is ready. no_results/failed: nothing to show."
          },
          "candidates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "candidate_id": {
                  "type": "string",
                  "description": "Pass this to build_profile once the user picks this person."
                },
                "name": {
                  "type": "string"
                },
                "headline": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "location": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "source_types": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Kinds of sources this match came from, e.g. \"linkedin\" or \"news\"."
                },
                "source_urls": {
                  "maxItems": 5,
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Up to 5 public URLs behind this match."
                },
                "photo_url": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "candidate_id",
                "name",
                "headline",
                "location",
                "source_types",
                "source_urls",
                "photo_url"
              ],
              "additionalProperties": false
            }
          },
          "profile_url": {
            "type": "string",
            "description": "This lookup in the DeepSearch web app."
          },
          "next_step": {
            "type": "string",
            "description": "What to do next."
          }
        },
        "required": [
          "lookup_id",
          "status",
          "candidates",
          "profile_url",
          "next_step"
        ],
        "additionalProperties": false
      },
      "LookupList": {
        "type": "object",
        "properties": {
          "lookups": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lookup_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "headline": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "location": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string"
                },
                "completed_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "profile_url": {
                  "type": "string"
                }
              },
              "required": [
                "lookup_id",
                "name",
                "headline",
                "location",
                "created_at",
                "completed_at",
                "profile_url"
              ],
              "additionalProperties": false
            },
            "description": "Finished profiles, newest first."
          }
        },
        "required": [
          "lookups"
        ],
        "additionalProperties": false
      },
      "Lookup": {
        "type": "object",
        "properties": {
          "lookup_id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The name that was searched."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "finding",
              "selecting",
              "building",
              "completed",
              "failed",
              "no_results"
            ],
            "description": "pending/finding: searching public sources. selecting: several people match, so the user must pick one. building: the profile is being written. completed: the profile is ready. no_results/failed: nothing to show."
          },
          "candidates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "candidate_id": {
                  "type": "string",
                  "description": "Pass this to build_profile once the user picks this person."
                },
                "name": {
                  "type": "string"
                },
                "headline": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "location": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "source_types": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Kinds of sources this match came from, e.g. \"linkedin\" or \"news\"."
                },
                "source_urls": {
                  "maxItems": 5,
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Up to 5 public URLs behind this match."
                },
                "photo_url": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "candidate_id",
                "name",
                "headline",
                "location",
                "source_types",
                "source_urls",
                "photo_url"
              ],
              "additionalProperties": false
            }
          },
          "selected_candidate_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "profile": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "full_name": {
                    "type": "string"
                  },
                  "headline": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "location": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "summary": {
                    "type": "string"
                  },
                  "key_facts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "label",
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "work_history": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "company": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "start": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "end": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "company",
                        "title",
                        "start",
                        "end"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "education": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "institution": {
                          "type": "string"
                        },
                        "degree": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "institution",
                        "degree"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "skills": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "achievements": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "social_profiles": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "platform": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "platform",
                        "url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "title",
                        "url",
                        "type"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Cite these URLs when you repeat facts."
                  },
                  "photo_urls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "profile_url": {
                    "type": "string",
                    "description": "The profile in the DeepSearch web app."
                  }
                },
                "required": [
                  "full_name",
                  "headline",
                  "location",
                  "summary",
                  "key_facts",
                  "work_history",
                  "education",
                  "skills",
                  "achievements",
                  "social_profiles",
                  "sources",
                  "photo_urls",
                  "profile_url"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "questions_remaining": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the lookup failed or found nothing."
          },
          "created_at": {
            "type": "string"
          },
          "profile_url": {
            "type": "string"
          },
          "next_step": {
            "type": "string"
          }
        },
        "required": [
          "lookup_id",
          "name",
          "status",
          "candidates",
          "selected_candidate_id",
          "profile",
          "questions_remaining",
          "message",
          "created_at",
          "profile_url",
          "next_step"
        ],
        "additionalProperties": false
      },
      "ProfileBuild": {
        "type": "object",
        "properties": {
          "full_name": {
            "type": "string"
          },
          "headline": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "summary": {
            "type": "string"
          },
          "key_facts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "required": [
                "label",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "work_history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "company": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "start": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "end": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "company",
                "title",
                "start",
                "end"
              ],
              "additionalProperties": false
            }
          },
          "education": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "institution": {
                  "type": "string"
                },
                "degree": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "institution",
                "degree"
              ],
              "additionalProperties": false
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "achievements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "social_profiles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "platform",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "title",
                "url",
                "type"
              ],
              "additionalProperties": false
            },
            "description": "Cite these URLs when you repeat facts."
          },
          "photo_urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "profile_url": {
            "type": "string"
          },
          "lookup_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "finding",
              "selecting",
              "building",
              "completed",
              "failed",
              "no_results"
            ],
            "description": "pending/finding: searching public sources. selecting: several people match, so the user must pick one. building: the profile is being written. completed: the profile is ready. no_results/failed: nothing to show."
          },
          "next_step": {
            "type": "string"
          }
        },
        "required": [
          "profile_url",
          "lookup_id",
          "status",
          "next_step"
        ],
        "additionalProperties": false
      },
      "Answer": {
        "type": "object",
        "properties": {
          "lookup_id": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "questions_remaining": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "lookup_id",
          "answer",
          "questions_remaining"
        ],
        "additionalProperties": false
      },
      "Account": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "plan": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "pro_active": {
                "type": "boolean"
              },
              "status": {
                "type": "string"
              },
              "current_period_end": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "name",
              "pro_active",
              "status",
              "current_period_end"
            ],
            "additionalProperties": false
          },
          "lookups": {
            "type": "object",
            "properties": {
              "used_today": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "daily_limit": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "remaining_today": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "used_today",
              "daily_limit",
              "remaining_today"
            ],
            "additionalProperties": false
          },
          "questions_per_profile": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "pro_plus": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              },
              "credits_remaining": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "phone_lookup_cost": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Credits per Phone Lookup (3)."
              }
            },
            "required": [
              "active",
              "credits_remaining",
              "phone_lookup_cost"
            ],
            "additionalProperties": false
          },
          "manage_url": {
            "type": "string"
          },
          "upgrade_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "email",
          "plan",
          "lookups",
          "questions_per_profile",
          "pro_plus",
          "manage_url",
          "upgrade_url"
        ],
        "additionalProperties": false
      },
      "PhoneLookupResult": {
        "type": "object",
        "properties": {
          "search_id": {
            "type": "string"
          },
          "found": {
            "type": "boolean"
          },
          "refunded": {
            "type": "boolean",
            "description": "True when nothing useful was found and the credits came back."
          },
          "credits_charged": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "credits_remaining": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "type": "object",
            "properties": {
              "phone": {
                "type": "string"
              },
              "display_phone": {
                "type": "string"
              },
              "country": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "owner_name": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "other_names": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Other names people saved this number under."
              },
              "entity_type": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "person",
                      "business"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "location": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "addresses": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "carrier": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line_type": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "time_zone": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "websites": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "reputation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "spam_risk": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "low",
                      "high"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "report_count": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "recent_reports": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "date": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "text",
                    "date"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "phone",
              "display_phone",
              "country",
              "owner_name",
              "other_names",
              "entity_type",
              "location",
              "addresses",
              "carrier",
              "line_type",
              "time_zone",
              "categories",
              "websites",
              "reputation",
              "spam_risk",
              "report_count",
              "recent_reports"
            ],
            "additionalProperties": false
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "result_url": {
            "type": "string"
          }
        },
        "required": [
          "search_id",
          "found",
          "refunded",
          "credits_charged",
          "credits_remaining",
          "result",
          "summary",
          "result_url"
        ],
        "additionalProperties": false
      },
      "PhoneLookup": {
        "type": "object",
        "properties": {
          "search_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "completed",
              "no_results",
              "failed"
            ],
            "description": "pending while it runs (seconds); no_results and failed are refunded."
          },
          "phone": {
            "type": "string"
          },
          "found": {
            "type": "boolean"
          },
          "refunded": {
            "type": "boolean"
          },
          "credits_charged": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "result": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "phone": {
                    "type": "string"
                  },
                  "display_phone": {
                    "type": "string"
                  },
                  "country": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "owner_name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "other_names": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Other names people saved this number under."
                  },
                  "entity_type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "person",
                          "business"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "location": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addresses": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "carrier": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line_type": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "time_zone": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "categories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "websites": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "reputation": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "spam_risk": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "low",
                          "high"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "report_count": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "recent_reports": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string"
                        },
                        "date": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "text",
                        "date"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "phone",
                  "display_phone",
                  "country",
                  "owner_name",
                  "other_names",
                  "entity_type",
                  "location",
                  "addresses",
                  "carrier",
                  "line_type",
                  "time_zone",
                  "categories",
                  "websites",
                  "reputation",
                  "spam_risk",
                  "report_count",
                  "recent_reports"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the lookup failed, when it did."
          },
          "created_at": {
            "type": "string"
          },
          "result_url": {
            "type": "string"
          }
        },
        "required": [
          "search_id",
          "status",
          "phone",
          "found",
          "refunded",
          "credits_charged",
          "result",
          "summary",
          "message",
          "created_at",
          "result_url"
        ],
        "additionalProperties": false
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The input failed validation (`invalid_input`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, invalid, expired or revoked token (`unauthorized`). `WWW-Authenticate` points at the OAuth protected resource metadata.",
        "headers": {
          "WWW-Authenticate": {
            "description": "Bearer challenge with `resource_metadata`.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "The plan doesn't include this (`subscription_required`, `pro_plus_required`) or there aren't enough credits (`insufficient_credits`). `error.upgrade_url` links to the upgrade.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The API key doesn't have the permission this endpoint needs (`insufficient_scope`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Nothing with that id on this account (`not_found`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "The lookup is still searching (`lookup_not_ready`), found nobody (`no_candidates`) or already has a profile for another candidate (`profile_exists`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "The daily lookup limit (25) or the profile's question limit is used up (`daily_limit_reached`, `message_limit_reached`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServerError": {
        "description": "Something failed on DeepSearch's side (`internal_error`). Retry later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "BadGateway": {
        "description": "The phone data provider failed (`provider_unavailable`). Credits were refunded.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unavailable": {
        "description": "The feature is temporarily unavailable (`not_configured`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}