ApiCall__c
Sobject
global class ApiCall__c extends SObjectExtends: SObject
Tracks API calls (inbound and outbound) through their full lifecycle. Each record represents a single API call with its request, response, status, and performance metrics.
Fields
| Field | Description |
|---|---|
| global List ApiIssues__r | Reciprocal relationship for ApiIssue__c.ApiCall__c. |
| global Decimal CalloutDurationMs__c | Time taken for the actual HTTP callout to the external service, in milliseconds. |
| global Decimal CommitDurationMs__c | Time taken to commit (DML) records produced by the API handler, in milliseconds. |
| global Boolean DeadLettered__c | Formula field that evaluates to true when retries are exhausted or manually dead-lettered. |
| global String Direction__c | Direction of the API call: Outbound (Salesforce calling external system) or Inbound (external system calling Salesforce). |
| global String ErrorMessages__c | Error messages encountered during API call processing. |
| global Decimal HandlerDurationMs__c | Time taken by the API handler to process the request, including validations, queries, and data transforms, in milliseconds. |
| global String HttpMethod__c | The HTTP method (verb) used for this API call: GET, POST, PUT, PATCH, or DELETE. |
| global String IdempotencyKey__c | Idempotency ensures that processing the same API request multiple times produces the same result as processing it once. |
| global String IdempotencyKeyBodyHash__c | SHA-256 hex digest of the inbound request body, captured when the call was first processed. |
| global Boolean IsIdempotencyHit__c | Indicates the response was returned from a previous API call with the same idempotency key, without re-executing the handler. |
| global Boolean IsMockedResponse__c | Indicates the response was generated by the API handler's mock class rather than an actual external callout. |
| global String LoggerContext__c | Serialized logger context from originating transaction. |
| global Boolean ManualDeadLetter__c | Admin override to permanently dead-letter a failed API call. |
| global Decimal MaxRetries__c | Maximum retry attempts for this API call. |
| global Datetime NextRetry__c | Scheduled date/time for the next retry attempt. |
| global String ParentSpanId__c | W3C Trace Context parent span ID (16 hex characters). |
| global String Request__c | The serialized request payload (JSON or XML) sent to the external web service. |
| global String RequestParameters__c | Name-value pairs of parameters passed to the API service handler for processing. |
| global String Response__c | The serialized response payload (JSON or XML) received from the external web service. |
| global Decimal Retries__c | The number of scheduled retry attempts for this web service call. |
| global String ServiceName__c | The fully qualified name of the API service handler class that processes this call. |
| global String Status__c | Current processing status: Queued (awaiting), Processing (in progress), Completed (success), Failed (error), Retry/Retrying (auto-retry), Batched (batch processing), or Aborted (service validation chose not to proceed). |
| global String StatusCode__c | The HTTP response status code returned by the external service (e.g. |
| global Decimal TotalDurationMs__c | Total processing time in milliseconds. |
| global String TraceId__c | W3C Trace Context trace ID (32 hex characters) for distributed tracing across API calls. |
| global String TriggeringRecordId__c | The Salesforce record Id that initiated this web service call. |
| global String TriggeringRecordUrl__c | Formula-generated hyperlink to the record that initiated this API call. |
| global String URL__c | The full endpoint URL to which the HTTP request was sent. |
Field Details
ApiIssues__r
global List<ApiIssue__c> ApiIssues__rReciprocal relationship for ApiIssue__c.ApiCall__c .
CalloutDurationMs__c
global Decimal CalloutDurationMs__cTime taken for the actual HTTP callout to the external service, in milliseconds. Measures network round-trip time excluding handler processing and DML.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Number(6,0) |
| Required | false |
| Unique | false |
| External ID | false |
CommitDurationMs__c
global Decimal CommitDurationMs__cTime taken to commit (DML) records produced by the API handler, in milliseconds. Part of the total duration breakdown alongside handler and callout durations.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Number(6,0) |
| Required | false |
| Unique | false |
| External ID | false |
DeadLettered__c
global Boolean DeadLettered__cFormula field that evaluates to true when retries are exhausted or manually dead-lettered. Dead-lettered calls are permanently failed and skipped by retry logic.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Checkbox |
| Formula | OR( AND( TEXT(Status__c) = "Failed", Retries__c >= MaxRetries__c ), ManualDeadLetter__c = TRUE ) |
Direction__c
global String Direction__cDirection of the API call: Outbound (Salesforce calling external system) or Inbound (external system calling Salesforce).
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Picklist |
| Required | false |
Picklist Values:
| API Name | Label | Active |
|---|---|---|
Inbound | Inbound | No |
Outbound | Outbound | Yes |
ErrorMessages__c
global String ErrorMessages__cError messages encountered during API call processing. May include validation failures, HTTP errors, or exception details. System-populated.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Long Text Area(32768) |
HandlerDurationMs__c
global Decimal HandlerDurationMs__cTime taken by the API handler to process the request, including validations, queries, and data transforms, in milliseconds. Excludes callout and commit time.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Number(6,0) |
| Required | false |
| Unique | false |
| External ID | false |
HttpMethod__c
global String HttpMethod__cThe HTTP method (verb) used for this API call: GET, POST, PUT, PATCH, or DELETE. Determined by the API handler class. System-populated.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Picklist |
| Required | false |
Picklist Values:
| API Name | Label | Active |
|---|---|---|
GET | GET | Yes |
POST | POST | Yes |
PUT | PUT | Yes |
PATCH | PATCH | Yes |
DELETE | DELETE | Yes |
IdempotencyKey__c
global String IdempotencyKey__cIdempotency ensures that processing the same API request multiple times produces the same result as processing it once. This field stores the unique key used for duplicate detection. For inbound calls, extracted from the Idempotency-Key request header. For outbound calls, auto-generated as a UUID so the receiving system can detect retries.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(255) |
| Required | false |
| Unique | false |
| External ID | true |
IdempotencyKeyBodyHash__c
global String IdempotencyKeyBodyHash__cSHA-256 hex digest of the inbound request body, captured when the call was first processed. On a subsequent inbound call with the same Idempotency-Key, the framework compares the new request body's hash against this value: if they match, the original cached response is returned; if they differ, the framework rejects with HTTP 409 to surface the contract violation. Empty for outbound calls and for inbound calls created before the body-hash check shipped (legacy records fall through to the cached-response path on replay).
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(64) |
| Required | false |
| Unique | false |
| External ID | false |
IsIdempotencyHit__c
global Boolean IsIdempotencyHit__cIndicates the response was returned from a previous API call with the same idempotency key, without re-executing the handler. Set automatically when an inbound request matches an existing idempotency key on a completed ApiCall__c record.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Checkbox |
| Default Value | false |
IsMockedResponse__c
global Boolean IsMockedResponse__cIndicates the response was generated by the API handler's mock class rather than an actual external callout. Set automatically when mocking is enabled via API_MockFactory or feature flags.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Checkbox |
| Default Value | false |
LoggerContext__c
global String LoggerContext__cSerialized logger context from originating transaction. Contains correlationId, parentTransactionId, and globalContext for cross-transaction log tracing. System-populated.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Long Text Area(32768) |
ManualDeadLetter__c
global Boolean ManualDeadLetter__cAdmin override to permanently dead-letter a failed API call. When checked, the call is treated as dead-lettered regardless of retry count.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Checkbox |
| Default Value | false |
MaxRetries__c
global Decimal MaxRetries__cMaximum retry attempts for this API call. Populated from ApiSetting__mdt.MaxRetryCount__c during creation. Used by the Dead Letter Queue formula to determine when retries are exhausted.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Number(2,0) |
| Required | false |
| Unique | false |
| External ID | false |
| Default Value | 0 |
NextRetry__c
global Datetime NextRetry__cScheduled date/time for the next retry attempt. Calculated from the retry backoff setting in ApiSetting__mdt. Only populated when Status is Retry.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Date Time |
| Required | false |
ParentSpanId__c
global String ParentSpanId__cW3C Trace Context parent span ID (16 hex characters). For inbound calls, the span ID from the incoming traceparent header. For outbound calls, the span ID of the inbound call that triggered this outbound call.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(16) |
| Required | false |
| Unique | false |
| External ID | false |
Request__c
global String Request__cThe serialized request payload (JSON or XML) sent to the external web service. Sensitive data is masked before persistence when MaskingTarget__mdt records are wired to this field.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Long Text Area(131072) |
RequestParameters__c
global String RequestParameters__cName-value pairs of parameters passed to the API service handler for processing. These are the inputs provided when the API call was created, used by the handler to build the request.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Long Text Area(131072) |
Response__c
global String Response__cThe serialized response payload (JSON or XML) received from the external web service. Sensitive data is masked before persistence when MaskingTarget__mdt records are wired to this field.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Long Text Area(131072) |
Retries__c
global Decimal Retries__cThe number of scheduled retry attempts for this web service call. Pre-incremented when a retry is scheduled (not when it executes), so a retry that has been scheduled but not yet run is reflected in the count. Maximum retries configured in the API Setting record.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Number(2,0) |
| Required | false |
| Unique | false |
| External ID | false |
| Default Value | 0 |
ServiceName__c
global String ServiceName__cThe fully qualified name of the API service handler class that processes this call.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(100) |
| Required | false |
| Unique | false |
| External ID | false |
Status__c
global String Status__cCurrent processing status: Queued (awaiting), Processing (in progress), Completed (success), Failed (error), Retry/Retrying (auto-retry), Batched (batch processing), or Aborted (service validation chose not to proceed).
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Picklist |
| Required | false |
Picklist Values:
| API Name | Label | Active |
|---|---|---|
Queued | Queued | Yes |
Aborted | Aborted | No |
Processing | Processing | No |
Completed | Completed | No |
Failed | Failed | No |
Retry | Retry | No |
Retrying | Retrying | No |
Batched | Batched | No |
StatusCode__c
global String StatusCode__cThe HTTP response status code returned by the external service (e.g. 200 = success, 400 = bad request, 401 = unauthorized, 404 = not found, 500 = server error). System-populated after the callout completes.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(50) |
| Required | false |
| Unique | false |
| External ID | false |
TotalDurationMs__c
global Decimal TotalDurationMs__cTotal processing time in milliseconds. Sum of Handler Duration, Callout Duration, and Commit Duration. System-populated.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Number(6,0) |
| Required | false |
| Unique | false |
| External ID | false |
TraceId__c
global String TraceId__cW3C Trace Context trace ID (32 hex characters) for distributed tracing across API calls. Links inbound and outbound calls within the same logical operation.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(36) |
| Required | false |
| Unique | false |
| External ID | false |
TriggeringRecordId__c
global String TriggeringRecordId__cThe Salesforce record Id that initiated this web service call. Used to link the call back to the originating record (e.g., Account, Case, or custom object).
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(80) |
| Required | false |
| Unique | false |
| External ID | false |
TriggeringRecordUrl__c
global String TriggeringRecordUrl__cFormula-generated hyperlink to the record that initiated this API call. Provides one-click navigation from the API call to the source record.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text |
| Required | false |
| Unique | false |
| External ID | false |
| Formula | HYPERLINK("/" + TriggeringRecordId__c , "Open") |
URL__c
global String URL__cThe full endpoint URL to which the HTTP request was sent. Composed of the Named Credential base URL and the endpoint path configured in ApiSetting__mdt.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Url |
| Required | false |