Discard an article's working copy
Example request
Generated- cURL
- JavaScript
- TypeScript
- Python
- PHP
- Go
- Java
- Ruby
- C#
Responses
Throws away the unpublished edits waiting on top of the article’s live version, in one language. What readers see does not change: the next read of the working copy is the live version again. Working copies are per-language, so this discards one language per call.
Anyone who may edit the article may discard a working copy made only of their own saves. Discarding edits anyone else saved needs an editor (or an API key), because the discarded versions are deleted for good.
Returns 400 for an If-Match that cannot guard this discard, 403 when the working copy holds someone else’s edits and the caller is not an editor, 404 when the language has no working copy, and 409 when the article is archived, a pending version is in review, or the language has never been published (discarding would delete the whole translation).
To discard only what you have seen, send If-Match with the ETag of a working_copy=true read in the same language. If anyone has saved that language since, nothing is discarded and you get 409: read the working copy again, then decide. Without If-Match the discard is unguarded.
Authentication
-
-
ApiKeyBearerhttpbearerAn API key sent as
Authorization: Bearer <key>. A key holds scopes, the same ones OAuth uses, and an operation needs the scope listed for it under OAuth2. A key may also expire, or be revoked or rotated in Settings > API, after which it is refused with a 401.
-
-
-
OAuth2oauth2An OAuth 2.0 access token for an app acting on behalf of a HelpDocs user, sent as
Authorization: Bearer <token>. The authorization code flow requires PKCE (S256). Each operation names the one scope it needs.
-
Path parameters
-
article_idstring Required
Query parameters
-
language_codestringDiscard the working copy of this translation. Defaults to the account’s default language.
Header parameters
-
If-MatchstringThe entity-tag “::” of a working_copy=true read, as its ETag header gives it. The discard goes ahead only if nobody has saved that language since. A tag for another article, two different tokens for one language, or a header with no tag for the language being discarded is refused with 400.
Responses
The article as it now reads
application/json
ArticleResponse
The If-Match header is malformed, names another article, carries two different tokens for one language, or has no tag for the language being discarded.
text/plain
The failure, as a human-readable message.
-
string
The failure, as a human-readable message.
Authentication failed or no API key was supplied.
application/json
Error
An error response.
-
codeinteger RequiredThe HTTP status code.
-
errstring RequiredA human-readable description of the failure.
The account’s billing is past due and writes are locked. Reads keep working; editing resumes once billing is settled.
application/json
Error
An error response.
-
codeinteger RequiredThe HTTP status code.
-
errstring RequiredA human-readable description of the failure.
The key lacks write permission, or the account’s plan does not include API access.
application/json
Error
An error response.
-
codeinteger RequiredThe HTTP status code.
-
errstring RequiredA human-readable description of the failure.
No such resource in this account, or article_id does not match the pattern this route accepts.
text/plain
The failure, as a human-readable message.
-
string
The failure, as a human-readable message.
The article is archived, a pending version is in review, the language has never been published, or (with If-Match) the language has been saved since the token was issued.
text/plain
The failure, as a human-readable message.
-
string
The failure, as a human-readable message.
Rate limited. Wait the number of seconds in Retry-After before trying again. X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset say which allowance was spent and when it refills.
-
Retry-Afterinteger -
X-RateLimit-Limitinteger -
X-RateLimit-Remaininginteger -
X-RateLimit-Resetinteger
application/json
Error
An error response.
-
codeinteger RequiredThe HTTP status code.
-
errstring RequiredA human-readable description of the failure.