Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  POST /uploads/v2/contactlist returns 200 OK even when upload fails

    Posted 23 days ago

    We noticed that when an import fails using the `POST /uploads/v2/contactlist` endpoint, the API response does not indicate that the import has failed. It responses with `200 OK`

    {
        "correlationId": "c5215965-a32a-4d99-aa27-223494254911"
    }

    According to Genesys Support, their backend logs show that the import generated the following event:

    * `eventId`: `5b800feb-b27f-52c1-b7a5-6d73264f2d10`
    * `category`: `IMPORT_ERROR`
    * `code`: `IMPORT_FAILED_TO_READ_HEADERS`

    The same error is also visible in the Genesys Cloud UI, where the contact list displays the message:"Import failed to read headers."

    However, our custom application, which initiates the contact list upload via the `POST /uploads/v2/contactlist` endpoint, always receives an HTTP `200 OK` response along with a correlation ID in the response body, regardless of whether the import succeeds or fails.

    Because the API response does not reflect the final import status, our application has no way to detect that the import failed and therefore cannot automatically retry the upload.

    Has anyone encountered this behavior? Is there a recommended way to determine whether an import has failed when using this endpoint? For example, is there an event, callback, or API that should be used to retrieve the final import status after receiving the initial `200 OK` response?

    P..S. Genesys Support advised to post this issue in here.


    #PlatformAPI

    ------------------------------
    Darius Arlauskas
    Written Communication Process Analyst
    ------------------------------


  • 2.  RE: POST /uploads/v2/contactlist returns 200 OK even when upload fails

    Posted 20 days ago

    Hi @Darius Arlauskas

    In my understanding, this is not a failure or error. The API just give feedback about upload process but not injection in the contact list. to the ge the real status you have to use another API:

    get /api/v2/outbound/contactlists/{contactListId}/importstatus
    Get dialer contactList import status.


    ------------------------------
    Saugort Dario Garcia
    Arquitecto de soluciones
    e-Contact
    https://www.e-contact.cl/
    ------------------------------



  • 3.  RE: POST /uploads/v2/contactlist returns 200 OK even when upload fails

    Posted 18 days ago

    Hi @Darius Arlauskas,

    What you're seeing sounds like expected behavior for an asynchronous import process.

    The POST /uploads/v2/contactlist endpoint appears to acknowledge that the file upload request was accepted and therefore returns 200 OK with a correlationId. It does not necessarily indicate that the contact list import itself has completed successfully.

    To determine the actual outcome of the import, you should track the import status separately using:

    GET /api/v2/outbound/contactlists/{contactListId}/importstatus

    This endpoint can provide the final processing status and is likely the best approach for detecting failures such as IMPORT_FAILED_TO_READ_HEADERS.

    If your application needs automated retries, a common pattern would be:

    1. Submit the upload request.
    2. Store the correlation ID and contact list ID.
    3. Poll the Import Status endpoint until processing completes.
    4. Retry or raise an alert if the import ends in a failed state.

    It would be nice if the upload workflow exposed more explicit status tracking or event notifications, but since the import processing occurs after the initial upload is accepted, relying on the import status endpoint is probably the most reliable solution.

    Regards,



    ------------------------------
    Cesar Padilla
    INDRA COLOMBIA
    ------------------------------



  • 4.  RE: POST /uploads/v2/contactlist returns 200 OK even when upload fails

    Posted 17 days ago

    Hi Cesar and thank you!

    I have tried to execute a request towards GET /api/v2/outbound/contactlists/{contactListId}/importstatus for one of our contact lists.

    But it returns a response that basically shows nothing:

    {
        "totalRecords": 0,
        "completedRecords": 0,
        "percentComplete": 0
    }

    Do you have any ideas why does it happen?

    BR

    Darius



    ------------------------------
    Darius Arlauskas
    Written Communication Process Analyst
    ------------------------------



  • 5.  RE: POST /uploads/v2/contactlist returns 200 OK even when upload fails

    Posted 17 days ago

    Hi @Darius Arlauskas,

    That's interesting. If the import fails before Genesys actually starts processing records, it may explain why GET /api/v2/outbound/contactlists/{contactListId}/importstatus returns:

    {
    "totalRecords": 0,
    "completedRecords": 0,
    "percentComplete": 0
    }

    In your example, Support identified the error as:

    IMPORT_FAILED_TO_READ_HEADERS
    

    which suggests the file validation failed at a very early stage, before any records were imported. In that scenario, the Import Status endpoint may not have any processing statistics to report because the import never progressed far enough to create them.

    A few things I would check:

    • Verify that you're querying the correct contactListId associated with the upload.
    • Compare the behavior with a known successful import to see whether the endpoint returns record counts as expected.
    • Check whether the failure is logged in the contact list itself or in any available audit/detail APIs, since importstatus appears to focus on processing progress rather than validation errors.
    • If the correlationId returned by POST /uploads/v2/contactlist is not exposed through another API, it may be worth asking Genesys Product Engineering whether there is a supported way to programmatically retrieve upload validation outcomes (such as IMPORT_FAILED_TO_READ_HEADERS) after the asynchronous upload completes.

    Based on the behavior you've described, my suspicion is that the upload was accepted successfully (hence the 200 OK), but the file failed validation before the import job could begin, leaving the Import Status endpoint with no records to report.

    Please let us know if you find a way to retrieve those IMPORT_ERROR events through an API, as that would be useful information for others implementing automated retry logic.

    Regards,



    ------------------------------
    Cesar Padilla
    INDRA COLOMBIA
    ------------------------------



  • 6.  RE: POST /uploads/v2/contactlist returns 200 OK even when upload fails

    Posted 17 days ago

    Hi Cesar,

    My bad. I did something wrong during my first test. I repeated the tests again and got the following results:

    When upload is ok:

    {
        "totalRecords": 2,
        "completedRecords": 2,
        "percentComplete": 100
    }

    When upload fails:

    {
        "state": "FAILED",
        "totalRecords": 0,
        "completedRecords": 0,
        "percentComplete": 0,
        "failureReason": "FAILED_TO_READ_HEADERS"
    }
    Thank you for your assistance.
    BR
    Darius


    ------------------------------
    Darius Arlauskas
    Written Communication Process Analyst
    ------------------------------



  • 7.  RE: POST /uploads/v2/contactlist returns 200 OK even when upload fails

    Posted 17 days ago

    @Darío Arlauskas, Great, let me know if I can help you with anything else.



    ------------------------------
    Cesar Padilla
    INDRA COLOMBIA
    ------------------------------