Create a variant

Adds a language or project template variant to a question.

For a project template variant, the files you send in file_contents are merged over the template's files: a file replaces the template file with the same path, and "deleted": true drops a template file. .cpad cannot be deleted, and at least one file must remain.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
integer
required

The question ID.

Body Params
string
required

A language key or a project template slug.

string | null

Starter code, for single-file language variants. An empty string is a blank starter file; null uses the language's default code. Cannot be combined with file_contents.

file_contents
array of objects

Starter files. deleted is only used on creation, for project template variants.

file_contents
string | null

Reference solution for this variant. null clears the solution.

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json