Skip to content

Delete an enterprise member

DELETE /api/v8/enterprises/{enterprise}/members/{username}

Call this endpoint to delete an enterprise member.

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 path integer Yes Enterprise ID
username path string Yes Member username
access_token query string Yes User authorization code

Response parameters

Field Type Always returned Nullable Description
user object Yes No User information
url string Yes No API URL of the member
active boolean Yes No Whether the member is active
role string Yes No Member role, such as admin

user object

Field Type Always returned Nullable Description
user.avatar_url string Yes No URL of the user's avatar
user.html_url string Yes No URL of the user's profile page
user.id string Yes No User ID
user.login string Yes No User login name
user.name string Yes No User name
user.url string Yes No API URL of the user

Error response

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Parameter enterprise cannot be empty",
  "field": "enterprise"
}

401 Unauthenticated

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

HTTP status codes

Status code Description
200 Success (OK)
304 Not modified
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
404 Not found

Request example

Parameter notes

Replace <enterprise> with the enterprise ID, <username> with the member's username, and <token> with your AtomGit user access token.

cURL

curl -X DELETE 'https://api.atomgit.com/api/v8/enterprises/<enterprise>/members/<username>?access_token=<token>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
  "https://api.atomgit.com/api/v8/enterprises/<enterprise>/members/<username>?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/v8/enterprises/<enterprise>/members/<username>",
    params={"access_token": "<token>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "user": {
    "avatar_url": "https://api.atomgit.com/avatar.png",
    "html_url": "https://api.atomgit.com/octocat",
    "id": "268",
    "login": "octocat",
    "name": "Octo Cat",
    "url": "https://api.atomgit.com/api/v5/octocat"
  },
  "url": "https://api.atomgit.com/api/v5/enterprises/go-tribe/members/octocat",
  "active": true,
  "role": "admin"
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access credentials)
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