Data API Postman collection
This page contains the TrueLayer Data API Postman collection, and accompanying environment, as plain text. You can save these and import them into Postman.
This can be useful if you're unable to download the TrueLayer Data API Postman collection through a link.
We recommend you save the collection and environment with the following names and file extensions:
TrueLayer Data Products.postman_collection.json
TrueLayer Data Products.postman_environment.json
Data API Postman Collection
Expand to access the collection as plain text
{
"info": {
"_postman_id": "1708df53-096e-4957-88cb-066c6730717d",
"name": "TrueLayer Data Products",
"description": "Ensure that you use the correct variable for your base URL to make requests in either the sandbox or live environment.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "21846777"
},
"item": [
{
"name": "Access tokens",
"item": [
{
"name": "Exchange code for access token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var parsedResponse = JSON.parse(responseBody);",
"pm.environment.set(\"data_access_token\", parsedResponse.access_token);",
"pm.environment.set(\"data_refresh_token\", parsedResponse.refresh_token);",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "authorization_code",
"type": "text"
},
{
"key": "client_id",
"value": "{{client_id}}",
"type": "text"
},
{
"key": "client_secret",
"value": "{{client_secret}}",
"type": "text"
},
{
"key": "redirect_uri",
"value": "{{redirect_uri}}",
"type": "text"
},
{
"key": "code",
"value": "",
"type": "text"
}
]
},
"url": {
"raw": "https://{{sandbox_auth_api}}/connect/token",
"protocol": "https",
"host": [
"{{sandbox_auth_api}}"
],
"path": [
"connect",
"token"
]
}
},
"response": []
},
{
"name": "Renew access token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var parsedResponse = JSON.parse(responseBody);",
"pm.environment.set(\"data_access_token\", parsedResponse.access_token);",
"pm.environment.set(\"data_refresh_token\", parsedResponse.refresh_token);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "refresh_token",
"type": "text"
},
{
"key": "client_id",
"value": "{{client_id}}",
"type": "text"
},
{
"key": "client_secret",
"value": "{{client_secret}}",
"type": "text"
},
{
"key": "refresh_token",
"value": "{{data_refresh_token}}",
"type": "text"
}
]
},
"url": {
"raw": "https://{{sandbox_auth_api}}/connect/token",
"protocol": "https",
"host": [
"{{sandbox_auth_api}}"
],
"path": [
"connect",
"token"
]
}
},
"response": []
}
]
},
{
"name": "Connections",
"item": [
{
"name": "Create a connection",
"item": [
{
"name": "Auth Link",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true,
"followRedirects": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{sandbox_auth_api}}/?response_type=code&client_id={{client_id}}&redirect_uri={{redirect_uri}}&scope=info accounts balance transactions direct_debits standing_orders offline_access&state=abc123&tracking_id={{tracking_id}}",
"protocol": "https",
"host": [
"{{sandbox_auth_api}}"
],
"path": [
""
],
"query": [
{
"key": "response_type",
"value": "code"
},
{
"key": "response_mode",
"value": "form_post",
"disabled": true
},
{
"key": "client_id",
"value": "{{client_id}}"
},
{
"key": "redirect_uri",
"value": "{{redirect_uri}}"
},
{
"key": "scope",
"value": "info accounts balance transactions direct_debits standing_orders offline_access"
},
{
"key": "state",
"value": "abc123"
},
{
"key": "tracking_id",
"value": "{{tracking_id}}"
}
]
}
},
"response": []
},
{
"name": "Direct Bank Auth Link",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"var parsedResponse = JSON.parse(responseBody);",
"pm.environment.set(\"TL_DATA_TOKEN\", parsedResponse.access_token);",
"pm.environment.set(\"TL_REFRESH_TOKEN\", parsedResponse.refresh_token);"
]
}
},
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"var newTrackingId = pm.variables.replaceIn('{{$guid}}');",
"pm.environment.set('tracking_id', newTrackingId)"
]
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"response_type\":\"code\",\n \"client_id\": \"{{client_id}}\",\n \"redirect_uri\": \"{{redirect_uri}}\",\n \"scope\": \"accounts\",\n \"provider_id\": \"ob-monzo\",\n \"consent_id\": \"123\",\n \"tracking_id\": \"{{tracking_id}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{auth_api}}/v1/authuri",
"protocol": "https",
"host": [
"{{auth_api}}"
],
"path": [
"v1",
"authuri"
]
}
},
"response": []
}
]
},
{
"name": "Extend a connection",
"item": [
{
"name": "Extend a connection",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var parsedResponse = JSON.parse(responseBody);",
"",
"if(parsedResponse.action_type === \"no_action_needed\") {",
" pm.environment.set(\"data_access_token\", parsedResponse.access_token);",
" pm.environment.set(\"data_refresh_token\", parsedResponse.refresh_token);",
"}",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\t\"user_has_reconfirmed_consent\": true,\n\t\"user\": {\n\t\t\"id\": \"\",\n\t\t\"name\": \"Alan Turing\",\n\t\t\"email\": \"[email protected]\",\n\t\t\"phone\": \"+447777123123\"\n\t},\n\t\"client_id\": \"{{client_id}}\",\n\t\"client_secret\": \"{{client_secret}}\",\n\t\"refresh_token\": \"{{data_refresh_token}}\",\n\t\"redirect_uri\": \"{{redirect_uri}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{sandbox_data_api}}/connections/extend",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"connections",
"extend"
]
}
},
"response": []
},
{
"name": "Delete a connection (revoke consent)",
"request": {
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"access_token\": \"{{data_access_token}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{sandbox_auth_api}}/api/delete",
"protocol": "https",
"host": [
"{{sandbox_auth_api}}"
],
"path": [
"api",
"delete"
]
}
},
"response": []
},
{
"name": "(Deprecated) Re-authentication",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var parsedResponse = JSON.parse(responseBody);",
"pm.environment.set(\"TL_DATA_TOKEN\", parsedResponse.access_token);",
"pm.environment.set(\"TL_REFRESH_TOKEN\", parsedResponse.refresh_token);"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"exec": [
"const newTrackingId = pm.variables.replaceIn('{{$guid}}');",
"pm.environment.set('tracking_id', newTrackingId)"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"response_type\":\"code\",\n \"client_id\": \"{{client_id}}\",\n \"redirect_uri\": \"{{redirect_uri}}\",\n \"scope\": \"accounts\",\n \"provider_id\": \"ob-monzo\",\n \"consent_id\": \"123\",\n \"tracking_id\": \"{{tracking_id}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{sandbox_auth_api}}/v1/authuri",
"protocol": "https",
"host": [
"{{sandbox_auth_api}}"
],
"path": [
"v1",
"authuri"
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{data_access_token}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "Debug IDs",
"item": [
{
"name": "Generate debug ID",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"access_token\": \"{{data_access_token}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{sandbox_auth_api}}/api/debug",
"protocol": "https",
"host": [
"{{sandbox_auth_api}}"
],
"path": [
"api",
"debug"
]
}
},
"response": []
},
{
"name": "Delete debug ID",
"request": {
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"access_token\": \"{{data_access_token}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{sandbox_auth_api}}/api/debug",
"protocol": "https",
"host": [
"{{sandbox_auth_api}}"
],
"path": [
"api",
"debug"
]
}
},
"response": []
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "Data",
"item": [
{
"name": "Accounts",
"item": [
{
"name": "List all accounts",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const results = pm.response.json().results",
"pm.environment.set(\"account_id\", results[0].account_id);",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/accounts",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"accounts"
]
}
},
"response": []
},
{
"name": "Retrieve an account",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/accounts/{{account_id}}",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"accounts",
"{{account_id}}"
]
}
},
"response": []
},
{
"name": "Retrieve account balance",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/accounts/{{account_id}}/balance",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"accounts",
"{{account_id}}",
"balance"
]
}
},
"response": []
},
{
"name": "Retrieve account transactions",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"const results = pm.response.json()",
"pm.environment.set(\"task_id\", results.task_id);",
""
]
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{data_api}}/data/v1/accounts/{{account_id}}/transactions",
"protocol": "https",
"host": [
"{{data_api}}"
],
"path": [
"data",
"v1",
"accounts",
"{{account_id}}",
"transactions"
],
"query": [
{
"key": "async",
"value": "true",
"disabled": true
}
]
}
},
"response": []
},
{
"name": "Retrieve account pending transactions",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const results = pm.response.json()",
"pm.environment.set(\"task_id\", results.task_id);",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/accounts/{{account_id}}/transactions/pending",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"accounts",
"{{account_id}}",
"transactions",
"pending"
]
}
},
"response": []
},
{
"name": "Retrieve direct debits",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/accounts/{{account_id}}/direct_debits",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"accounts",
"{{account_id}}",
"direct_debits"
]
}
},
"response": []
},
{
"name": "Retrieve standing order",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/accounts/{{account_id}}/standing_orders",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"accounts",
"{{account_id}}",
"standing_orders"
]
}
},
"response": []
},
{
"name": "Retrieve async results",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/results/{{task_id}}",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"results",
"{{task_id}}"
]
}
},
"response": []
}
]
},
{
"name": "Cards",
"item": [
{
"name": "List all cards",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var parsedResponse = JSON.parse(responseBody);",
"pm.globals.set(\"card_id\", parsedResponse.results[0].account_id);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/cards",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"cards"
]
}
},
"response": []
},
{
"name": "Retrieve a card",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/cards/{{card_id}}",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"cards",
"{{card_id}}"
]
}
},
"response": []
},
{
"name": "Retrieve a card balance",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/cards/{{card_id}}/balance",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"cards",
"{{card_id}}",
"balance"
]
}
},
"response": []
},
{
"name": "Retrieve card transactions",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const results = pm.response.json().results",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/cards/{{card_id}}/transactions",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"cards",
"{{card_id}}",
"transactions"
]
}
},
"response": []
},
{
"name": "Retrieve card pending transactions",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const results = pm.response.json().results",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/cards/{{card_id}}/transactions/pending",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"cards",
"{{card_id}}",
"transactions",
"pending"
]
}
},
"response": []
}
]
},
{
"name": "Batch",
"item": [
{
"name": "Create a batch task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const results = pm.response.json();",
"pm.environment.set(\"results_uri\", results.results_uri);",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"from\": \"2022-01-01\",\n \"to\": \"2022-06-01\",\n \"pending\": true,\n \"balance\": true\n} ",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/batch/transactions",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"batch",
"transactions"
]
}
},
"response": []
},
{
"name": "Retrieve batch results",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"from\": \"2019-05-10\",\n \"to\": \"2019-05-20\",\n \"pending\": true,\n \"balance\": true,\n \"webhook_uri\": \"https://de57052f34fd.ngrok.io/hook\"\n} ",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{results_uri}}",
"host": [
"{{results_uri}}"
]
}
},
"response": []
}
]
},
{
"name": "Retrieve identity information",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/info",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"info"
]
}
},
"response": []
},
{
"name": "Retrieve access token metadata",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "formdata",
"formdata": []
},
"url": {
"raw": "https://{{sandbox_data_api}}/data/v1/me",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"data",
"v1",
"me"
]
}
},
"response": []
},
{
"name": "Retrieve list of providers",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{sandbox_auth_api}}/api/providers?client_id={{client_id}}",
"protocol": "https",
"host": [
"{{sandbox_auth_api}}"
],
"path": [
"api",
"providers"
],
"query": [
{
"key": "client_id",
"value": "{{client_id}}"
}
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{data_access_token}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "Verification",
"item": [
{
"name": "Verify",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"James Bond\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{sandbox_data_api}}/verification/v1/verify",
"protocol": "https",
"host": [
"{{sandbox_data_api}}"
],
"path": [
"verification",
"v1",
"verify"
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{data_access_token}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "Status",
"item": [
{
"name": "Data API availability",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://{{status_api}}/api/v1/data/status",
"protocol": "https",
"host": [
"{{status_api}}"
],
"path": [
"api",
"v1",
"data",
"status"
],
"query": [
{
"key": "from",
"value": "2022-06-01T12:00:00",
"disabled": true
},
{
"key": "to",
"value": "2022-06-01T19:00:00",
"disabled": true
},
{
"key": "providers",
"value": "ob-barclays,ob-monzo",
"disabled": true
},
{
"key": "endpoints",
"value": "accounts",
"disabled": true
}
]
}
},
"response": []
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
Data API Postman Environment
Expand to access the environment as plain text
{
"id": "dc40ffe3-d9a7-4b37-8a54-b0b456818dd9",
"name": "TrueLayer Data Products",
"values": [
{
"key": "sandbox_data_api",
"value": "api.truelayer-sandbox.com",
"type": "text",
"enabled": true
},
{
"key": "data_api",
"value": "api.truelayer.com",
"type": "default",
"enabled": true
},
{
"key": "sandbox_auth_api",
"value": "auth.truelayer-sandbox.com",
"type": "text",
"enabled": true
},
{
"key": "auth_api",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "client_id",
"value": "",
"type": "text",
"enabled": true
},
{
"key": "client_secret",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "redirect_uri",
"value": "https://console.truelayer.com/redirect-page",
"type": "text",
"enabled": true
},
{
"key": "data_access_token",
"value": "",
"type": "text",
"enabled": true
},
{
"key": "data_refresh_token",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "account_id",
"value": "",
"type": "text",
"enabled": true
},
{
"key": "results_uri",
"value": "",
"type": "text",
"enabled": true
},
{
"key": "webhook_uri",
"value": "",
"type": "text",
"enabled": true
},
{
"key": "status_api",
"value": "status-api.truelayer.com",
"type": "default",
"enabled": true
},
{
"key": "tracking_id",
"value": "",
"type": "default",
"enabled": true
},
{
"key": "task_id",
"value": "",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2024-01-26T14:52:34.102Z",
"_postman_exported_using": "Postman/10.21.14"
}