Get documents for a municipal bond
curl --request POST \
--url https://terrapinfinance.com/api/v1/muni_documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_type": "official_statement",
"isin": "US002842EZ11"
}
'import requests
url = "https://terrapinfinance.com/api/v1/muni_documents"
payload = {
"document_type": "official_statement",
"isin": "US002842EZ11"
}
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({document_type: 'official_statement', isin: 'US002842EZ11'})
};
fetch('https://terrapinfinance.com/api/v1/muni_documents', 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://terrapinfinance.com/api/v1/muni_documents",
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([
'document_type' => 'official_statement',
'isin' => 'US002842EZ11'
]),
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://terrapinfinance.com/api/v1/muni_documents"
payload := strings.NewReader("{\n \"document_type\": \"official_statement\",\n \"isin\": \"US002842EZ11\"\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://terrapinfinance.com/api/v1/muni_documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_type\": \"official_statement\",\n \"isin\": \"US002842EZ11\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://terrapinfinance.com/api/v1/muni_documents")
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 \"document_type\": \"official_statement\",\n \"isin\": \"US002842EZ11\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"document_name": "Official Statement posted 08/15/2023 (1.6 MB)",
"document_type": "official_statement",
"file_id": "ROaomzq-lhfQ-LMSd8Zvow.pdf",
"filing_type": null,
"isin": "US002842EZ11",
"publish_date": "2023-08-15",
"text_file_id": "ROaomzq-lhfQ-LMSd8Zvow.txt"
}
],
"total": 1
}{
"errors": [
{
"detail": "Unauthorized",
"reason": "Your account tier does not allow this operation. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Payment Required",
"reason": "You have run out of your granted quota for this resource as defined by your account tier. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Forbidden",
"reason": "Your account tier does not allow this operation. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Invalid string. Got: integer",
"source": {
"pointer": "/isins/0"
},
"title": "Invalid value"
}
]
}{
"errors": [
{
"detail": "Too Many Requests",
"reason": "<string>"
}
]
}{
"errors": [
{
"detail": "Internal Server Error",
"reason": "<string>"
}
]
}US municipal bonds
Documents
Given an ISIN and document type, returns the unique file IDs and metadata for the documents associated with that municipal bond. For official_statement, returns official statements for the specific bond. For disclosure_document, returns disclosure documents for the bond’s obligor. The file IDs can be used to download the documents using the download_document endpoint.
POST
/
api
/
v1
/
muni_documents
Get documents for a municipal bond
curl --request POST \
--url https://terrapinfinance.com/api/v1/muni_documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_type": "official_statement",
"isin": "US002842EZ11"
}
'import requests
url = "https://terrapinfinance.com/api/v1/muni_documents"
payload = {
"document_type": "official_statement",
"isin": "US002842EZ11"
}
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({document_type: 'official_statement', isin: 'US002842EZ11'})
};
fetch('https://terrapinfinance.com/api/v1/muni_documents', 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://terrapinfinance.com/api/v1/muni_documents",
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([
'document_type' => 'official_statement',
'isin' => 'US002842EZ11'
]),
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://terrapinfinance.com/api/v1/muni_documents"
payload := strings.NewReader("{\n \"document_type\": \"official_statement\",\n \"isin\": \"US002842EZ11\"\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://terrapinfinance.com/api/v1/muni_documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_type\": \"official_statement\",\n \"isin\": \"US002842EZ11\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://terrapinfinance.com/api/v1/muni_documents")
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 \"document_type\": \"official_statement\",\n \"isin\": \"US002842EZ11\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"document_name": "Official Statement posted 08/15/2023 (1.6 MB)",
"document_type": "official_statement",
"file_id": "ROaomzq-lhfQ-LMSd8Zvow.pdf",
"filing_type": null,
"isin": "US002842EZ11",
"publish_date": "2023-08-15",
"text_file_id": "ROaomzq-lhfQ-LMSd8Zvow.txt"
}
],
"total": 1
}{
"errors": [
{
"detail": "Unauthorized",
"reason": "Your account tier does not allow this operation. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Payment Required",
"reason": "You have run out of your granted quota for this resource as defined by your account tier. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Forbidden",
"reason": "Your account tier does not allow this operation. Contact team@terrapinfinance.com for an upgrade."
}
]
}{
"errors": [
{
"detail": "Invalid string. Got: integer",
"source": {
"pointer": "/isins/0"
},
"title": "Invalid value"
}
]
}{
"errors": [
{
"detail": "Too Many Requests",
"reason": "<string>"
}
]
}{
"errors": [
{
"detail": "Internal Server Error",
"reason": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Type of document to retrieve. official_statement returns the official statements for the specific bond. disclosure_document returns disclosure documents for the bond's obligor.
Available options:
disclosure_document, official_statement International Securities Identification Number (ISIN), unique 12-character code for the security.
Required string length:
12⌘I
