Create an org-level variable
POST
/orgs/{org}/actions/variables/{variablename}
const url = 'https://gitea.example.com/api/v1/orgs/example/actions/variables/example';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"description":"example","value":"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://gitea.example.com/api/v1/orgs/example/actions/variables/example \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "description": "example", "value": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”org
required
string
Name of the organization
variablename
required
string
Name of the variable
Request Body
Section titled “Request Body”Media typeapplication/json
CreateVariableOption the option when creating variable
object
description
Description of the variable to create
string
value
required
Value of the variable to create
string
Examplegenerated
{ "description": "example", "value": "example"}Responses
Section titled “Responses”Successfully created the org-level variable
Media typeapplication/json
APIError is error format response
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string
Variable name already exists.
Media typeapplication/json
APIError is error format response
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string