External controls API
- Tier: Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
Use the external controls API to set the status of a check that uses an external service.
Set status of an external control
For a single external control, use the API to inform GitLab that a control has passed or failed a check by an external service.
Authentication
External controls API requires HMAC, Timestamp, and Nonce authentication for security.
Endpoint
POST /api/v4/projects/:id/compliance_external_controls/:external_control_id/status
HTTP Headers:
Header | Type | Required | Description |
---|---|---|---|
X-Gitlab-Timestamp | string | yes | Current Unix timestamp. |
X-Gitlab-Nonce | string | yes | Random string or token to prevent replay attacks. |
X-Gitlab-Hmac-Sha256 | string | yes | HMAC-SHA256 signature of the request. |
Supported attributes:
Attribute | Type | Required | Description |
---|---|---|---|
id | integer | yes | ID of a project. |
external_control_id | integer | yes | ID of an external control. |
status | string | yes | Set to pass to mark the control as passed, or fail to fail it. |
If successful, returns 200 OK
and the following
response attributes:
Attribute | Type | Description |
---|---|---|
status | string | The status that has been set for the control. |
Example request:
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "X-Gitlab-Timestamp: <X-Gitlab-Timestamp>" \
--header "X-Gitlab-Nonce: <X-Gitlab-Nonce>" \
--header "X-Gitlab-Hmac-Sha256: <X-Gitlab-Hmac-Sha256>" \
--header "Content-Type: application/json" \
--data '{"status": "pass"}' \
--url "https://gitlab.example.com/api/v4/projects/<id>/compliance_external_controls/<external_control_id>/status"
Example response:
{
"status":"pass"
}
Related topics
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support