Perform an operation advertised by a vault item
curl --request POST \
--url https://api.onkernel.com/vaults/{id_or_name}/items/{key}/operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "authorize"
}
'import requests
url = "https://api.onkernel.com/vaults/{id_or_name}/items/{key}/operations"
payload = { "type": "authorize" }
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({type: 'authorize'})
};
fetch('https://api.onkernel.com/vaults/{id_or_name}/items/{key}/operations', 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.onkernel.com/vaults/{id_or_name}/items/{key}/operations",
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([
'type' => 'authorize'
]),
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.onkernel.com/vaults/{id_or_name}/items/{key}/operations"
payload := strings.NewReader("{\n \"type\": \"authorize\"\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.onkernel.com/vaults/{id_or_name}/items/{key}/operations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"authorize\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onkernel.com/vaults/{id_or_name}/items/{key}/operations")
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 \"type\": \"authorize\"\n}"
response = http.request(request)
puts response.read_body{
"available_expansions": [
{
"description": "<string>",
"type": "payment_methods"
}
],
"available_operations": [
{
"description": "<string>",
"type": "authorize"
}
],
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"key": "<string>",
"spec": {
"authorization": {
"client": {
"type": "kernel_managed"
},
"method": "oauth"
},
"provider": "link"
},
"state": {
"provider": "link",
"status": "pending_authorization",
"status_reason": "<string>"
},
"type": "wallet",
"updated_at": "2023-11-07T05:31:56Z",
"action": {
"name": "link_oauth",
"url": "<string>"
},
"expanded": {
"payment_methods": [
{
"capabilities": {
"single_use_card": {
"eligible": true,
"reasons": [
"<string>"
]
}
},
"display": {
"brand": "<string>",
"label": "<string>",
"last4": "<string>"
},
"id": "<string>",
"is_default": true,
"provider": "<string>",
"type": "<string>"
}
]
},
"expires_at": "2023-11-07T05:31:56Z"
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}Vaults
Perform an operation advertised by a vault item
Retrieve the item first and invoke only an operation listed in available_operations, following its natural-language description. Operations may call an external provider and can return the item’s updated state.
POST
/
vaults
/
{id_or_name}
/
items
/
{key}
/
operations
Perform an operation advertised by a vault item
curl --request POST \
--url https://api.onkernel.com/vaults/{id_or_name}/items/{key}/operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "authorize"
}
'import requests
url = "https://api.onkernel.com/vaults/{id_or_name}/items/{key}/operations"
payload = { "type": "authorize" }
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({type: 'authorize'})
};
fetch('https://api.onkernel.com/vaults/{id_or_name}/items/{key}/operations', 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.onkernel.com/vaults/{id_or_name}/items/{key}/operations",
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([
'type' => 'authorize'
]),
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.onkernel.com/vaults/{id_or_name}/items/{key}/operations"
payload := strings.NewReader("{\n \"type\": \"authorize\"\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.onkernel.com/vaults/{id_or_name}/items/{key}/operations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"authorize\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onkernel.com/vaults/{id_or_name}/items/{key}/operations")
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 \"type\": \"authorize\"\n}"
response = http.request(request)
puts response.read_body{
"available_expansions": [
{
"description": "<string>",
"type": "payment_methods"
}
],
"available_operations": [
{
"description": "<string>",
"type": "authorize"
}
],
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"key": "<string>",
"spec": {
"authorization": {
"client": {
"type": "kernel_managed"
},
"method": "oauth"
},
"provider": "link"
},
"state": {
"provider": "link",
"status": "pending_authorization",
"status_reason": "<string>"
},
"type": "wallet",
"updated_at": "2023-11-07T05:31:56Z",
"action": {
"name": "link_oauth",
"url": "<string>"
},
"expanded": {
"payment_methods": [
{
"capabilities": {
"single_use_card": {
"eligible": true,
"reasons": [
"<string>"
]
}
},
"display": {
"brand": "<string>",
"label": "<string>",
"last4": "<string>"
},
"id": "<string>",
"is_default": true,
"provider": "<string>",
"type": "<string>"
}
]
},
"expires_at": "2023-11-07T05:31:56Z"
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}{
"code": "bad_request",
"message": "Missing required field: app_name",
"details": [
{
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
],
"inner_error": {
"code": "invalid_input",
"message": "Provided version string is not semver compliant"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Available options:
authorize Response
Operation completed or resumed
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Immutable item key assigned when the item is created.
- Option 1
- Option 2
Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
Available options:
wallet - Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
Live, non-persisted data requested through the item GET expand parameter.
Show child attributes
Show child attributes