API for creating new card

I’m trying to use the API endpoint for creating new cards: https://api.supernotes.app/v1/cards

However, I’m hitting the wall here.

I’m required to provide the [card_id] but I haven’t created the card, so how would I have a card ID? And even when I provide one, it will say that the card has already been created.

And I’m getting this error:

{
  "type": "validation",
  "detail": "Validation errors",
  "meta": {
    "": "Input should be a valid UUID, invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `[` at 1"
  },
  "status": 422
}

I am using this endpoint and it works without the card id:

https://api.supernotes.app/v1/cards/simple

Here you can see the reference in the docs: Simple Create Card - Supernotes

1 Like

Yes, the “simple” endpoint is intended for any use-case where you have little control over the environment you are using (e.g. no-code automation tools like Apple Shortcuts or similar).

If you want full control over card creation, you need to use the endpoint you have tried initially. And for that you need to generate your own UUIDs, which must conform to the UUIDv4 spec. All programming languages and many automation systems will be able to generate these IDs for you. You will also need to generate one ID for the card itself and one ID for the “membership”, which is the object in the Supernotes systems which relates a card to your account specifically.

Got it! Thanks.

Here’s what I did with the iOS shortcut.

i

1 Like