solarOS Organization API

Organization API

Repair an External Reference target

Repoints one existing tenant-scoped External Reference only when expectedCurrentResourceType and expectedCurrentResourceId exactly match the current target. Missing tuples return 404; stale guards return 409. Required scope: external_references:write.

/api/v1/external-references

Repoints one existing tenant-scoped External Reference only when expectedCurrentResourceType and expectedCurrentResourceId exactly match the current target. Missing tuples return 404; stale guards return 409. Required scope: external_references:write.

Repair an External Reference target. Use an organization API key with external_references:write. Check the response envelope and meta.requestId before triggering dependent workflow steps.

Required scopes

external_references:write

Parameters

No path or query parameters.

Request body

objectrequired
FieldTypeDescription
resourceTyperequiredstringOptional unless marked required.
resourceIdrequiredstringOptional unless marked required.
expectedCurrentResourceTyperequiredstringOptional unless marked required.
expectedCurrentResourceIdrequiredstringOptional unless marked required.
externalSystemrequiredstringOptional unless marked required.
externalObjectrequiredstringOptional unless marked required.
externalIdrequiredstringOptional unless marked required.
metadataobjectOptional unless marked required.
repairexternalreferenceRequest
{
  "resourceType": "WorkOrder",
  "resourceId": "work_order_456",
  "expectedCurrentResourceType": "WorkOrder",
  "expectedCurrentResourceId": "work_order_123",
  "externalSystem": "salesforce",
  "externalObject": "WorkOrder",
  "externalId": "0WO123"
}

Responses

200

External Reference repaired envelope

#/components/schemas/OrgApiResourceEnvelope

400

Invalid External Reference repair payload

#/components/schemas/OrgApiError

401

Missing or invalid organization API key

#/components/schemas/OrgApiError

402

Organization billing access or an endpoint-specific business quota denied the request

#/components/schemas/OrgApiError

403

Missing external_references:write scope

#/components/schemas/OrgApiError

404

External Reference not found

#/components/schemas/OrgApiError

409

Expected current target did not match

#/components/schemas/OrgApiError

429

Rate limit exceeded

#/components/schemas/OrgApiError

Errors

400 Invalid External Reference repair payload401 Missing or invalid organization API key402 Organization billing access or an endpoint-specific business quota denied the request403 Missing external_references:write scope404 External Reference not found409 Expected current target did not match429 Rate limit exceeded

Static examples

curl -X PATCH "$SOLAROS_BASE_URL/api/v1/external-references" \
  -H "Authorization: Bearer $SOLAROS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"resourceType":"WorkOrder","resourceId":"work_order_456","expectedCurrentResourceType":"WorkOrder","expectedCurrentResourceId":"work_order_123","externalSystem":"salesforce","externalObject":"WorkOrder","externalId":"0WO123"}'