Skip to content

Fork a gist

POST/gists/{uuid}/forks

Forks the targeted gist for the authenticated caller, creating a new gist owned by them whose content clones the parent and whose visibility is inherited from it.

Forking is idempotent: if the caller has already forked this gist, the endpoint returns 200 with the existing fork instead of creating a duplicate. A newly created fork returns 201. Forking your own gist is rejected with 422.

A private parent resolves only for its owner with a gist:read-capable token; other callers get 404.

Request

Headers

NameTypeScopes
Authorizationrequiredstringgist:write

Path parameters

NameTypeDescription
uuidrequiredstringThe gist's UUID.

Responses

StatusBodyDescription
200GistSimpleThe caller had already forked this gist; the existing fork is returned.
Headers:Location
201GistSimpleThe newly created fork.
Headers:Location
401ErrorMissing or invalid credentials.
403ErrorThe token lacks the required scope or permission.
404ErrorThe requested resource does not exist (or is not visible to the caller).
422ErrorThe request body failed validation.