Skip to content

Delete a public key

DELETE /api/v5/user/keys/{id}

Call this endpoint to delete a public key.

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
id path string Yes Public key ID
access_token query string Yes User authorization code

Error response

401 Unauthenticated

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

The actual error field names returned by the backend take precedence.

HTTP status codes

Status code Description
200 Success (OK)
401 Requires authentication
403 Forbidden
404 Request path does not exist
500 Internal server error

Request example

Parameter notes

<id> Replace with the public key ID to delete; <token> Replace with your AtomGit user access token.

cURL

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

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/user/keys/<id>?access_token=<token>", {
  method: "DELETE",
  headers: {
    "Accept": "application/json",
  },
});

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

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.delete(
    "https://api.atomgit.com/api/v5/user/keys/<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)
403 Forbidden
404 Request path does not exist
500 Internal system error

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