Run the instrument expiry pass now, as a job, instead of waiting for the hourly tick
POST
/admin/instruments/expiry-sweep
curl --request POST \ --url http://localhost:3001/admin/instruments/expiry-sweep \ --header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3001/admin/instruments/expiry-sweep"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.json())use reqwest;
#[tokio::main]pub async fn main() { let url = "http://localhost:3001/admin/instruments/expiry-sweep";
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}Same function the background task calls, so an on-demand run and a scheduled one cannot diverge. Useful right after seeding a calendar (every dated contract gets its instant immediately) and for confirming a correction took effect. Answers at once with the job id; the counts are the job’s result.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Started; follow it at /admin/jobs/{job_id}; the result is an ExpirySweepResult
Media typeapplication/json
object
job_id
required
string format: uuid
Example generated
{ "job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}