Create repository
curl --request POST \
--url https://api.mesa.dev/v1/{org}/repos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"default_bookmark": "main",
"tags": {}
}
'import requests
url = "https://api.mesa.dev/v1/{org}/repos"
payload = {
"name": "<string>",
"default_bookmark": "main",
"tags": {}
}
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({name: '<string>', default_bookmark: 'main', tags: {}})
};
fetch('https://api.mesa.dev/v1/{org}/repos', 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.mesa.dev/v1/{org}/repos",
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([
'name' => '<string>',
'default_bookmark' => 'main',
'tags' => [
]
]),
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.mesa.dev/v1/{org}/repos"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"default_bookmark\": \"main\",\n \"tags\": {}\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.mesa.dev/v1/{org}/repos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"default_bookmark\": \"main\",\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mesa.dev/v1/{org}/repos")
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 \"name\": \"<string>\",\n \"default_bookmark\": \"main\",\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org": "<string>",
"name": "<string>",
"default_bookmark": "<string>",
"head_change_id": "<string>",
"upstream": {
"url": "<string>",
"latest_sync": {
"id": "<string>",
"repo_id": "<string>",
"attempt": 123,
"ref_globs": {
"branches": "<string>",
"tags": "<string>"
},
"stats": {
"refs": [
{
"name": "<string>",
"before": "<string>",
"after": "<string>"
}
]
},
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
},
"created_at": "2023-11-07T05:31:56Z",
"tags": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}Repo
Create repository
Create a new repository in the organization
POST
/
{org}
/
repos
Create repository
curl --request POST \
--url https://api.mesa.dev/v1/{org}/repos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"default_bookmark": "main",
"tags": {}
}
'import requests
url = "https://api.mesa.dev/v1/{org}/repos"
payload = {
"name": "<string>",
"default_bookmark": "main",
"tags": {}
}
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({name: '<string>', default_bookmark: 'main', tags: {}})
};
fetch('https://api.mesa.dev/v1/{org}/repos', 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.mesa.dev/v1/{org}/repos",
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([
'name' => '<string>',
'default_bookmark' => 'main',
'tags' => [
]
]),
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.mesa.dev/v1/{org}/repos"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"default_bookmark\": \"main\",\n \"tags\": {}\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.mesa.dev/v1/{org}/repos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"default_bookmark\": \"main\",\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mesa.dev/v1/{org}/repos")
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 \"name\": \"<string>\",\n \"default_bookmark\": \"main\",\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org": "<string>",
"name": "<string>",
"default_bookmark": "<string>",
"head_change_id": "<string>",
"upstream": {
"url": "<string>",
"latest_sync": {
"id": "<string>",
"repo_id": "<string>",
"attempt": 123,
"ref_globs": {
"branches": "<string>",
"tags": "<string>"
},
"stats": {
"refs": [
{
"name": "<string>",
"before": "<string>",
"after": "<string>"
}
]
},
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
},
"created_at": "2023-11-07T05:31:56Z",
"tags": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"trace_id": "<string>"
}
}Required scope:
writeAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Minimum string length:
1Body
application/json
Required string length:
1 - 100Repository tags. Keys must not start with "$" (reserved for tag filter operators).
Show child attributes
Show child attributes
Optional upstream remote to add at create time. Equivalent to creating the repo and then PATCHing it with the same upstream value.
Show child attributes
Show child attributes
Response
Repository created
Current change id at the default bookmark tip. On empty repositories this is the virtual root change id (zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz).
Pattern:
^[zyxwvutsrqponmlk]{32}$Upstream remote configured for this repository, or null if none is configured.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

