API ID* No special characters allowed

Hi all, can somebody explain me, how can I use API ID in snake_case without this error? I really need it

Hi Team,

It's not possible to use snake_case with API IDs, you'll need to use CamelCase for your API IDs.

The reason for this is that the underscore will break the repository GraphQL API, so we have to enforce this.

Thanks.

Hi, thank you for the answer. But why I can use snake_case when I add slices via Prismic dashboard without any errors (look at the attached screenshot):


But if I create slice via slice machine - I get an error like in my first posted message?

Hey there, thanks for pointing this out. For the moment, this isn't possible yet in Slice Machine. We have kept an open conversation about adding support for this type of unique characters, but we still do not have a definite plan about whether we will make it official.

CamelCase only in Slice Machine will continue to be the only option for API IDs.

Thank you so much for your answer :slight_smile:

1 Like