Skip to content

Delete a repository webhook

DELETE /api/v5/repos/{owner}/{repo}/hooks/{id}

This endpoint deletes a webhook in the specified repository. It locates the target by the address path of the namespace that owns the repository, the repository path, and the webhook ID, and returns an empty object after a successful deletion.

Supported access tokens

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Address path of the namespace that owns the repository (the address path of an enterprise, organization, or individual)
repo path string Yes Repository path (path)
id path string Yes Webhook ID
access_token query string Yes User authorization code

Response parameters

On success, the response body is an empty object {} and contains no fields.

Error response

Returns 401 when authentication fails. The actual error field names are those returned by the backend.

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

HTTP status codes

Status code Description
200 Success (OK)
401 Requires authentication
403 Forbidden
404 Request path does not exist (Not found)
429 Too many requests, rate limit triggered (Too many requests)
500 Internal server error

Request example

Parameter description

All examples use atomgit.com as the host name. The placeholders have the following meanings:

Replace <owner> with the address path of the namespace that owns the repository (the address path of an enterprise, organization, or individual); replace <repo> with the repository path (path); replace <id> with the ID of the webhook to delete; replace <token> with your AtomGit user access token.

cURL

curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/hooks/<id>?access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/hooks/<id>?access_token=<token>", {
  method: "DELETE",
  headers: {
    "Accept": "application/json",
  },
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

console.log(await response.json());

Python

import requests

resp = requests.delete(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/hooks/<id>",
    params={"access_token": "<token>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access token)
400 Invalid parameters or the request cannot be parsed
404 Request path does not exist
405 Request method not supported
429 Too many requests, rate limit triggered
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc