Create API key
curl --request POST \
--url https://api.mesa.dev/v1/{org}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [],
"repo_ids": [
"<string>"
],
"expires_in_seconds": 15768050,
"tags": {}
}
'import requests
url = "https://api.mesa.dev/v1/{org}/api-keys"
payload = {
"name": "<string>",
"scopes": [],
"repo_ids": ["<string>"],
"expires_in_seconds": 15768050,
"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>',
scopes: [],
repo_ids: ['<string>'],
expires_in_seconds: 15768050,
tags: {}
})
};
fetch('https://api.mesa.dev/v1/{org}/api-keys', 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}/api-keys",
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>',
'scopes' => [
],
'repo_ids' => [
'<string>'
],
'expires_in_seconds' => 15768050,
'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}/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"repo_ids\": [\n \"<string>\"\n ],\n \"expires_in_seconds\": 15768050,\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}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"repo_ids\": [\n \"<string>\"\n ],\n \"expires_in_seconds\": 15768050,\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mesa.dev/v1/{org}/api-keys")
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 \"scopes\": [],\n \"repo_ids\": [\n \"<string>\"\n ],\n \"expires_in_seconds\": 15768050,\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"key": "<string>",
"name": "<string>",
"scopes": [
"<string>"
],
"repo_ids": [
"<string>"
],
"tags": {},
"created_at": "2023-11-07T05:31:56Z"
}{
"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>"
}
}Org
Create API key
Create a new API key for programmatic access
POST
/
{org}
/
api-keys
Create API key
curl --request POST \
--url https://api.mesa.dev/v1/{org}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [],
"repo_ids": [
"<string>"
],
"expires_in_seconds": 15768050,
"tags": {}
}
'import requests
url = "https://api.mesa.dev/v1/{org}/api-keys"
payload = {
"name": "<string>",
"scopes": [],
"repo_ids": ["<string>"],
"expires_in_seconds": 15768050,
"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>',
scopes: [],
repo_ids: ['<string>'],
expires_in_seconds: 15768050,
tags: {}
})
};
fetch('https://api.mesa.dev/v1/{org}/api-keys', 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}/api-keys",
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>',
'scopes' => [
],
'repo_ids' => [
'<string>'
],
'expires_in_seconds' => 15768050,
'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}/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"repo_ids\": [\n \"<string>\"\n ],\n \"expires_in_seconds\": 15768050,\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}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [],\n \"repo_ids\": [\n \"<string>\"\n ],\n \"expires_in_seconds\": 15768050,\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mesa.dev/v1/{org}/api-keys")
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 \"scopes\": [],\n \"repo_ids\": [\n \"<string>\"\n ],\n \"expires_in_seconds\": 15768050,\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"key": "<string>",
"name": "<string>",
"scopes": [
"<string>"
],
"repo_ids": [
"<string>"
],
"tags": {},
"created_at": "2023-11-07T05:31:56Z"
}{
"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>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Available options:
read, write, admin Minimum string length:
1Expiration time in seconds. Must be between 100 and 31536000 (365 days).
Required range:
100 <= x <= 31536000API key tags. Keys must not start with "$" (reserved for tag filter operators).
Show child attributes
Show child attributes
⌘I

