cURL
curl --request POST \
--url https://app.teable.ai/api/credential/grant \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"resourceType":"automation","resourceId":"string","alias":"string","replace":true,"credentialType":"secret","credentialId":"string"}'const url = 'https://app.teable.ai/api/credential/grant';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"resourceType":"automation","resourceId":"string","alias":"string","replace":true,"credentialType":"secret","credentialId":"string"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}const http = require('https');
const options = {
method: 'POST',
hostname: 'app.teable.ai',
port: null,
path: '/api/credential/grant',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
resourceType: 'automation',
resourceId: 'string',
alias: 'string',
replace: true,
credentialType: 'secret',
credentialId: 'string'
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"resourceType\":\"automation\",\"resourceId\":\"string\",\"alias\":\"string\",\"replace\":true,\"credentialType\":\"secret\",\"credentialId\":\"string\"}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("POST", "/api/credential/grant", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.teable.ai/api/credential/grant",
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([
'resourceId' => '<string>',
'credentialId' => '<string>',
'alias' => '<string>',
'replace' => true
]),
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://app.teable.ai/api/credential/grant"
payload := strings.NewReader("{\n \"resourceId\": \"<string>\",\n \"credentialId\": \"<string>\",\n \"alias\": \"<string>\",\n \"replace\": true\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://app.teable.ai/api/credential/grant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resourceId\": \"<string>\",\n \"credentialId\": \"<string>\",\n \"alias\": \"<string>\",\n \"replace\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/credential/grant")
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 \"resourceId\": \"<string>\",\n \"credentialId\": \"<string>\",\n \"alias\": \"<string>\",\n \"replace\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"credentialType": "secret",
"credentialId": "<string>",
"alias": "<string>",
"resourceType": "automation",
"resourceId": "<string>",
"baseId": "<string>",
"owner": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>",
"inSpace": true,
"isMe": true
},
"credential": {
"name": "<string>",
"missing": true,
"key": "<string>",
"provider": "<string>",
"source": "native",
"account": "<string>",
"description": "<string>"
},
"createdTime": "<string>"
}credential
Grant one of my credentials to a resource
Only the credential owner can grant it, and only to resources they can edit. An alias already bound on the resource is replaced only with replace: true.
POST
/
credential
/
grant
cURL
curl --request POST \
--url https://app.teable.ai/api/credential/grant \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"resourceType":"automation","resourceId":"string","alias":"string","replace":true,"credentialType":"secret","credentialId":"string"}'const url = 'https://app.teable.ai/api/credential/grant';
const options = {
method: 'POST',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"resourceType":"automation","resourceId":"string","alias":"string","replace":true,"credentialType":"secret","credentialId":"string"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}const http = require('https');
const options = {
method: 'POST',
hostname: 'app.teable.ai',
port: null,
path: '/api/credential/grant',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
resourceType: 'automation',
resourceId: 'string',
alias: 'string',
replace: true,
credentialType: 'secret',
credentialId: 'string'
}));
req.end();import http.client
conn = http.client.HTTPSConnection("app.teable.ai")
payload = "{\"resourceType\":\"automation\",\"resourceId\":\"string\",\"alias\":\"string\",\"replace\":true,\"credentialType\":\"secret\",\"credentialId\":\"string\"}"
headers = {
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("POST", "/api/credential/grant", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.teable.ai/api/credential/grant",
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([
'resourceId' => '<string>',
'credentialId' => '<string>',
'alias' => '<string>',
'replace' => true
]),
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://app.teable.ai/api/credential/grant"
payload := strings.NewReader("{\n \"resourceId\": \"<string>\",\n \"credentialId\": \"<string>\",\n \"alias\": \"<string>\",\n \"replace\": true\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://app.teable.ai/api/credential/grant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resourceId\": \"<string>\",\n \"credentialId\": \"<string>\",\n \"alias\": \"<string>\",\n \"replace\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.teable.ai/api/credential/grant")
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 \"resourceId\": \"<string>\",\n \"credentialId\": \"<string>\",\n \"alias\": \"<string>\",\n \"replace\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"credentialType": "secret",
"credentialId": "<string>",
"alias": "<string>",
"resourceType": "automation",
"resourceId": "<string>",
"baseId": "<string>",
"owner": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>",
"inSpace": true,
"isMe": true
},
"credential": {
"name": "<string>",
"missing": true,
"key": "<string>",
"provider": "<string>",
"source": "native",
"account": "<string>",
"description": "<string>"
},
"createdTime": "<string>"
}Autorizzazioni
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corpo
application/json
Opzioni disponibili:
automation, app Minimum string length:
1Opzioni disponibili:
secret, connection Minimum string length:
1Pattern:
^[A-Z][A-Z0-9_]{0,63}$Risposta
201 - application/json
Created
Opzioni disponibili:
secret, connection Opzioni disponibili:
automation, app Show child attributes
Show child attributes
Show child attributes
Show child attributes
Ultima modifica il 15 settembre 2026
Questa pagina è stata utile?

