Configure project CLA¶
PUT /api/v5/repos/{owner}/{repo}/cla
This endpoint configures the project CLA. Pass cla_id to enable and select the specified CLA; omit it to turn off the project CLA configuration. You can also set whether to block merging pull requests whose CLA signing check is incomplete.
Access token support¶
- AtomGit user access tokens
Anonymous access¶
This endpoint does not allow anonymous access.
Request parameters¶
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
owner |
path | string | Yes | Address of the namespace that owns the repository (the address path of the enterprise, organization, or personal namespace) |
repo |
path | string | Yes | Repository path (path) |
access_token |
query | string | Yes | User authorization code |
Request Body:
The request body is a JSON object that configures the project CLA. Both fields are optional; if cla_id is omitted (or empty), the project CLA configuration is turned off.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cla_id": {
"description": "ID of the CLA to enable (from the CLA list endpoint). Passing cla_id enables and selects that CLA; omitting it turns off the project CLA configuration",
"type": "string"
},
"enforce_check": {
"description": "Whether to block merging pull requests whose CLA signing check is incomplete (true to block / false not to block). Only meaningful when the CLA is enabled",
"type": "boolean"
}
}
}
Response parameters¶
This endpoint has no response body: it returns 200 with an empty response body on success.
Error response¶
The endpoint may return the following error responses (the response body uses the ApiErrorResp structure, with snake_case field names).
401 Unauthenticated
{
"error_code": 401,
"error_code_name": "UNAUTHORIZED",
"error_message": "Missing or invalid access token"
}
403 Access forbidden
404 Repository not found
429 Too many requests
{
"error_code": 429,
"error_code_name": "TOO_MANY_REQUESTS",
"error_message": "Too many requests; rate limit triggered"
}
HTTP response status codes¶
| Status code | Description |
|---|---|
200 |
Succeeded (OK), with an empty response body |
401 |
Authentication required (Requires authentication) |
403 |
Access forbidden (Forbidden) |
404 |
Repository not found (Not found) |
429 |
Too many requests |
Request example¶
Parameter notes¶
Placeholders in the examples: replace <owner> with the address of the namespace that owns the repository (the address path of the enterprise, organization, or personal namespace); replace <repo> with the repository path (path); replace <token> with your AtomGit user access token; replace <cla_id> with the ID of the CLA to enable (from the CLA list endpoint).
cURL¶
curl -X PUT 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/cla?access_token=<token>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"cla_id": "<cla_id>", "enforce_check": true}'
JavaScript¶
const response = await fetch("https://api.atomgit.com/api/v5/repos/<owner>/<repo>/cla?access_token=<token>", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
body: JSON.stringify({
cla_id: "<cla_id>",
enforce_check: true,
}),
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
console.log(`Configured successfully: ${response.status}`);
Python¶
import requests
resp = requests.put(
"https://api.atomgit.com/api/v5/repos/<owner>/<repo>/cla",
params={"access_token": "<token>"},
json={"cla_id": "<cla_id>", "enforce_check": True},
headers={"Accept": "application/json"},
timeout=10,
)
resp.raise_for_status()
print(resp.status_code)
Response example¶
Status code: 200
On success, this endpoint returns an empty response body (no content).
Error codes¶
| Error code | Description |
|---|---|
401 |
Unauthenticated or invalid credentials (missing or invalid access credentials) |
403 |
Access forbidden (no operation permission) |
404 |
Repository not found |
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