Remove a repository member¶
DELETE /api/v5/repos/{owner}/{repo}/collaborators/{username}
This endpoint removes the specified member (collaborator) from the specified repository. It locates the collaborator by user name and removes that member from the repository.
Supported access tokens¶
- AtomGit user access tokens
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Namespace address of the repository (address path of the enterprise, organization, or individual) |
repo |
path | string | Yes | Repository path (path) |
username |
path | string | Yes | User name (username/login) |
access_token |
query | string | Yes | User authorization code |
Response parameters¶
The response body is an empty object {}; the endpoint returns no business fields on success.
Error responses¶
The reference documentation does not provide a business error response example for this endpoint. If a call fails, the backend returns an error according to the general HTTP semantics; the actual field names are those returned by the backend.
401 Unauthenticated
HTTP status codes¶
| Status code | Description |
|---|---|
200 |
Success (OK) |
401 |
Authentication required (Requires authentication) |
403 |
Access denied (Forbidden) |
404 |
Resource not found (Not found) |
Request example¶
Parameter notes¶
The placeholders in the example mean the following:
Replace
<owner>with the namespace address of the repository (address path of the enterprise, organization, or individual); replace<repo>with the repository path (path); replace<username>with the user name of the member to remove (username/login); replace<token>with your AtomGit user access token.
cURL¶
curl -X DELETE 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/collaborators/<username>?access_token=<token>' \
-H 'Accept: application/json'
JavaScript¶
// Native fetch (Node.js 18+ / browser)
const response = await fetch(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/collaborators/<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/v5/repos/<owner>/<repo>/collaborators/<username>",
params={"access_token": "<token>"},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc