Change access policies
curl --request PUT \
--url https://api.airshipci.com/api/v1/access-control \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repository_resource_access": [
{
"repository": "<string>",
"resources": [
"<string>"
],
"action": "add",
"policy_args": {},
"roles": [
"<string>"
],
"teams": [
"<string>"
],
"users": [
"<string>"
],
"users_from_json": "<string>"
}
]
}
'import requests
url = "https://api.airshipci.com/api/v1/access-control"
payload = { "repository_resource_access": [
{
"repository": "<string>",
"resources": ["<string>"],
"action": "add",
"policy_args": {},
"roles": ["<string>"],
"teams": ["<string>"],
"users": ["<string>"],
"users_from_json": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
repository_resource_access: [
{
repository: '<string>',
resources: ['<string>'],
action: 'add',
policy_args: {},
roles: ['<string>'],
teams: ['<string>'],
users: ['<string>'],
users_from_json: '<string>'
}
]
})
};
fetch('https://api.airshipci.com/api/v1/access-control', 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.airshipci.com/api/v1/access-control"
payload := strings.NewReader("{\n \"repository_resource_access\": [\n {\n \"repository\": \"<string>\",\n \"resources\": [\n \"<string>\"\n ],\n \"action\": \"add\",\n \"policy_args\": {},\n \"roles\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ],\n \"users_from_json\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"access_yml": {
"access_control": [
{
"policies": [
"<string>"
],
"resource": "<string>"
}
],
"policies": [
{
"id": "<string>",
"repo": "<string>",
"pull_request": true,
"roles": [
"<string>"
],
"teams": [
"<string>"
],
"users": [
"<string>"
]
}
],
"version": 123
},
"branch": "<string>",
"pull_request_url": "<string>"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Change access policies
PUT
/
api
/
v1
/
access-control
Change access policies
curl --request PUT \
--url https://api.airshipci.com/api/v1/access-control \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repository_resource_access": [
{
"repository": "<string>",
"resources": [
"<string>"
],
"action": "add",
"policy_args": {},
"roles": [
"<string>"
],
"teams": [
"<string>"
],
"users": [
"<string>"
],
"users_from_json": "<string>"
}
]
}
'import requests
url = "https://api.airshipci.com/api/v1/access-control"
payload = { "repository_resource_access": [
{
"repository": "<string>",
"resources": ["<string>"],
"action": "add",
"policy_args": {},
"roles": ["<string>"],
"teams": ["<string>"],
"users": ["<string>"],
"users_from_json": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
repository_resource_access: [
{
repository: '<string>',
resources: ['<string>'],
action: 'add',
policy_args: {},
roles: ['<string>'],
teams: ['<string>'],
users: ['<string>'],
users_from_json: '<string>'
}
]
})
};
fetch('https://api.airshipci.com/api/v1/access-control', 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.airshipci.com/api/v1/access-control"
payload := strings.NewReader("{\n \"repository_resource_access\": [\n {\n \"repository\": \"<string>\",\n \"resources\": [\n \"<string>\"\n ],\n \"action\": \"add\",\n \"policy_args\": {},\n \"roles\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ],\n \"users_from_json\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"access_yml": {
"access_control": [
{
"policies": [
"<string>"
],
"resource": "<string>"
}
],
"policies": [
{
"id": "<string>",
"repo": "<string>",
"pull_request": true,
"roles": [
"<string>"
],
"teams": [
"<string>"
],
"users": [
"<string>"
]
}
],
"version": 123
},
"branch": "<string>",
"pull_request_url": "<string>"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Authorizations
Developer API token (asa_...), created by an organization owner in the dashboard.
Body
application/json