List pull requests
List pull requests for the authenticated organization with cursor pagination.
import Tembo from '@tembo-io/sdk';
const client = new Tembo();
const pullRequest = await client.pullRequests.list({
limit: 50,
});use tembo_rs::*;
let client = Tembo::from_env()?;
let response = client.pull_requests().list().send().await?;
curl --request GET \
--url https://api.tembo.io/v1/pull-requests \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tembo.io/v1/pull-requests"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tembo.io/v1/pull-requests', 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/pull-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tembo.io/v1/pull-requests"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tembo.io/v1/pull-requests")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tembo.io/v1/pull-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"externalId": "<string>",
"externalProvider": "<string>",
"id": "<string>",
"isDraft": true,
"mergedAt": "2023-11-07T05:31:56Z",
"reviewDecision": "APPROVED",
"sourceBranch": "<string>",
"status": "open",
"title": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"url": "<string>",
"author": {
"id": "<string>",
"login": "<string>",
"name": "<string>",
"avatarUrl": "<string>",
"profileUrl": "<string>"
},
"baseBranch": "<string>",
"codeRepository": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"url": "<string>",
"owner": "<string>",
"targetBranch": "<string>",
"baseBranch": "<string>",
"provider": "<string>"
},
"headSha": "<string>",
"number": 123,
"owner": "<string>",
"reviewers": [
{
"id": "<string>",
"login": "<string>",
"name": "<string>",
"avatarUrl": "<string>",
"profileUrl": "<string>",
"reviewRequested": true,
"commented": true,
"approved": true,
"type": "bot",
"state": "approved",
"changesRequested": true,
"awaitingReview": true
}
],
"state": "approved",
"approvers": [
{
"login": "<string>",
"avatarUrl": "<string>"
}
],
"diff": {
"additions": 1,
"deletions": 1
},
"session": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"kind": "<string>",
"htmlUrl": "<string>",
"visibility": "private"
}
}
],
"nextCursor": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"totalCount": 1
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Filter authors by comma-separated provider:identifier values, such as github:octocat.
1Only pull requests created after this ISO 8601 timestamp.
Continuation cursor from the previous response nextCursor. Omit for the first page; null nextCursor means there are no more pages.
Maximum number of items to return in one page. Use nextCursor from the response to fetch more items.
1 <= x <= 100Exclude authors by comma-separated provider:identifier values.
1Exclude pull requests from the named organization within the caller access scope.
1Exclude returned pull requests by these comma-separated provider:identifier author values.
1Exclude pull requests assigned to these comma-separated reviewer identifiers.
1When true, only return pull requests with a linked Tembo session.
Request author filter options. Public responses do not include organization-wide author options.
Include the total count of matching pull requests.
Include each open pull request's position in its stack of dependent pull requests. Public responses do not include stacks.
Filter by repository IDs, supplied as a comma-separated list.
1Filter by assigned reviewer identifiers, supplied as a comma-separated list.
1Only pull requests merged after this ISO 8601 timestamp.
Search pull requests.
1Sort by creation time or last update time.
createdAt, updatedAt Filter by lifecycle or review state, including open, returned, approved, needs review, draft, merged, or closed.
open, returned, approved, needs review, draft, merged, closed Only pull requests updated after this ISO 8601 timestamp.
Was this page helpful?
import Tembo from '@tembo-io/sdk';
const client = new Tembo();
const pullRequest = await client.pullRequests.list({
limit: 50,
});use tembo_rs::*;
let client = Tembo::from_env()?;
let response = client.pull_requests().list().send().await?;
curl --request GET \
--url https://api.tembo.io/v1/pull-requests \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tembo.io/v1/pull-requests"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tembo.io/v1/pull-requests', 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/pull-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tembo.io/v1/pull-requests"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tembo.io/v1/pull-requests")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tembo.io/v1/pull-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"externalId": "<string>",
"externalProvider": "<string>",
"id": "<string>",
"isDraft": true,
"mergedAt": "2023-11-07T05:31:56Z",
"reviewDecision": "APPROVED",
"sourceBranch": "<string>",
"status": "open",
"title": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"url": "<string>",
"author": {
"id": "<string>",
"login": "<string>",
"name": "<string>",
"avatarUrl": "<string>",
"profileUrl": "<string>"
},
"baseBranch": "<string>",
"codeRepository": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"url": "<string>",
"owner": "<string>",
"targetBranch": "<string>",
"baseBranch": "<string>",
"provider": "<string>"
},
"headSha": "<string>",
"number": 123,
"owner": "<string>",
"reviewers": [
{
"id": "<string>",
"login": "<string>",
"name": "<string>",
"avatarUrl": "<string>",
"profileUrl": "<string>",
"reviewRequested": true,
"commented": true,
"approved": true,
"type": "bot",
"state": "approved",
"changesRequested": true,
"awaitingReview": true
}
],
"state": "approved",
"approvers": [
{
"login": "<string>",
"avatarUrl": "<string>"
}
],
"diff": {
"additions": 1,
"deletions": 1
},
"session": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"kind": "<string>",
"htmlUrl": "<string>",
"visibility": "private"
}
}
],
"nextCursor": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"totalCount": 1
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}