Fork a gist
POST
/gists/{uuid}/forksForks 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
| Name | Type | Scopes |
|---|---|---|
Authorizationrequired | string | gist:write |
Path parameters
| Name | Type | Description |
|---|---|---|
uuidrequired | string | The gist's UUID. |
Responses
| Status | Body | Description |
|---|---|---|
200 | GistSimple | The caller had already forked this gist; the existing fork is returned. |
Headers:Location | ||
201 | GistSimple | The newly created fork. |
Headers:Location | ||
401 | Error | Missing or invalid credentials. |
403 | Error | The token lacks the required scope or permission. |
404 | Error | The requested resource does not exist (or is not visible to the caller). |
422 | Error | The request body failed validation. |