Snippets

Update a previous revision of a snippet

Changed on

Identical to UPDATE /snippets/encoded_id, except that this endpoint takes an explicit commit revision. Only the snippet's "HEAD"/"tip" (most recent) version can be updated and requests on all other, older revisions fail by returning a 405 status.

Usage of this endpoint over the unrestricted /snippets/encoded_id could be desired if the caller wants to be sure no concurrent modifications have taken place between the moment of the UPDATE request and the original GET.

This can be considered a so-called "Compare And Swap", or CAS operation.

Other than that, the two endpoints are identical in behavior.

put/snippets/{workspace}/{encoded_id}/{node_id}

Request

  • Base URL
    https://api.bitbucket.org/2.0
  • URL
    https://api.bitbucket.org/2.0/snippets/{workspace}/{encoded_id}/{node_id}
  • Auth
    • OAuth 2
      Authorization code: https://bitbucket.org/site/oauth2/authorize
      Token URL: https://bitbucket.org/site/oauth2/access_token scopes: snippet:write
    • or HTTP basic
    • or API key in header Authorization

Response

The updated snippet object.

typestring required
idinteger
titlestring
scm'git'

The DVCS used to store the snippet.

created_onstring date-time
updated_onstring date-time
is_privateboolean

Changes

    • warning

      removed the optional property /// from the response with the status (media type: application/json)

    • warning

      removed the optional property /// from the response with the status (media type: multipart/related)

    • warning

      removed the optional property /// from the response with the status (media type: multipart/form-data)

    • warning

      removed the optional property /// from the response with the status (media type: application/json)

    • warning

      removed the optional property /// from the response with the status (media type: multipart/related)

    • warning

      removed the optional property /// from the response with the status (media type: multipart/form-data)