Create a site
POST
/api/sites
const url = 'https://example.com/api/sites';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"My New Site","description":"example","url":"https://example.com","repositories":["example"],"readPerm":["example"],"writePerm":["example"],"deletePerm":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/sites \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "My New Site", "description": "example", "url": "https://example.com", "repositories": [ "example" ], "readPerm": [ "example" ], "writePerm": [ "example" ], "deletePerm": [ "example" ] }'Creates a new site
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
Site name
string
Example
My New Sitedescription
Site description
string
url
Site URL
string
Example
https://example.comrepositories
Repository IDs to connect
Array<string>
readPerm
Roles with read permission
Array<string>
writePerm
Roles with write permission
Array<string>
deletePerm
Roles with delete permission
Array<string>
Responses
Section titled “Responses”Site created successfully
Media typeapplication/json
object
id
required
Site ID
string
name
required
Site name
string
description
Site description
string
url
Site URL
string
repositories
Connected repository IDs
Array<string>
createdAt
Creation timestamp
number
updatedAt
Last update timestamp
number
readPerm
Roles with read permission
Array<string>
writePerm
Roles with write permission
Array<string>
deletePerm
Roles with delete permission
Array<string>
Example
{ "id": "site-123", "name": "Marketing Site", "url": "https://example.com", "readPerm": [], "writePerm": [], "deletePerm": []}