Skip to content

Leave an organization

DELETE /api/v5/user/memberships/orgs/{org}

The user calls this endpoint to leave an organization.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
org path string Yes Organization path (path/login)
access_token query string Yes User authorization code

Response parameters

On success (200), this endpoint returns an empty object {} with no business fields.

Error responses

This endpoint has no documented business failure response body. When authentication fails, the backend returns 401; the actual error field names are those returned by the backend.

HTTP response status codes

Status code Description
200 Success (OK)
401 Requires authentication
403 Forbidden
404 The request path does not exist (Not found)

Request example

Parameter description

Replace <org> with the organization path name (the address path of an enterprise, organization, or user); replace <token> with your AtomGit user access token.

cURL

curl -X DELETE 'https://api.atomgit.com/api/v5/user/memberships/orgs/<org>?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/memberships/orgs/<org>?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/memberships/orgs/<org>",
    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/invalid access credentials)
403 Forbidden
404 The request path does not exist
429 Too many requests; the rate limit was triggered
500 Internal system error

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