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

# Report a wrong phone number

> Flag a number Pipecorn returned as wrong and search for another one

Use this endpoint when one of your users finds that a number Pipecorn
enriched is wrong: it belongs to someone else, or it no longer works. Pipecorn
removes the number from the contact and, by default, searches for another one
with the providers that did not give the wrong number.

## Flow

1. Send the contact's `linkedin_url`, the wrong `phone` and a `reason`.
2. The response says whether a new search started (`replacement: "searching"`).
3. Poll `status_url` until `status` is `finished`, or wait for the webhook. It
   carries the new number in `phones`, or no number when none was found.

```bash theme={null}
curl -X POST https://app.pipecorn.com/api/v2/contacts/report_phone \
  -H "X-API-Key: $PIPECORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "linkedin_url": "https://www.linkedin.com/in/william-hewish",
    "phone": "+33612345678",
    "reason": "wrong_person",
    "webhook_url": "https://example.com/pipecorn/phones"
  }'
```

## Credits

Reporting is free. The new search costs 30 credits, like any phone enrichment,
and only when it finds a number. Send `"find_replacement": false` to report the
number without searching.


## OpenAPI

````yaml api-reference/specs/enrichments.json POST /contacts/report_phone
openapi: 3.0.1
info:
  title: Pipecorn Enrichments API
  description: Pipecorn List API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /contacts/report_phone:
    post:
      summary: Report a wrong phone number
      description: >-
        Tell Pipecorn that a phone number it returned for a contact is wrong,
        and search for another one.


        The number is removed from the contact: [`GET
        /contacts/{id}`](/api-reference/endpoints/contacts/single_enrich), the
        enrichment webhook and later enrichments of the same person no longer
        return it. Unless `find_replacement` is `false`, a new phone search
        starts at once. It skips the providers that gave the wrong number, and
        runs only when no other mobile is left on the contact.


        **Credits:** reporting is free. The new search costs 30 credits, the
        price of a phone, and only when a number is found.


        **Result:** the response comes back right away. While the search runs,
        `GET /contacts/{id}` answers `status: "pending"`. When it ends, the
        `webhook_url` (or the one sent with the original enrichment) receives
        the same payload as [single
        enrichment](/api-reference/endpoints/enrichments/single#receiving-results),
        with the new number in `phones` or none.


        The report always lands when the contact and number are found: a plan
        without phone enrichment, or a balance below 30 credits, still removes
        the number and says in `replacement` why no search ran. Reporting the
        same number again while its search runs does not start a second one.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - linkedin_url
                - phone
                - reason
              properties:
                linkedin_url:
                  type: string
                  description: >-
                    LinkedIn profile URL of the contact, as sent to the
                    enrichment.
                  example: https://www.linkedin.com/in/william-hewish
                phone:
                  type: string
                  description: >-
                    The wrong number, as Pipecorn returned it. Any international
                    format works: spaces, dots, dashes and parentheses are
                    ignored.
                  example: '+33612345678'
                reason:
                  type: string
                  enum:
                    - wrong_person
                    - disconnected
                  description: >-
                    `wrong_person`: the number belongs to someone else.
                    `disconnected`: the number no longer works.
                find_replacement:
                  type: boolean
                  default: true
                  description: >-
                    Search for another number. Send `false` to only report the
                    number.
                webhook_url:
                  type: string
                  format: uri
                  description: >-
                    Where to send the result of the new search. Defaults to the
                    `webhook_url` of the original enrichment.
      responses:
        '200':
          description: The number is reported
          content:
            application/json:
              schema:
                type: object
                properties:
                  enrichment_id:
                    type: string
                    format: uuid
                    description: The contact's enrichment ID, for `GET /contacts/{id}`
                  reported:
                    type: boolean
                    description: Always `true`
                  replacement:
                    type: string
                    enum:
                      - searching
                      - other_mobile_kept
                      - not_allowed
                      - insufficient_credits
                      - skipped
                    description: >-
                      `searching`: a new phone search is running.
                      `other_mobile_kept`: the contact still has another mobile,
                      so no search ran. `not_allowed`: your plan or role does
                      not allow phone enrichment. `insufficient_credits`: fewer
                      than 30 credits left. `skipped`: you sent
                      `find_replacement: false`.
                  status_url:
                    type: string
                    format: uri
                    description: '`GET /contacts/{id}` for this contact'
              example:
                enrichment_id: 8f1c2a4e-5b6d-4e7f-9a0b-1c2d3e4f5a6b
                reported: true
                replacement: searching
                status_url: >-
                  https://app.pipecorn.com/api/v2/contacts/8f1c2a4e-5b6d-4e7f-9a0b-1c2d3e4f5a6b
        '400':
          description: '`linkedin_url`, `phone` or `reason` is missing'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 'Missing required keys: reason'
        '404':
          description: >-
            No contact with this LinkedIn URL is reachable with your key, or the
            number is not on it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Phone not found on this contact
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          description: >-
            `linkedin_url` is not a public profile URL, `phone` is not a valid
            number, `reason` is not `wrong_person` or `disconnected`,
            `find_replacement` is not a boolean, or `webhook_url` is not an
            http(s) URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 'Invalid reason, use one of: wrong_person, disconnected'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        A unique value you generate per operation, such as a UUID. Retrying with
        the same key and the same body returns the stored response instead of
        running the request again, so a retry after a timeout never charges
        twice. Successful responses are kept for 24 hours; a failed request is
        not stored and can be retried with the same key.
      schema:
        type: string
        maxLength: 255
        example: 4f1c2e9a-8a7d-4c1b-9f63-2d6e0b5a7c11
  schemas:
    Error:
      required:
        - error
      type: object
      properties:
        error:
          description: >-
            Human-readable error message. A few validation errors return a list
            of messages instead of a single string.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        message:
          type: string
          description: >-
            Longer explanation, sent by validators that add context. Such errors
            may also carry extra top-level keys like `valid_values` or
            `example`.
        details:
          type: string
          description: >-
            Parser message, sent with `"Invalid JSON format in request body"`
            when the request body is not valid JSON.
  responses:
    IdempotencyConflict:
      description: >-
        A request with this `Idempotency-Key` is still being processed. Wait for
        the `Retry-After` delay and retry with the same key.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              code:
                type: string
                enum:
                  - idempotency_key_in_use
          example:
            error: A request with this Idempotency-Key is still being processed
            code: idempotency_key_in_use
  headers:
    Retry-After:
      description: >-
        Seconds to wait before retrying. Sent when the plan limit or a request
        still in progress caused the error.
      schema:
        type: integer
        example: 42
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      description: Your API key
      name: X-API-KEY

````

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