Prisma 1 Forum

API for duplicate/create graphcool projects?

Hi there,

Do you know if there is a way to duplicate or create Graphcool project via an API ?

For exemple :

You product is a Saas solution using Graphcool but you want to have one Graphcool project for each of your customer.

How did you duplicate or create a project for them after signed-up ?

Huge thanks.

1 Like

Hey,

Graphcool operates a System API which allows you to duplicate projects and do exactly what you request.

As far as I remember this API is locked to authenticated users only, you’ll need to speak with one of the Graphcool team to be invited to use this, unless it’s now open to everyone, @nilan will know more :metal:

Welcome to the forums, enjoy!

You can use either a PAT, or your client token (the one used for the CLI) to connect to the System API, but it’s not a public API, so it can change without notice.

A better approach would be to use the new graphcool cli library (currently in open beta), which can also be referenced from code, and does offer a public API to initialize a new project, and perform other tasks.

1 Like

Welcome :wave:

We’re currently working on a new CLI version in the Graphcool Framework Preview (you can read more here: Feedback: Framework Preview) that you can use to deploy a project definition to a new Graphcool service, programmatically.

It is designed to integrate nicely with continuous integration & deployment, and is also suitable to be used from within scripts.

Depending on the nature of your SaaS, it could be as easy as a server side script that uses a static project definition to initialize a new service whenevera new user signs up.

If you want to offer a lot of customizations for your users, it would be more involved, but still feasible, to feed their decisions into the project configuration generation.

It would be awesome to share your findings here, if you investigate in this direction :slight_smile:

1 Like