Updating API Integrations
If you configure Socket through the REST API rather than the dashboard, these pages map the old Security Policy and Alert Triage endpoints onto the new ones:
- Security Policy API — the per-alert-type action map becomes a policy with a baseline plus explicit rules.
- Alert Triage API — pattern rules become policy rules; specific suppressions become alert resolutions.
- Translating Alert Triage Payloads — convert a
POST /triage/alertsbody into the new requests. - Dry-Run Policy and Resolution Writes —
?dry_run=trueon the new write endpoints: check the request without saving it. Use it for policy and rule writes before you confirm the migration. - Alert Policy Migration Status — check where your organization is in the migration, and which configuration decides your alerts.
There is no time window during which you can write to both the old security-policy and triage endpoints and the new policy and rule endpoints, so it matters exactly how you change your scripts. Confirming the migration in the dashboard is the switch: policy and rule writes start working then, and the legacy writes stop. Do not wait until after cutover to start converting. Dry-run the new writes with ?dry_run=true before you confirm. The order:
- Translate your
POST /triage/alertspayloads so you know which ones become alert resolutions and which become policy rules. POSTthe resolution bodies now. Those writes work before you migrate. Tokens needalert-resolution:create(andalert-resolution:list/:read/:deleteto manage them).- Dry-run the translated policy and rule bodies. Those dry-runs work before you confirm the migration; a real
POSTstill returns409. - Confirm the migration in the dashboard. See Migrating to Policies.
POSTthe translated policy-rule bodies for real. Those writes only work after you confirm.- Stop writing to the legacy endpoints. Their
GETresponses stay200, but they will not reflect changes you make in Policies after the cutover.
The migration window is 30 days from when migration is enabled for your organization. Your dashboard shows the exact date.
All requests use https://api.socket.dev/v0 with an organization API token, passed as a bearer token or as the user field in basic auth:
curl -u "$SOCKET_API_TOKEN:" https://api.socket.dev/v0/orgs/$ORG/alert-policiesWhen Writes Switch
| API | Before you confirm | After you confirm |
|---|---|---|
Alert resolutions (/alerts/resolutions) | Writable. POST ?dry_run=true checks a create without saving. | Writable. POST ?dry_run=true still saves nothing. |
Translate (/alert-policies/migration/translate) | Works. Nothing is created. | Works. Nothing is created. |
Migration status (/alert-policies/migration/status) | Works. Read-only. | Works. Read-only. |
Policies and rules (/alert-policies, /alert-policies/{id}/rules) | Real writes return 409. ?dry_run=true returns 200 and saves nothing. | Writable. ?dry_run=true still saves nothing. |
| Legacy security-policy and triage writes | Writable. No dry-run. | Return 409. |
Legacy security-policy and triage reads (GET) | Work as they do today | Still 200, but a frozen archive. They will not reflect changes you make in Policies after the cutover. |
Confirming the migration is the only switch. There is no in-between state where both write paths work.
Endpoint Mapping
| Legacy | Replacement |
|---|---|
GET /orgs/{org_slug}/settings/security-policy | GET /orgs/{org_slug}/alert-policies and GET /orgs/{org_slug}/alert-policies/{policy_id}/rules |
POST /orgs/{org_slug}/settings/security-policy | POST /orgs/{org_slug}/alert-policies, PUT /orgs/{org_slug}/alert-policies/{policy_id}, and the rule endpoints below |
GET /orgs/{org_slug}/triage/alerts | GET /orgs/{org_slug}/alert-policies/{policy_id}/rules and GET /orgs/{org_slug}/alerts/resolutions |
POST /orgs/{org_slug}/triage/alerts | POST /orgs/{org_slug}/alert-policies/{policy_id}/rules and POST /orgs/{org_slug}/alerts/resolutions |
DELETE /orgs/{org_slug}/triage/alerts/{uuid} | DELETE /orgs/{org_slug}/alert-policies/{policy_id}/rules/{rule_id} and DELETE /orgs/{org_slug}/alerts/resolutions/{uuid} |
Each legacy triage endpoint maps onto two replacements because the legacy triage table did two different jobs. Entries that changed the action for a class of packages become policy rules; entries that suppressed a specific finding become alert resolutions. Translating Alert Triage Payloads makes that split for you from a body you already have.
Policies also gained endpoints with no legacy equivalent, because policies did not exist as objects before: GET, PUT, and DELETE on /orgs/{org_slug}/alert-policies/{policy_id}, and GET, PUT, and DELETE on a single rule.
Token Scopes
| Endpoint group | Scopes |
|---|---|
| Alert policies and rules | alert-policy:list, alert-policy:read, alert-policy:create, alert-policy:update, alert-policy:delete |
| Alert resolutions | alert-resolution:list, alert-resolution:read, alert-resolution:create, alert-resolution:delete |
| Translate a triage payload | any one of triage:alerts-update, alert-policy:read, or alert-resolution:create |
| Migration status | alert-policy:list |
| Legacy security policy | security-policy:read, security-policy:update |
| Legacy alert triage | triage:alerts-list, triage:alerts-update |
Every alert-policy write and read endpoint requires a token with organization-wide repository access; tokens restricted to specific repositories receive 403. Translate is the exception on that group: repository-restricted tokens can call it, but posting the returned requests still needs an org-wide token. Alert resolutions are readable and writable by repository-restricted tokens within their granted repositories. See Resolve Alerts.
Full Reference
Complete request and response schemas for every endpoint are in the API reference:
- Policies — list, create, get, update, delete
- Policy rules — list, create, get, update, delete
- Alert resolutions — list, create, get, delete
- Translate — translate a triage payload
- Migration status — get the migration status
- Dry-run — the
dry_runquery parameter on every policy/rule write above, and on create a resolution. See Dry-Run Policy and Resolution Writes.
Related Pages
Updated 12 days ago