Create_notification... does not create a notification

Hi folks -

I’m attempting to create a notification via the API, using this query:

mutation {
    create_notification (
        user_id: 11227690,
        target_id: 373022691,
        target_type: Project,
        text: "This is a message"
    ) {
        id
    }
}

The user ID is my ID, and the target ID is an item ID for a board that I am the owner of. I get back this response:

{
    "data": {
        "create_notification": {
            "id": "-1"
        }
    },
    "account_id": 4751227
}

No notification gets sent. I confirmed I can get notifications via automations, but nothing via the API.

Any ideas?

Hi @josephwegner :wave:

When creating a notification via API, you’re unable to send a notification to yourself.

This means if you’re using the API key that’s tied to your login, you’ll need to send this notification to another user on the account.

Other that that, your mutation looks perfect :ok_hand:

Is this information helpful? Let me know if you have any questions or if I can be of further assistance! :raised_hands:

-Scott

Hi Scott,

I find it weird not being able to send notification to yourself. How to achieve this? Should we create an account just for that and use its api key or is their a way to have an api key tied to our company account but not to any logins.

Regards,

Hey Mathieu! At the moment there’s no way to send a notification to yourself. As a workaround I’d suggest inviting a dummy user and using their API key to send notifications to your users (including yourself).

I’ll do that, it shouldn’t count in the paid user counter though.