Create tenant application
curl --request POST \
--url https://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scopes": [],
"auth_method": {
"type": "<string>",
"alg": "RS256",
"kid": "<string>",
"e": 65537,
"n": 123
}
}
'import requests
url = "https://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications"
payload = {
"scopes": [],
"auth_method": {
"type": "<string>",
"alg": "RS256",
"kid": "<string>",
"e": 65537,
"n": 123
}
}
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({
scopes: [],
auth_method: {type: '<string>', alg: 'RS256', kid: '<string>', e: 65537, n: 123}
})
};
fetch('https://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications', 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://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications",
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([
'scopes' => [
],
'auth_method' => [
'type' => '<string>',
'alg' => 'RS256',
'kid' => '<string>',
'e' => 65537,
'n' => 123
]
]),
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://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications"
payload := strings.NewReader("{\n \"scopes\": [],\n \"auth_method\": {\n \"type\": \"<string>\",\n \"alg\": \"RS256\",\n \"kid\": \"<string>\",\n \"e\": 65537,\n \"n\": 123\n }\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://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scopes\": [],\n \"auth_method\": {\n \"type\": \"<string>\",\n \"alg\": \"RS256\",\n \"kid\": \"<string>\",\n \"e\": 65537,\n \"n\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications")
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 \"scopes\": [],\n \"auth_method\": {\n \"type\": \"<string>\",\n \"alg\": \"RS256\",\n \"kid\": \"<string>\",\n \"e\": 65537,\n \"n\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"client_id": "<string>",
"auth_server": "<string>",
"scopes": [],
"credentials": {
"type": "<string>",
"alg": "RS256",
"kid": "<string>"
},
"_links": {
"token_url": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}API Reference
Create tenant application
Creates application for a tenant
POST
/
tenants
/
{tenant_id}
/
applications
Create tenant application
curl --request POST \
--url https://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scopes": [],
"auth_method": {
"type": "<string>",
"alg": "RS256",
"kid": "<string>",
"e": 65537,
"n": 123
}
}
'import requests
url = "https://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications"
payload = {
"scopes": [],
"auth_method": {
"type": "<string>",
"alg": "RS256",
"kid": "<string>",
"e": 65537,
"n": 123
}
}
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({
scopes: [],
auth_method: {type: '<string>', alg: 'RS256', kid: '<string>', e: 65537, n: 123}
})
};
fetch('https://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications', 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://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications",
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([
'scopes' => [
],
'auth_method' => [
'type' => '<string>',
'alg' => 'RS256',
'kid' => '<string>',
'e' => 65537,
'n' => 123
]
]),
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://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications"
payload := strings.NewReader("{\n \"scopes\": [],\n \"auth_method\": {\n \"type\": \"<string>\",\n \"alg\": \"RS256\",\n \"kid\": \"<string>\",\n \"e\": 65537,\n \"n\": 123\n }\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://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scopes\": [],\n \"auth_method\": {\n \"type\": \"<string>\",\n \"alg\": \"RS256\",\n \"kid\": \"<string>\",\n \"e\": 65537,\n \"n\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.resistant.ai/v0/tenants/{tenant_id}/applications")
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 \"scopes\": [],\n \"auth_method\": {\n \"type\": \"<string>\",\n \"alg\": \"RS256\",\n \"kid\": \"<string>\",\n \"e\": 65537,\n \"n\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"client_id": "<string>",
"auth_server": "<string>",
"scopes": [],
"credentials": {
"type": "<string>",
"alg": "RS256",
"kid": "<string>"
},
"_links": {
"token_url": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
JWT with private key. Java example Please note that Token URL is specific for a given environment. Correct URL is in the corresponding environment documentation.
Path Parameters
Body
application/json
An enumeration.
Available options:
eu-1, us-1, ap-2, ap-3, ca-1 An enumeration.
Available options:
documents.submissions.read, documents.submissions.write - RSAAuthentication
- ECAuthentication
- ClientSecretAuthentication
Show child attributes
Show child attributes
Response
Tenant application created
Auth server url
An enumeration.
Available options:
eu-1, us-1, ap-2, ap-3, ca-1 An enumeration.
Available options:
documents.submissions.read, documents.submissions.write Credentials are returned only once for newly created applications
- RSACredentials
- ECCredentials
- ClientSecretCredentials
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I