I’m encountering a 403 Access Denied error when using the Freepik module in Make. As shown in the attached screenshot, the scenario is making a POST request to /v1/ai/text-to-image/imagen3, but the server immediately returns a 403 error.
I’m using a valid API connection via Make’s official Freepik module.
I’m on the Core plan in Make (paid version).
I’ve tested the same POST request manually via the Freepik developer website, and it returns a 200 OK response there, so the API key and request itself seem valid.
The issue seems to be related specifically to this AI endpoint or the way Make is sending the request.
Is anyone else experiencing this issue or aware if this endpoint might be restricted to certain Freepik account types? Any help would be appreciated!
the app developer here
Which module are you using? The ‘Make an API Call’ module?
Are you inserting the complete URL “https://api.freepik.com/v1/ai/text-to-image/imagen3” or how exactly do you get this error? From the screenshot I cannot see the full input.
Thank you, Richard and Samliew, for your responses! I’ll look into this further and get back to you once I have more information. Really appreciate the help!
You are correct, this is the Make an API call module. Notable, I don’t get the same error when using the Create an Image from text module - that seems to work without any issues:
Also struggling to work out how to generate a new key. The support bot says to generate a new one on the dashboard page but the option for that doesn’t exist for me, I assume that’s the same for you?
API key is working fine.
Support of freepik: “If you wish to reset your API Key we will have to cancel your account.”
Only 1 key can be generated.
It’s not the key
@Sjoerd Hi! I also had this issue, but I managed to resolve it. I can assume that you’re sending the parameters for creating the image in the Body as plain JSON, for example: { "prompt": "some prompt" }.
I did the same at first and had the same error. However, the way I fixed it was by creating a separate module before the Freepik module, where I generated the JSON with all the required parameters. Then I passed this prepared JSON into the Body for Freepik.
You can also put the JSON in the Freepik module, but you have to encode the text output from OpenAI into JSON-safe characters first.
Escaping strings before mapping into another JSON string
Most of the time, you cannot directly map variables containing text content into another JSON string without escaping them, as the variable might contain characters that have a special meaning in JSON.
Special characters in strings needs to be specified (escaped) as a “literal” character (instead of a special metacharacter), otherwise they make the whole JSON invalid when you map the variable value when creating another JSON string.
You can escape string variables by passing the text into the JSON “Transform to JSON” module —
Transforms any object to JSON.
Then, you can map the output of the “Transform to JSON” module into your JSON string. (Do note that when using the “Transform to JSON” module, the output should already contain the double quotes " " around your text, so when you map this output into your JSON, you should not need to wrap another pair of double quotes around it.)
Alternatively, you can use the built-in function replace to replace those special characters with their escaped versions, as discussed here.