Create a GitHub repository
import requests
url = "https://platform.ankra.app/api/v1/org/github/{credential_id}/repositories"
payload = { "repository_name": "<string>" }
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({repository_name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/github/{credential_id}/repositories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/github/{credential_id}/repositories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repository_name": "<string>"
}
'{
"name": "<string>",
"owner": "<string>",
"default_branch": "<string>",
"web_url": "<string>",
"git_url": "<string>",
"private": true,
"credential_name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Credentials
Create a GitHub repository
Creates a repository on GitHub with a stored GitHub credential, in the credential’s account or the given owner, and answers where it lives; the creation is audited. The GitHub App cannot create a repository in a personal account. No permission is asked of a member’s role (the browser route serves any member the viewer write gate admits); a token with a scope allowlist must carry applications.write. The credential must be one the request’s project can use.
POST
/
api
/
v1
/
org
/
github
/
{credential_id}
/
repositories
Create a GitHub repository
import requests
url = "https://platform.ankra.app/api/v1/org/github/{credential_id}/repositories"
payload = { "repository_name": "<string>" }
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({repository_name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/github/{credential_id}/repositories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/github/{credential_id}/repositories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repository_name": "<string>"
}
'{
"name": "<string>",
"owner": "<string>",
"default_branch": "<string>",
"web_url": "<string>",
"git_url": "<string>",
"private": true,
"credential_name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Headers
Body
application/json