Create a reveal session
curl --request POST \
--url https://api.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expires_in": 300
}
'import requests
url = "https://api.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions"
payload = { "expires_in": 300 }
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({expires_in: 300})
};
fetch('https://api.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions', 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.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions",
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([
'expires_in' => 300
]),
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.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions"
payload := strings.NewReader("{\n \"expires_in\": 300\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.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in\": 300\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions")
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 \"expires_in\": 300\n}"
response = http.request(request)
puts response.read_body{
"object": "card_reveal_session",
"id": "crs_9c590edd43234d1ce1f4c22f",
"card_id": "card_542fdd3856629b3cc74019cc",
"url": "https://reveal.agentcard.sh/r/crs_9c590edd43234d1ce1f4c22f.5d3guB0evMZaTFHkHovUlVwF9kHWfW0wuJPfRzea26c",
"expires_at": "2023-11-07T05:31:56Z",
"test_mode": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}Cards
Create a reveal session
Open Agentcard’s card page for your user, so the card’s number reaches only their browser.
POST
/
api
/
v2
/
cards
/
{card_id}
/
reveal_sessions
Create a reveal session
curl --request POST \
--url https://api.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expires_in": 300
}
'import requests
url = "https://api.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions"
payload = { "expires_in": 300 }
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({expires_in: 300})
};
fetch('https://api.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions', 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.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions",
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([
'expires_in' => 300
]),
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.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions"
payload := strings.NewReader("{\n \"expires_in\": 300\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.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expires_in\": 300\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentcard.sh/api/v2/cards/{card_id}/reveal_sessions")
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 \"expires_in\": 300\n}"
response = http.request(request)
puts response.read_body{
"object": "card_reveal_session",
"id": "crs_9c590edd43234d1ce1f4c22f",
"card_id": "card_542fdd3856629b3cc74019cc",
"url": "https://reveal.agentcard.sh/r/crs_9c590edd43234d1ce1f4c22f.5d3guB0evMZaTFHkHovUlVwF9kHWfW0wuJPfRzea26c",
"expires_at": "2023-11-07T05:31:56Z",
"test_mode": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>",
"field_errors": {},
"warnings": [
"<string>"
],
"status": "<string>",
"reason": "<string>",
"reason_code": "<string>"
}
}Show your user their card’s number, expiry and CVC without your server ever holding them. Create a session when your user asks, then open
url in their browser, in a frame or a new window. Each session shows the card once and expires after five minutes. Show your user their card walks through it.Authorizations
A platform access token. Get one on the Create an access token endpoint by exchanging your client_id + client_secret, then send it as Authorization: Bearer <token>. Tokens live one hour.
Path Parameters
Body
application/json
Seconds the link works. The session shows the card once within that window.
Required range:
60 <= x <= 900Response
The session.
Available options:
card_reveal_session Example:
"crs_9c590edd43234d1ce1f4c22f"
Example:
"card_542fdd3856629b3cc74019cc"
Agentcard's card page for this session. Open it in your user's browser.
Example:
"https://reveal.agentcard.sh/r/crs_9c590edd43234d1ce1f4c22f.5d3guB0evMZaTFHkHovUlVwF9kHWfW0wuJPfRzea26c"
True for a test card. The page says so.