Creating a new connection via API fails with 404

Hi everyone!

I have a problem with creating a project specific connection via the API.
The API endpoint responds with a status 404, message:

{
    "code": "ENTITY_NOT_FOUND",
    "params":
    {
        "message": "piece_metadata_not_found projectId=rWfDYYfvafTgcXpsvzcAD pieceName=usecaise"
    }
}

The error message suggests that the piece is not found.
However: both entities (project and piece) are there, and I can create a connection in the UI (but that is not an option in my case).

My request looks like this:

{
    "name": "Usecaise (auto generated, do not delete)",
    "displayName": "Usecaise (auto generated, do not delete)",
    "pieceName": "usecaise",
    "projectId": "rWfDYYfvafTgcXpsvzcAD",
    "externalId": "67c8572e03be34e0af5578ad",
    "type": "SECRET_TEXT",
    "value":
    {
        "type": "SECRET_TEXT",
        "secret_text": "..."
    }
}

I’m running activepieces on-prem, version 0.65.0
The piece is a private piece.

I appreciate your help :slight_smile:

Hi @c.mueller,

Creating connections via the API would require you to be on the enterprise edition so you can generate API keys and use them.

Assuming you are using that, is your pieceName correct ? please check the package.json of your piece, the name should match that.

Thank you @Abdul !
That was exactly what I needed to know :slight_smile:
It was indeed the piece name that is different in the package.json file.

Would it be possible to add this to the API documentation? Because that was not obvious to me by just reading the docs.

1 Like

We kind of need to say that somewhere in the docs you are right, it is kind of hard to do it straight away because it is used in multiple places.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.