Skip to content

Delete an enterprise label

DELETE /api/v8/enterprises/{enterprise_id}/label/{label_id}

Call this endpoint to delete an enterprise label.

Supported access tokens

  • AtomGit user access tokens

Anonymous access allowed

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
enterprise_id path integer Yes Enterprise ID
label_id path integer Yes Label ID
access_token query string Yes User authorization code

Response parameters

On successful deletion this endpoint returns 200 OK with an empty response body (no content at all).

Error response

401 Unauthenticated

{
  "errorCode": 401,
  "errorCodeName": "UNAUTHORIZED",
  "errorMessage": "Missing or invalid access token",
  "traceId": ""
}

403 Access forbidden

{
  "errorCode": 403,
  "errorCodeName": "FORBIDDEN",
  "errorMessage": "The provided token lacks 'enterprise' scope. Tokens generated before the enterprise feature release don't include this by default. Please recreate or update your token with the required scope",
  "traceId": ""
}

404 Not found

{
  "errorCode": 404,
  "errorCodeName": "NOT_FOUND",
  "errorMessage": "not found",
  "traceId": ""
}

HTTP status codes

Status code Description
200 Success (OK)
400 Invalid parameters (Bad request)
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
404 Not found
429 Too many requests
500 Internal system error (Internal server error)

Request example

Parameter notes

Replace <enterprise_id> with the enterprise ID, <label_id> with the label ID, and <token> with your AtomGit user access token.

cURL

curl -X DELETE 'https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/label/<label_id>?access_token=<token>'

JavaScript

// Native fetch (Node.js 18+ / browsers)
const response = await fetch("https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/label/<label_id>?access_token=<token>", {
  method: "DELETE",
});

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

console.log(response.status);

Python

import requests

resp = requests.delete(
    "https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/label/<label_id>",
    params={"access_token": "<token>"},
    timeout=10,
)
resp.raise_for_status()

print(resp.status_code)

Response example

Status code: 200

On successful deletion it returns 200 OK with an empty response body:

{}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access credentials)
400 Invalid parameters or the request cannot be parsed
403 Access forbidden (insufficient permission, such as a token without the enterprise scope)
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