Create a project rule
POST
/projects/{id}/rules
const url = 'https://example.com/api/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rules';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","content":"example","sort_order":1}'};
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/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rules \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "content": "example", "sort_order": 1 }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string format: uuid
Project UUID
Request Body required
Section titled “Request Body required ” Media type application/json
object
name
required
string
content
required
string
sort_order
integer
Responses
Section titled “ Responses ”Rule created
Media type application/json
object
rule
required
object
id
required
string format: uuid
project_id
required
string format: uuid
name
required
string
content
required
string
sort_order
required
integer
created_at
required
string format: date-time
updated_at
required
string format: date-time
Invalid request
Media type application/json
object
error
required
Human-readable error message
string
code
Stable machine-readable error code for client branching
string
fieldErrors
First validation message per field path
object
key
additional properties
string
issues
Structured validation issues (Zod)
Array<object>
object
path
required
string
message
required
string
retryAfter
Seconds until rate limit resets (429 responses)
number
Not authenticated
Media type application/json
object
error
required
Human-readable error message
string
code
Stable machine-readable error code for client branching
string
fieldErrors
First validation message per field path
object
key
additional properties
string
issues
Structured validation issues (Zod)
Array<object>
object
path
required
string
message
required
string
retryAfter
Seconds until rate limit resets (429 responses)
number
reconnect
True if re-linking GitHub may fix the issue
boolean