Pins
Create a pin
Pin a session, pull request, or project you have permission to access.
POST
/
v1
/
pins
TypeScript SDK
import Tembo from '@tembo-io/sdk';
const client = new Tembo();
const pin = await client.pins.create({
type: 'session',
id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
});curl --request POST \
--url https://api.tembo.io/v1/pins \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.tembo.io/v1/pins"
payload = { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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({id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.tembo.io/v1/pins', 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.tembo.io/v1/pins",
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([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.tembo.io/v1/pins"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.tembo.io/v1/pins")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tembo.io/v1/pins")
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 \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"type": "session",
"resource": {
"id": "<string>",
"title": "<string>",
"kind": "<string>",
"externalId": "<string>",
"agentId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastQueuedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"projectId": "<string>",
"level": 123,
"visibility": "public",
"vm": {
"id": "<string>",
"status": "Running"
},
"sessionSource": {
"type": "<string>",
"name": "<string>",
"sessionSourceCodeRepositories": [
{
"codeRepository": {
"id": "<string>",
"name": "<string>",
"integration": {
"type": "github"
}
}
}
]
},
"pullRequests": [
{
"status": "open",
"diffSummary": {
"additions": 123,
"deletions": 123
}
}
],
"diffSummary": {
"additions": 123,
"deletions": 123
},
"state": {
"isQueued": true,
"isCancelled": true,
"isCompleted": true,
"isFailed": true,
"inProgress": true,
"current": "inProgress"
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Was this page helpful?
⌘I
TypeScript SDK
import Tembo from '@tembo-io/sdk';
const client = new Tembo();
const pin = await client.pins.create({
type: 'session',
id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
});curl --request POST \
--url https://api.tembo.io/v1/pins \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.tembo.io/v1/pins"
payload = { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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({id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.tembo.io/v1/pins', 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.tembo.io/v1/pins",
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([
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.tembo.io/v1/pins"
payload := strings.NewReader("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.tembo.io/v1/pins")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tembo.io/v1/pins")
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 \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"type": "session",
"resource": {
"id": "<string>",
"title": "<string>",
"kind": "<string>",
"externalId": "<string>",
"agentId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastQueuedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"projectId": "<string>",
"level": 123,
"visibility": "public",
"vm": {
"id": "<string>",
"status": "Running"
},
"sessionSource": {
"type": "<string>",
"name": "<string>",
"sessionSourceCodeRepositories": [
{
"codeRepository": {
"id": "<string>",
"name": "<string>",
"integration": {
"type": "github"
}
}
}
]
},
"pullRequests": [
{
"status": "open",
"diffSummary": {
"additions": 123,
"deletions": 123
}
}
],
"diffSummary": {
"additions": 123,
"deletions": 123
},
"state": {
"isQueued": true,
"isCancelled": true,
"isCompleted": true,
"isFailed": true,
"inProgress": true,
"current": "inProgress"
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}