curl --request POST \
--url https://api.onset.io/v1/milestones \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"status": "<string>",
"slug": "<string>",
"body": "<string>",
"is_public": true,
"project_id": "<string>",
"label_ids": [
"<string>"
],
"attachments": [
{
"type": "FILE",
"content": {
"title": "<string>",
"url": "<string>",
"size": 123,
"type": "<string>"
},
"id": "<string>"
}
]
}
'import requests
url = "https://api.onset.io/v1/milestones"
payload = {
"title": "<string>",
"status": "<string>",
"slug": "<string>",
"body": "<string>",
"is_public": True,
"project_id": "<string>",
"label_ids": ["<string>"],
"attachments": [
{
"type": "FILE",
"content": {
"title": "<string>",
"url": "<string>",
"size": 123,
"type": "<string>"
},
"id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
status: '<string>',
slug: '<string>',
body: JSON.stringify('<string>'),
is_public: true,
project_id: '<string>',
label_ids: ['<string>'],
attachments: [
{
type: 'FILE',
content: {title: '<string>', url: '<string>', size: 123, type: '<string>'},
id: '<string>'
}
]
})
};
fetch('https://api.onset.io/v1/milestones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onset.io/v1/milestones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'status' => '<string>',
'slug' => '<string>',
'body' => '<string>',
'is_public' => true,
'project_id' => '<string>',
'label_ids' => [
'<string>'
],
'attachments' => [
[
'type' => 'FILE',
'content' => [
'title' => '<string>',
'url' => '<string>',
'size' => 123,
'type' => '<string>'
],
'id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onset.io/v1/milestones"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"status\": \"<string>\",\n \"slug\": \"<string>\",\n \"body\": \"<string>\",\n \"is_public\": true,\n \"project_id\": \"<string>\",\n \"label_ids\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"type\": \"FILE\",\n \"content\": {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"size\": 123,\n \"type\": \"<string>\"\n },\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onset.io/v1/milestones")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"status\": \"<string>\",\n \"slug\": \"<string>\",\n \"body\": \"<string>\",\n \"is_public\": true,\n \"project_id\": \"<string>\",\n \"label_ids\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"type\": \"FILE\",\n \"content\": {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"size\": 123,\n \"type\": \"<string>\"\n },\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onset.io/v1/milestones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"status\": \"<string>\",\n \"slug\": \"<string>\",\n \"body\": \"<string>\",\n \"is_public\": true,\n \"project_id\": \"<string>\",\n \"label_ids\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"type\": \"FILE\",\n \"content\": {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"size\": 123,\n \"type\": \"<string>\"\n },\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"body": "<string>",
"slug": "<string>",
"status": "<string>",
"stage": "<string>",
"is_public": true,
"upvote_count": 123,
"project": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
},
"labels": [
{
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"color": "<string>"
}
],
"attachments": [
{
"type": "FILE",
"content": {
"title": "<string>",
"url": "<string>",
"size": 123,
"type": "<string>"
},
"id": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"details": {}
}{
"error": "<string>",
"details": {}
}Create a new milestone
Create a new milestone in the workspace
curl --request POST \
--url https://api.onset.io/v1/milestones \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"status": "<string>",
"slug": "<string>",
"body": "<string>",
"is_public": true,
"project_id": "<string>",
"label_ids": [
"<string>"
],
"attachments": [
{
"type": "FILE",
"content": {
"title": "<string>",
"url": "<string>",
"size": 123,
"type": "<string>"
},
"id": "<string>"
}
]
}
'import requests
url = "https://api.onset.io/v1/milestones"
payload = {
"title": "<string>",
"status": "<string>",
"slug": "<string>",
"body": "<string>",
"is_public": True,
"project_id": "<string>",
"label_ids": ["<string>"],
"attachments": [
{
"type": "FILE",
"content": {
"title": "<string>",
"url": "<string>",
"size": 123,
"type": "<string>"
},
"id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
status: '<string>',
slug: '<string>',
body: JSON.stringify('<string>'),
is_public: true,
project_id: '<string>',
label_ids: ['<string>'],
attachments: [
{
type: 'FILE',
content: {title: '<string>', url: '<string>', size: 123, type: '<string>'},
id: '<string>'
}
]
})
};
fetch('https://api.onset.io/v1/milestones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onset.io/v1/milestones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'status' => '<string>',
'slug' => '<string>',
'body' => '<string>',
'is_public' => true,
'project_id' => '<string>',
'label_ids' => [
'<string>'
],
'attachments' => [
[
'type' => 'FILE',
'content' => [
'title' => '<string>',
'url' => '<string>',
'size' => 123,
'type' => '<string>'
],
'id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onset.io/v1/milestones"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"status\": \"<string>\",\n \"slug\": \"<string>\",\n \"body\": \"<string>\",\n \"is_public\": true,\n \"project_id\": \"<string>\",\n \"label_ids\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"type\": \"FILE\",\n \"content\": {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"size\": 123,\n \"type\": \"<string>\"\n },\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onset.io/v1/milestones")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"status\": \"<string>\",\n \"slug\": \"<string>\",\n \"body\": \"<string>\",\n \"is_public\": true,\n \"project_id\": \"<string>\",\n \"label_ids\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"type\": \"FILE\",\n \"content\": {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"size\": 123,\n \"type\": \"<string>\"\n },\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onset.io/v1/milestones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"status\": \"<string>\",\n \"slug\": \"<string>\",\n \"body\": \"<string>\",\n \"is_public\": true,\n \"project_id\": \"<string>\",\n \"label_ids\": [\n \"<string>\"\n ],\n \"attachments\": [\n {\n \"type\": \"FILE\",\n \"content\": {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"size\": 123,\n \"type\": \"<string>\"\n },\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"body": "<string>",
"slug": "<string>",
"status": "<string>",
"stage": "<string>",
"is_public": true,
"upvote_count": 123,
"project": {
"id": "<string>",
"name": "<string>",
"slug": "<string>"
},
"labels": [
{
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"color": "<string>"
}
],
"attachments": [
{
"type": "FILE",
"content": {
"title": "<string>",
"url": "<string>",
"size": 123,
"type": "<string>"
},
"id": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"details": {}
}{
"error": "<string>",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Milestone title
3 - 255Milestone status ID
URL-friendly milestone identifier
3 - 255^[a-z0-9]+(?:-[a-z0-9]+)*$Milestone description/body content
Whether milestone should be publicly visible
ID of the project this milestone belongs to
Array of label IDs to attach to the milestone
Array of attachments to include
- Option 1
- Option 2
Show child attributes
Show child attributes
Response
Milestone created successfully
Unique milestone identifier
Milestone title
Milestone description/body content (HTML formatted)
URL-friendly milestone identifier
Current milestone status
Current milestone stage
Whether milestone is publicly visible
Number of votes for this milestone
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
When the milestone was created
When the milestone was last updated
Was this page helpful?

