Create resource policy
POST
/
api
/
headless
/
v1
/
organizations
/
{organizationId}
/
resource-policies
Create resource policy
curl --request POST \
--url https://api.forge.ai/api/headless/v1/organizations/{organizationId}/resource-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {},
"reason": "<string>",
"idempotencyKey": "<string>",
"confirm": true
}
'import requests
url = "https://api.forge.ai/api/headless/v1/organizations/{organizationId}/resource-policies"
payload = {
"definition": {},
"reason": "<string>",
"idempotencyKey": "<string>",
"confirm": True
}
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({definition: {}, reason: '<string>', idempotencyKey: '<string>', confirm: true})
};
fetch('https://api.forge.ai/api/headless/v1/organizations/{organizationId}/resource-policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.forge.ai/api/headless/v1/organizations/{organizationId}/resource-policies"
payload := strings.NewReader("{\n \"definition\": {},\n \"reason\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"confirm\": 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))
}{
"item": {
"organizationId": "<string>",
"id": "<string>",
"family": "resource",
"name": "<string>",
"enabled": true,
"ownerType": "organization",
"managementMode": "forge",
"sourceRef": {},
"currentRevision": 2,
"definitionSha256": "<string>",
"definition": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"ownerId": "<string>",
"managerId": "<string>",
"managerInstance": "<string>",
"tombstonedAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Enter a Forge service-account token or delegated OAuth access token. Mintlify adds the Bearer prefix.
Path Parameters
Body
application/json
Resource Policy definition validated against the current policy-family contract.
Minimum string length:
1Minimum string length:
1Available options:
true Required range:
x >= 0Response
Resource Policy created under the requesting automation manager.
Show child attributes
Show child attributes
⌘I
Create resource policy
curl --request POST \
--url https://api.forge.ai/api/headless/v1/organizations/{organizationId}/resource-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {},
"reason": "<string>",
"idempotencyKey": "<string>",
"confirm": true
}
'import requests
url = "https://api.forge.ai/api/headless/v1/organizations/{organizationId}/resource-policies"
payload = {
"definition": {},
"reason": "<string>",
"idempotencyKey": "<string>",
"confirm": True
}
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({definition: {}, reason: '<string>', idempotencyKey: '<string>', confirm: true})
};
fetch('https://api.forge.ai/api/headless/v1/organizations/{organizationId}/resource-policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.forge.ai/api/headless/v1/organizations/{organizationId}/resource-policies"
payload := strings.NewReader("{\n \"definition\": {},\n \"reason\": \"<string>\",\n \"idempotencyKey\": \"<string>\",\n \"confirm\": 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))
}{
"item": {
"organizationId": "<string>",
"id": "<string>",
"family": "resource",
"name": "<string>",
"enabled": true,
"ownerType": "organization",
"managementMode": "forge",
"sourceRef": {},
"currentRevision": 2,
"definitionSha256": "<string>",
"definition": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"ownerId": "<string>",
"managerId": "<string>",
"managerInstance": "<string>",
"tombstonedAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}