Create a consent
curl --request POST \
--url https://api.swippee.com/v1/consents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"report_id": "cl_abc123",
"scopes": [
"identity",
"income",
"verify"
],
"grantee_label": "Nabil Bank loan desk",
"expires_in_days": 30
}
'import requests
url = "https://api.swippee.com/v1/consents"
payload = {
"report_id": "cl_abc123",
"scopes": ["identity", "income", "verify"],
"grantee_label": "Nabil Bank loan desk",
"expires_in_days": 30
}
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({
report_id: 'cl_abc123',
scopes: ['identity', 'income', 'verify'],
grantee_label: 'Nabil Bank loan desk',
expires_in_days: 30
})
};
fetch('https://api.swippee.com/v1/consents', 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.swippee.com/v1/consents",
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([
'report_id' => 'cl_abc123',
'scopes' => [
'identity',
'income',
'verify'
],
'grantee_label' => 'Nabil Bank loan desk',
'expires_in_days' => 30
]),
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.swippee.com/v1/consents"
payload := strings.NewReader("{\n \"report_id\": \"cl_abc123\",\n \"scopes\": [\n \"identity\",\n \"income\",\n \"verify\"\n ],\n \"grantee_label\": \"Nabil Bank loan desk\",\n \"expires_in_days\": 30\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.swippee.com/v1/consents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"report_id\": \"cl_abc123\",\n \"scopes\": [\n \"identity\",\n \"income\",\n \"verify\"\n ],\n \"grantee_label\": \"Nabil Bank loan desk\",\n \"expires_in_days\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swippee.com/v1/consents")
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 \"report_id\": \"cl_abc123\",\n \"scopes\": [\n \"identity\",\n \"income\",\n \"verify\"\n ],\n \"grantee_label\": \"Nabil Bank loan desk\",\n \"expires_in_days\": 30\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"token": "<string>",
"data_url": "<string>",
"scopes": [
"<string>"
],
"expires_at": "2023-11-07T05:31:56Z"
}{
"error_type": "AUTHENTICATION_ERROR",
"error_code": "INVALID_API_KEY",
"error_message": "Unknown API key.",
"display_message": null,
"request_id": "req_8f3c9b2e4a1d4f7c9e0b1a2c3d4e5f60",
"documentation_url": "https://docs.swippee.com/concepts/errors#invalid_api_key",
"suggested_action": "Check your API key in the Authorization header."
}Consents
Create a consent
Let the statement owner share a parsed report with a third party via a scoped, expiring token — without handing over an API key.
POST
/
v1
/
consents
Create a consent
curl --request POST \
--url https://api.swippee.com/v1/consents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"report_id": "cl_abc123",
"scopes": [
"identity",
"income",
"verify"
],
"grantee_label": "Nabil Bank loan desk",
"expires_in_days": 30
}
'import requests
url = "https://api.swippee.com/v1/consents"
payload = {
"report_id": "cl_abc123",
"scopes": ["identity", "income", "verify"],
"grantee_label": "Nabil Bank loan desk",
"expires_in_days": 30
}
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({
report_id: 'cl_abc123',
scopes: ['identity', 'income', 'verify'],
grantee_label: 'Nabil Bank loan desk',
expires_in_days: 30
})
};
fetch('https://api.swippee.com/v1/consents', 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.swippee.com/v1/consents",
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([
'report_id' => 'cl_abc123',
'scopes' => [
'identity',
'income',
'verify'
],
'grantee_label' => 'Nabil Bank loan desk',
'expires_in_days' => 30
]),
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.swippee.com/v1/consents"
payload := strings.NewReader("{\n \"report_id\": \"cl_abc123\",\n \"scopes\": [\n \"identity\",\n \"income\",\n \"verify\"\n ],\n \"grantee_label\": \"Nabil Bank loan desk\",\n \"expires_in_days\": 30\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.swippee.com/v1/consents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"report_id\": \"cl_abc123\",\n \"scopes\": [\n \"identity\",\n \"income\",\n \"verify\"\n ],\n \"grantee_label\": \"Nabil Bank loan desk\",\n \"expires_in_days\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.swippee.com/v1/consents")
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 \"report_id\": \"cl_abc123\",\n \"scopes\": [\n \"identity\",\n \"income\",\n \"verify\"\n ],\n \"grantee_label\": \"Nabil Bank loan desk\",\n \"expires_in_days\": 30\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"token": "<string>",
"data_url": "<string>",
"scopes": [
"<string>"
],
"expires_at": "2023-11-07T05:31:56Z"
}{
"error_type": "AUTHENTICATION_ERROR",
"error_code": "INVALID_API_KEY",
"error_message": "Unknown API key.",
"display_message": null,
"request_id": "req_8f3c9b2e4a1d4f7c9e0b1a2c3d4e5f60",
"documentation_url": "https://docs.swippee.com/concepts/errors#invalid_api_key",
"suggested_action": "Check your API key in the Authorization header."
}Authorizations
Your API key from the dashboard, sent as Authorization: Bearer swippee_sk_live_....
Body
application/json
⌘I