Introduction
Welcome to our API documentation!
Authenticating requests
This API is not authenticated.
Accounts API
APIs for interacting with a TrustedLogin SaaS account, also known as a Team.
Verify Team Account.
Verifies that the settings on a Vendor's site are correct, and updates the API endpoint for this account. Upon successful verification, saves the API endpoint to the Team profile and logs the verification process. Returns the Team account details if successful or appropriate error responses for failure scenarios.
Note: New API endpoints and additional API controller actions can be found in the TeamApiController class, located at https://github.com/trustedlogin/trustedlogin-ecommerce/blob/php8-diff/app/Http/Controllers/TeamApiController.php
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/accounts/1';
$response = $client->post(
$url,
[
'headers' => [
'X-TL-TOKEN' => 'SHA-256 hash of the public key and API key for this team',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'api_endpoint' => 'https://example.com/wp-json/',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/accounts/1" \
--header "X-TL-TOKEN: SHA-256 hash of the public key and API key for this team" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"api_endpoint\": \"https:\\/\\/example.com\\/wp-json\\/\"
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/accounts/1"
);
const headers = {
"X-TL-TOKEN": "SHA-256 hash of the public key and API key for this team",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"api_endpoint": "https:\/\/example.com\/wp-json\/"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"id": 4,
"name": "sdsdf",
"status": "active",
}
Example response (402):
{
"error": "true",
"message": "You do not have a valid TrustedLogin subscription"
}
Example response (403):
{
"error": "true",
"message": "You can not access this team"
}
Example response (404):
{
"error": "true",
"message": "Team Not Found"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"api_endpoint": [
"The api endpoint field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
GET api/v1/envelope-signing-public-key
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/envelope-signing-public-key';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://app.trustedlogin.com/api/v1/envelope-signing-public-key" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/envelope-signing-public-key"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: must-revalidate, no-store, private
content-type: application/json
pragma: no-cache
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"publicKey": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/sites/{secret_id}/verify-identifier
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/sites/1/verify-identifier';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'timestamp' => 16,
'user_agent' => 'n',
'user_ip' => '1.102.226.211',
'site_url' => 'http://www.bailey.biz/quos-velit-et-fugiat-sunt-nihil-accusantium-harum.html',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/sites/1/verify-identifier" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"timestamp\": 16,
\"user_agent\": \"n\",
\"user_ip\": \"1.102.226.211\",
\"site_url\": \"http:\\/\\/www.bailey.biz\\/quos-velit-et-fugiat-sunt-nihil-accusantium-harum.html\"
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/sites/1/verify-identifier"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"timestamp": 16,
"user_agent": "n",
"user_ip": "1.102.226.211",
"site_url": "http:\/\/www.bailey.biz\/quos-velit-et-fugiat-sunt-nihil-accusantium-harum.html"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Report Brute Force Attempt.
Report that someone has tripped the lockdown on a client site.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/report-brute-force';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Public Key as Bearer Token',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'timestamp' => 'architecto',
'user_agent' => 'architecto',
'user_ip' => 'architecto',
'site_url' => 'https://example.com/',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/report-brute-force" \
--header "Authorization: Public Key as Bearer Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"timestamp\": \"architecto\",
\"user_agent\": \"architecto\",
\"user_ip\": \"architecto\",
\"site_url\": \"https:\\/\\/example.com\\/\"
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/report-brute-force"
);
const headers = {
"Authorization": "Public Key as Bearer Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"timestamp": "architecto",
"user_agent": "architecto",
"user_ip": "architecto",
"site_url": "https:\/\/example.com\/"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (204):
Empty response
Example response (422):
{
"errors": {
"identifier": [
"The identifier field is required."
]
}
}
Example response (500):
{
"message": "Description of error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST /api/v1/sites/{secret_id}/login-attempts
Customer site reports a failed support login. Authed via CheckPublicKeyFromBearerToken; rate-limited per-secret + per-team.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/sites/1/login-attempts';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'code' => 'login_failed',
'detailed_reason' => 'b',
'identifier_hash' => 'ngzmiyvdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewt',
'client_site_url' => 'http://king.biz/',
'client_user_agent' => 'q',
'client_ip' => '1.102.226.211',
'attempted_at' => '2022-08-28',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/sites/1/login-attempts" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"code\": \"login_failed\",
\"detailed_reason\": \"b\",
\"identifier_hash\": \"ngzmiyvdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewt\",
\"client_site_url\": \"http:\\/\\/king.biz\\/\",
\"client_user_agent\": \"q\",
\"client_ip\": \"1.102.226.211\",
\"attempted_at\": \"2022-08-28\"
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/sites/1/login-attempts"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"code": "login_failed",
"detailed_reason": "b",
"identifier_hash": "ngzmiyvdljnikhwaykcmyuwpwlvqwrsitcpscqldzsnrwtujwvlxjklqppwqbewt",
"client_site_url": "http:\/\/king.biz\/",
"client_user_agent": "q",
"client_ip": "1.102.226.211",
"attempted_at": "2022-08-28"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/logs/logins/{teamId}
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/logs/logins/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://app.trustedlogin.com/api/v1/logs/logins/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/logs/logins/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
{
"message": "Unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/logs/logins/{teamId}/site/{siteId}
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/logs/logins/architecto/site/1';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://app.trustedlogin.com/api/v1/logs/logins/architecto/site/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/logs/logins/architecto/site/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
access-control-allow-origin: *
{
"message": "Unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET /api/v1/logs/login-attempts/{teamId}/{attemptId}
Connector fetches one attempt. Authed via CheckApiKey (api_key in body or query). Returns 404 (not 403) on cross-team requests so we never confirm existence.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/logs/login-attempts/architecto/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://app.trustedlogin.com/api/v1/logs/login-attempts/architecto/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/logs/login-attempts/architecto/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 56
access-control-allow-origin: *
{
"message": "Unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET /api/v1/logs/login-attempts/{teamId}
Paginated list of team attempts, newest-first. Same auth as
/logs/logins/{teamId}. per_page clamped to [1, 200], default 50.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/logs/login-attempts/architecto';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://app.trustedlogin.com/api/v1/logs/login-attempts/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/logs/login-attempts/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 55
access-control-allow-origin: *
{
"message": "Unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create connection tokens for all accounts a user has Returns one token foreach __owned__ teams
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/token';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Exchanges a token for one team, for all of the keys needed for that team by vendor plugin
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/token/exchange';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'token' => 'architecto',
'accountToken' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/token/exchange" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token\": \"architecto\",
\"accountToken\": \"architecto\"
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/token/exchange"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"token": "architecto",
"accountToken": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PUT api/v1/teams
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request PUT \
"https://app.trustedlogin.com/api/v1/teams" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/teams/{id}
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/teams/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE api/v1/teams/{team_id}
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"https://app.trustedlogin.com/api/v1/teams/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/teams/{team_id}/pause
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1/pause';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/teams/1/pause" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1/pause"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/teams/{team_id}
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://app.trustedlogin.com/api/v1/teams/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get team members.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1/members';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://app.trustedlogin.com/api/v1/teams/1/members" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1/members"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Unauthenticated"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/teams/{team_id}/members
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1/members';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'gbailey@example.net',
'role' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/teams/1/members" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"gbailey@example.net\",
\"role\": \"architecto\"
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1/members"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "gbailey@example.net",
"role": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
DELETE api/v1/teams/{team_id}/members/{user_id}
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1/members/1';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"https://app.trustedlogin.com/api/v1/teams/1/members/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1/members/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Cycle team keys.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1/cycle-keys';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/teams/1/cycle-keys" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1/cycle-keys"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Change team member role.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/teams/1/members/1/change-role';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/teams/1/members/1/change-role" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/teams/1/members/1/change-role"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update user name or email
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/users';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/users" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/users"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete user.
Also delete all teams user owns
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/users';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"https://app.trustedlogin.com/api/v1/users" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/users"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create user and a team for them.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/users';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request PUT \
"https://app.trustedlogin.com/api/v1/users" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/users"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/logout/remote
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/logout/remote';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request GET \
--get "https://app.trustedlogin.com/api/v1/logout/remote" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/logout/remote"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (500):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 54
access-control-allow-origin: *
{
"message": "Failed to clear remote tokens"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Sites API
The Site API is the interface between the Vendor and Client plugins, the SaaS, and the Vault.
POST api/v1/accounts/{accountId}/support-url
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/accounts/architecto/support-url';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'reason' => 'architecto',
'meta_data' => '["architecto","architecto"]',
'team' => 16,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/accounts/architecto/support-url" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"reason\": \"architecto\",
\"meta_data\": \"[\\\"architecto\\\",\\\"architecto\\\"]\",
\"team\": 16
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/accounts/architecto/support-url"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"reason": "architecto",
"meta_data": "[\"architecto\",\"architecto\"]",
"team": 16
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a site.
Adds a site to the SaaS and the Vault, associated with the vendor
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/sites';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Public Key as Bearer Token',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'accessKey' => '69a41a5d53dd23ae',
'secretId' => 'architecto',
'siteUrl' => 'https://example.com/',
'identifier' => 'architecto',
'team' => 1,
'nonce' => 'architecto',
'clientPublicKey' => 'architecto',
'version' => 'architecto',
'wpUserId' => 16,
'expiresAt' => 16,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/sites" \
--header "Authorization: Public Key as Bearer Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"accessKey\": \"69a41a5d53dd23ae\",
\"secretId\": \"architecto\",
\"siteUrl\": \"https:\\/\\/example.com\\/\",
\"identifier\": \"architecto\",
\"team\": 1,
\"nonce\": \"architecto\",
\"clientPublicKey\": \"architecto\",
\"version\": \"architecto\",
\"wpUserId\": 16,
\"expiresAt\": 16
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/sites"
);
const headers = {
"Authorization": "Public Key as Bearer Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"accessKey": "69a41a5d53dd23ae",
"secretId": "architecto",
"siteUrl": "https:\/\/example.com\/",
"identifier": "architecto",
"team": 1,
"nonce": "architecto",
"clientPublicKey": "architecto",
"version": "architecto",
"wpUserId": 16,
"expiresAt": 16
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"success": true
}
Example response (422):
{
"errors": {
"identifier": [
"The identifier field is required."
]
}
}
Example response (500):
{
"message": "Description of error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Lookup Site by Access Key(s) or Hashed Licesne Keys.
Retrieve an array of sites' secretIds by querying one or more access keys or hashed license keys
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/accounts/architecto/sites';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Private Key as Bearer Token',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'searchKeys' => [
'accessKey1',
'accessKey2',
'licenseKey1',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/accounts/architecto/sites" \
--header "Authorization: Private Key as Bearer Token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"searchKeys\": [
\"accessKey1\",
\"accessKey2\",
\"licenseKey1\"
]
}"
const url = new URL(
"https://app.trustedlogin.com/api/v1/accounts/architecto/sites"
);
const headers = {
"Authorization": "Private Key as Bearer Token",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"searchKeys": [
"accessKey1",
"accessKey2",
"licenseKey1"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"accessKey1": [
"secretId1"
],
"accessKey2": [
"secretId2",
"secretId3"
]
"accessKey2": [
"secretId2",
"secretId3"
]
}
Example response (204, No sites):
Empty response
Example response (400, no access key provided):
{
"message": "Missing searchKeys parameter in body"
}
Example response (400, access key provided, but not an array):
{
"message": "searchKeys parameter must be an array"
}
Example response (401):
Unauthenticated.
Example response (500):
{
"message": "Description of error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Site Envelope.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/sites/1/architecto/get-envelope';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Private Key as Bearer Token',
'X-TL-TOKEN' => 'SHA-256 hash of the public key and API key for this team',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request POST \
"https://app.trustedlogin.com/api/v1/sites/1/architecto/get-envelope" \
--header "Authorization: Private Key as Bearer Token" \
--header "X-TL-TOKEN: SHA-256 hash of the public key and API key for this team" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/sites/1/architecto/get-envelope"
);
const headers = {
"Authorization": "Private Key as Bearer Token",
"X-TL-TOKEN": "SHA-256 hash of the public key and API key for this team",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (401, Invalid Authorization header):
Unauthenticated.
Example response (401, Invalid X-TL-TOKEN header):
Unauthenticated.
Example response (401, Invalid nonce):
Invalid signature - identity of vendor not validate
Example response (404, Unable to verify team):
Example response (500):
{
"message": "Description of error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a site.
The url param secretId is the secretId the client used to create the site
DELETE /api/sites/<secretId>
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.trustedlogin.com/api/v1/sites/architecto';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));curl --request DELETE \
"https://app.trustedlogin.com/api/v1/sites/architecto" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://app.trustedlogin.com/api/v1/sites/architecto"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"deleted": "false"
}
Example response (201):
{
"deleted": "true"
}
Example response (404):
{
"message": "Site not found"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.