cURL
curl --request POST \
--url https://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete \
--header 'Content-Type: application/json' \
--data '
{
"state": "<string>",
"code": "<string>",
"iss": "<string>",
"error": "<string>",
"errorDescription": "<string>"
}
'import requests
url = "https://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete"
payload = {
"state": "<string>",
"code": "<string>",
"iss": "<string>",
"error": "<string>",
"errorDescription": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
state: '<string>',
code: '<string>',
iss: '<string>',
error: '<string>',
errorDescription: '<string>'
})
};
fetch('https://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete', 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://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete",
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([
'state' => '<string>',
'code' => '<string>',
'iss' => '<string>',
'error' => '<string>',
'errorDescription' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete"
payload := strings.NewReader("{\n \"state\": \"<string>\",\n \"code\": \"<string>\",\n \"iss\": \"<string>\",\n \"error\": \"<string>\",\n \"errorDescription\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete")
.header("Content-Type", "application/json")
.body("{\n \"state\": \"<string>\",\n \"code\": \"<string>\",\n \"iss\": \"<string>\",\n \"error\": \"<string>\",\n \"errorDescription\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"state\": \"<string>\",\n \"code\": \"<string>\",\n \"iss\": \"<string>\",\n \"error\": \"<string>\",\n \"errorDescription\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"variable": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"scope": "global",
"type": "text",
"oauth": {
"status": "connected",
"serverUrl": "<string>",
"issuer": "<string>",
"authorizationEndpoint": "<string>",
"tokenEndpoint": "<string>",
"clientId": "<string>",
"registration": "dynamic",
"tokenEndpointAuthMethod": "none",
"scopes": [
"<string>"
],
"resource": "<string>",
"clientName": "<string>",
"redirectUri": "<string>",
"connection": {
"issuer": "<string>",
"grantedScopes": [
"<string>"
],
"requiredScopes": [
"<string>"
],
"expiresAt": "<string>",
"authorizedAt": "<string>",
"lastError": "<string>"
}
},
"usedByServices": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "http",
"hostPattern": "<string>",
"accessBundles": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"reqId": "<string>",
"statusCode": 400,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 401,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 403,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 404,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 422,
"error": "<string>",
"message": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 500,
"message": "<string>",
"error": "<string>"
}Complete OAuth sign-in
Finish a sign-in for an OAuth variable with what the provider’s redirect carried, and store its tokens on the variable. Only the caller who started the sign-in can finish it. Completing one that already finished returns the variable again. A provider refusal or a mismatch is a 400 with the reason, a missing or expired sign-in a 404, and a sign-in being completed, or for settings changed since it started, a 409.
POST
/
api
/
v1
/
agent-vault
/
variables
/
{variableId}
/
authorizations
/
complete
cURL
curl --request POST \
--url https://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete \
--header 'Content-Type: application/json' \
--data '
{
"state": "<string>",
"code": "<string>",
"iss": "<string>",
"error": "<string>",
"errorDescription": "<string>"
}
'import requests
url = "https://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete"
payload = {
"state": "<string>",
"code": "<string>",
"iss": "<string>",
"error": "<string>",
"errorDescription": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
state: '<string>',
code: '<string>',
iss: '<string>',
error: '<string>',
errorDescription: '<string>'
})
};
fetch('https://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete', 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://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete",
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([
'state' => '<string>',
'code' => '<string>',
'iss' => '<string>',
'error' => '<string>',
'errorDescription' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete"
payload := strings.NewReader("{\n \"state\": \"<string>\",\n \"code\": \"<string>\",\n \"iss\": \"<string>\",\n \"error\": \"<string>\",\n \"errorDescription\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete")
.header("Content-Type", "application/json")
.body("{\n \"state\": \"<string>\",\n \"code\": \"<string>\",\n \"iss\": \"<string>\",\n \"error\": \"<string>\",\n \"errorDescription\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.infisical.com/api/v1/agent-vault/variables/{variableId}/authorizations/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"state\": \"<string>\",\n \"code\": \"<string>\",\n \"iss\": \"<string>\",\n \"error\": \"<string>\",\n \"errorDescription\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"variable": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"scope": "global",
"type": "text",
"oauth": {
"status": "connected",
"serverUrl": "<string>",
"issuer": "<string>",
"authorizationEndpoint": "<string>",
"tokenEndpoint": "<string>",
"clientId": "<string>",
"registration": "dynamic",
"tokenEndpointAuthMethod": "none",
"scopes": [
"<string>"
],
"resource": "<string>",
"clientName": "<string>",
"redirectUri": "<string>",
"connection": {
"issuer": "<string>",
"grantedScopes": [
"<string>"
],
"requiredScopes": [
"<string>"
],
"expiresAt": "<string>",
"authorizedAt": "<string>",
"lastError": "<string>"
}
},
"usedByServices": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "http",
"hostPattern": "<string>",
"accessBundles": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"reqId": "<string>",
"statusCode": 400,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 401,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 403,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 404,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 422,
"error": "<string>",
"message": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 500,
"message": "<string>",
"error": "<string>"
}Body
application/json
Was this page helpful?