PATCH News Lockout
Turn the global news lockout on or off. While it is on, opening webhook signals are blocked from preMinutes before to postMinutes after each matching economic event.
Elite
The Management API requires an Elite subscription. See Authentication.
Endpoint
PATCH https://app.crosstrade.io/v1/api/manage/news-lockout
Headers
| Name | Required | Value |
|---|---|---|
| Authorization | Yes | Bearer <your API token> |
| Content-Type | Yes | application/json |
| If-Match | No | ETag from a previous read |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
enabled | boolean | No | Turn the news lockout on or off |
impact, currencies, preMinutes and postMinutes are read-only here, as in the web app, and your saved values are kept. You can send them back as you read them (matching values are ignored), but a value that differs from the saved one returns 422 field_read_only.
Code examples
- Python
- cURL
import requests
resp = requests.patch(
"https://app.crosstrade.io/v1/api/manage/news-lockout",
headers={"Authorization": "Bearer YOUR_TOKEN"},
json={"enabled": True},
)
print(resp.json())
curl -X PATCH https://app.crosstrade.io/v1/api/manage/news-lockout \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
Responses
- 200
- Other errors
{
"success": true,
"changed": true,
"data": { "enabled": true, "impact": ["high"], "currencies": ["USD"], "preMinutes": 5, "postMinutes": 5 },
"changedFields": ["enabled"],
"delivery": { "status": "immediate", "target": "signal_gate" },
"warnings": [],
"meta": { "requestId": "req_9f2c1a0b7d3e4f51", "etag": "\"c2:Tm90UmVhbEV0YWcwMg\"" }
}
| Status | error | When |
|---|---|---|
| 400 | invalid_json | The body is not valid JSON |
| 401 | unauthorized | Missing or invalid token |
| 403 | elite_required, not_available | See Authentication |
| 403 | plan_required | Your plan does not include the news lockout |
| 409 | concurrent_modification | Another change to the news lockout is in progress |
| 412 | precondition_failed | If-Match did not match |
| 413 | body_too_large | The body is larger than 64 KB |
| 415 | unsupported_content_type | The body is not application/json |
| 422 | field_read_only | The body contains impact, currencies, preMinutes or postMinutes with a value different from the saved one |
| 422 | validation_failed | enabled is not a boolean, or the body has an unknown field |
| 429 | rate_limited, too_many_concurrent_requests | See Rate limits |
| 503 | management_read_only, management_busy, storage_unavailable, outcome_unknown | See Errors |
When it takes effect
The next incoming webhook signal. The lockout applies to webhook signals only.
Notes
- News settings on individual monitors (
newsLockouton a monitor) are separate and are not changed here.