PUT/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts

Set status check contexts

Replaces the status check contexts configured for a protected branch in a repository. Supply the complete set of context names in contexts, either in an object or as a top-level array; the request body can be omitted. The branch name cannot contain wildcard characters.

3 parameters · 1 body field
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
branchstringrequired
The branch name whose status check contexts to replace. Cannot contain wildcard characters.

The status check contexts to set. Send either an object containing contexts or a top-level array of context names.

contextsarray<string>required
The name of the status checks

3 status codes
200Returns an array of status check context names set for the branch.
404Returned when the repository or branch cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 404 is returned when the repository or branch cannot be found. A 422 is returned when validation fails or the endpoint has been spammed. The branch path parameter cannot contain wildcard characters.