Modify an enterprise milestone¶
PUT /api/v8/enterprises/{enterprise}/milestones/{milestone_id}
Call this endpoint to modify an enterprise milestone.
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 | string | Yes | Enterprise ID |
milestone_id |
path | string | Yes | Milestone ID |
access_token |
query | string | Yes | User authorization code |
Request Body:
The request body is a JSON object containing the milestone fields to modify; title is required.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"title": {
"description": "Name",
"type": "string"
},
"description": {
"description": "Description",
"type": "string"
},
"start_date": {
"description": "Start date, format %Y-%m-%d",
"type": "string",
"format": "date"
},
"due_date": {
"description": "Due date, format %Y-%m-%d",
"type": "string",
"format": "date"
},
"state_event": {
"description": "Milestone state. Open: active; closed: closed",
"type": "string",
"enum": ["active", "closed"]
},
"projects": {
"description": "Associated projects",
"type": "array",
"items": {
"type": "integer"
}
}
},
"required": ["title"]
}
Response parameters¶
| Field | Type | Always returned | Nullable | Description |
|---|---|---|---|---|
id |
integer | Yes | No | Milestone ID |
title |
string | Yes | No | Title |
description |
string | Yes | No | Description |
state |
string | Yes | No | State |
created_at |
string | Yes | No | Creation time |
updated_at |
string | Yes | No | Update time |
due_date |
string | No | Yes | Due date |
start_date |
string | No | Yes | Start date |
projects |
string[] | Yes | No | Associated projects |
Error response¶
400 Invalid parameters
401 Unauthenticated
404 Not found
Note: Error response field names follow what the backend actually returns; the examples here show the generic structure only.
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; rate limit triggered |
500 |
Internal system error (Internal server error) |
Request example¶
Parameter notes¶
Replace
<enterprise>with the enterprise ID; replace<milestone_id>with the milestone ID; replace<token>with your AtomGit user access token.
cURL¶
curl -X PUT 'https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones/<milestone_id>?access_token=<token>' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"title":"3.0 release milestone","description":"3.0 release plan","start_date":"2026-10-01","due_date":"2026-12-31","state_event":"active","projects":[1,2]}'
JavaScript¶
// Native fetch (Node.js 18+ / browsers)
const response = await fetch("https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones/<milestone_id>?access_token=<token>", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
},
body: JSON.stringify({
title: "3.0 release milestone",
description: "3.0 release plan",
start_date: "2026-10-01",
due_date: "2026-12-31",
state_event: "active",
projects: [1, 2],
}),
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.put(
"https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones/<milestone_id>",
params={"access_token": "<token>"},
headers={
"Content-Type": "application/json",
"Accept": "application/json",
},
json={
"title": "3.0 release milestone",
"description": "3.0 release plan",
"start_date": "2026-10-01",
"due_date": "2026-12-31",
"state_event": "active",
"projects": [1, 2],
},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
Response example¶
Status code: 200
{
"id": 8,
"title": "3.0 release milestone",
"description": "3.0 release plan",
"state": "active",
"created_at": "2026-09-01T10:00:00+08:00",
"updated_at": "2026-10-14T03:29:29+08:00",
"due_date": "2026-12-31",
"start_date": "2026-10-01",
"projects": ["project-a", "project-b"]
}
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