curl --request POST \
--url https://api.opal.dev/v1/campaigns/{campaign_id}/end \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opal.dev/v1/campaigns/{campaign_id}/end"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.opal.dev/v1/campaigns/{campaign_id}/end', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opal.dev/v1/campaigns/{campaign_id}/end",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.opal.dev/v1/campaigns/{campaign_id}/end"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.opal.dev/v1/campaigns/{campaign_id}/end")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/campaigns/{campaign_id}/end")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"campaign_id": "f454d283-ca87-4a8a-bdbb-df212eca5353",
"name": "Q3 Access Review",
"status": "DRAFT",
"is_template": false,
"created_at": "2026-07-01T00:00:00.000Z",
"updated_at": "2026-07-01T00:00:00.000Z",
"created_by_user_id": "32acc112-21ff-4669-91c2-21e27683eaa1",
"configuration": null,
"started_at": null,
"started_by_user_id": null,
"stopped_at": null,
"stopped_by_user_id": null,
"ended_at": null,
"ended_by_user_id": null
}Ends a stopped campaign, setting ended_at and ended_by_user_id,
applying pending access changes, and queuing report generation.
Returns 400 unless the campaign is started and stopped and not already
ended.
curl --request POST \
--url https://api.opal.dev/v1/campaigns/{campaign_id}/end \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.opal.dev/v1/campaigns/{campaign_id}/end"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.opal.dev/v1/campaigns/{campaign_id}/end', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opal.dev/v1/campaigns/{campaign_id}/end",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.opal.dev/v1/campaigns/{campaign_id}/end"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.opal.dev/v1/campaigns/{campaign_id}/end")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opal.dev/v1/campaigns/{campaign_id}/end")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"campaign_id": "f454d283-ca87-4a8a-bdbb-df212eca5353",
"name": "Q3 Access Review",
"status": "DRAFT",
"is_template": false,
"created_at": "2026-07-01T00:00:00.000Z",
"updated_at": "2026-07-01T00:00:00.000Z",
"created_by_user_id": "32acc112-21ff-4669-91c2-21e27683eaa1",
"configuration": null,
"started_at": null,
"started_by_user_id": null,
"stopped_at": null,
"stopped_by_user_id": null,
"ended_at": null,
"ended_by_user_id": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the campaign.
Response
The ended Campaign.
An access review campaign.
The ID of the campaign.
"f454d283-ca87-4a8a-bdbb-df212eca5353"
The name of the campaign.
"Q3 Access Review"
The current status of a campaign.
DRAFT, ONGOING, COMPLETED, STOPPED, ENDED "ONGOING"
Whether this campaign is a recurring schedule template. Templates spawn draft campaigns on schedule rather than being reviewed directly.
false
The creation time of the campaign.
"2026-07-01T00:00:00.000Z"
The last updated time of the campaign.
"2026-07-01T00:00:00.000Z"
The ID of the user who created the campaign.
"32acc112-21ff-4669-91c2-21e27683eaa1"
The campaign's configuration, if set.
Show child attributes
Show child attributes
{
"configuration_id": "39a4d283-ca87-4a8a-bdbb-df212eca5fdb",
"created_at": "2026-07-01T00:00:00.000Z",
"updated_at": "2026-07-01T00:00:00.000Z",
"query": null,
"reviewer_assignment_policy": "MANUALLY",
"allow_self_review": false,
"send_reviewer_assignment_notification": true,
"allow_reviewer_reassignment": false,
"start_date": null,
"end_date": "2026-09-30T00:00:00.000Z",
"timezone": "America/Los_Angeles",
"revoke_on": "END",
"reminder_schedule": [7, 3, 1],
"reminder_include_manager": true,
"require_reason_on_denial": false,
"hide_ai_suggestions": false,
"custom_start_message": null,
"group_asset_visibility_policy": "STRICT",
"is_template": false,
"cron_expression": null,
"next_scheduled_run": null,
"last_scheduled_run": null,
"recurring_duration_days": null
}
The time the campaign was started, if started.
"2026-07-02T00:00:00.000Z"
The ID of the user who started the campaign, if started.
"32acc112-21ff-4669-91c2-21e27683eaa1"
The time the campaign was manually stopped, if stopped.
"2026-07-10T00:00:00.000Z"
The ID of the user who stopped the campaign, if stopped.
"32acc112-21ff-4669-91c2-21e27683eaa1"
The time the campaign reached its scheduled end, if ended.
"2026-07-14T00:00:00.000Z"
The ID of the user who ended the campaign, if ended.
"32acc112-21ff-4669-91c2-21e27683eaa1"
Was this page helpful?