Skip to content

Create an enterprise milestone

POST /api/v8/enterprises/{enterprise}/milestones

Call this endpoint to create 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
access_token query string Yes User authorization code

Request Body:

The request body is a JSON object containing the milestone to create:

{
  "$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"
    },
    "due_date": {
      "description": "Due date, format %Y-%m-%d",
      "type": "string"
    },
    "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

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

401 Unauthenticated

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

Note: The error responses above are examples only; the actual error field names follow what the backend returns.

HTTP status codes

Status code Description
200 Success (OK)
400 Invalid parameters (Bad request)
401 Authentication required (Requires authentication)
403 Access forbidden (Forbidden)
404 Request path does not exist (Not found)
500 Internal system error (Internal server error)

Request example

Parameter notes

Replace <enterprise> with the enterprise ID (the address path of the enterprise namespace), and <token> with your AtomGit user access token.

cURL

curl -X POST 'https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones?access_token=<token>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "title": "v1.0",
    "description": "Release the v1.0 version",
    "start_date": "2026-01-01",
    "due_date": "2026-03-31",
    "projects": [1, 2]
  }'

JavaScript

// Native fetch (Node.js 18+ / browsers)
const response = await fetch("https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones?access_token=<token>", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify({
    title: "v1.0",
    description: "Release the v1.0 version",
    start_date: "2026-01-01",
    due_date: "2026-03-31",
    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.post(
    "https://api.atomgit.com/api/v8/enterprises/<enterprise>/milestones",
    params={"access_token": "<token>"},
    headers={"Content-Type": "application/json"},
    json={
        "title": "v1.0",
        "description": "Release the v1.0 version",
        "start_date": "2026-01-01",
        "due_date": "2026-03-31",
        "projects": [1, 2],
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "id": 1,
  "title": "v1.0",
  "description": "Release the v1.0 version",
  "state": "open",
  "created_at": "2026-10-14T03:19:46Z",
  "updated_at": "2026-10-14T03:19:46Z",
  "due_date": "2026-03-31",
  "start_date": "2026-01-01",
  "projects": ["1", "2"]
}

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