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<ApiIssue__c> 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 | True when a call has Failed and its retry count has reached its Max Retries, or an administrator ticked Manual Dead Letter. |
| 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 as it was received. |
| 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 Boolean IsPermanentFailure__c | Ticked when the call failed in a way that sending the same request again cannot fix: the service's code raised a permanent failure. |
| global List<ApiCall__c> LaterAttempts__r | Reciprocal relationship for ApiCall__c.PreviousAttempt__c. |
| global String LoggerContext__c | Serialized logger context from originating transaction. |
| global Boolean ManualDeadLetter__c | Ticked by an administrator to show a failed call in the Dead Letters list as given up on. |
| 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 Id PreviousAttempt__c | The earlier call this call tried again: the call a Retry or a replay ran again, or, for a request your org received, the earlier failed call with the same Idempotency-Key and body when the service has Idempotency Enabled. |
| global ApiCall__c PreviousAttempt__r | The earlier call this call tried again: the call a Retry or a replay ran again, or, for a request your org received, the earlier failed call with the same Idempotency-Key and body when the service has Idempotency Enabled. |
| 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 | Every retry of this call: the ones sent again at once in the same transaction and the ones scheduled for later, added up across runs. |
| 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, no further retry), Retry (scheduled for an automatic retry at Next Retry), Retrying (the retry is running), Batched (batch processing), or Aborted (the call never left your org). |
| 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 record that started this web service call: a Salesforce record ID, or other text of up to 80 characters, such as an order number from another system. |
| global String TriggeringRecordIndex__c | A copy of the Triggering Record ID field, kept so you can find the calls of one record quickly, even with many calls. |
| 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. |
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__cTrue when a call has Failed and its retry count has reached its Max Retries, or an administrator ticked Manual Dead Letter. Retry does not read it; a call that must never run again is marked Permanent Failure.
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 as it was received. It is recorded on every inbound call that reaches a handler, with or without an Idempotency-Key. A request refused because no handler can be built for its service keeps only the start of its body and no hash. When a later request arrives with the same Idempotency-Key, its body's hash is compared with this value: if they match, the original answer is returned again; if they differ, the request is refused with HTTP 409. The hash also shows whether the body stored on the call is an exact copy of the body received. Empty for outbound calls and for inbound calls saved before the hash was recorded; such a call with a key returns its original answer to a later request with the same key.
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 |
IsPermanentFailure__c
global Boolean IsPermanentFailure__cTicked when the call failed in a way that sending the same request again cannot fix: the service's code raised a permanent failure. A refused request (RequestRefusedException) does not tick it, so it can be run again once the cause is fixed. Retry and Retry Selected never run a ticked call again.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Checkbox |
| External ID | false |
| Default Value | false |
LaterAttempts__r
global List<ApiCall__c> LaterAttempts__rReciprocal relationship for ApiCall__c.PreviousAttempt__c .
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__cTicked by an administrator to show a failed call in the Dead Letters list as given up on. It does not stop a scheduled retry, and Retry does not read it.
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 |
PreviousAttempt__c
global Id PreviousAttempt__cThe earlier call this call tried again: the call a Retry or a replay ran again, or, for a request your org received, the earlier failed call with the same Idempotency-Key and body when the service has Idempotency Enabled.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | ApiCall__c |
| Required | false |
| External ID | false |
PreviousAttempt__r
global ApiCall__c PreviousAttempt__rThe earlier call this call tried again: the call a Retry or a replay ran again, or, for a request your org received, the earlier failed call with the same Idempotency-Key and body when the service has Idempotency Enabled.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | ApiCall__c |
| Required | 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__cEvery retry of this call: the ones sent again at once in the same transaction and the ones scheduled for later, added up across runs. A scheduled retry is counted when it is scheduled. When the count reaches Max Retries the call is not retried again.
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, no further retry), Retry (scheduled for an automatic retry at Next Retry), Retrying (the retry is running), Batched (batch processing), or Aborted (the call never left your org).
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 record that started this web service call: a Salesforce record ID, or other text of up to 80 characters, such as an order number from another system. Used to link the call back to where it came from.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(80) |
| Required | false |
| Unique | false |
| External ID | false |
TriggeringRecordIndex__c
global String TriggeringRecordIndex__cA copy of the Triggering Record ID field, kept so you can find the calls of one record quickly, even with many calls. It is filled on every save with the value exactly as written, a record Id or any other text, and is blank when the source is blank. Calls saved before this field existed may have it blank.
Field Attributes:
| Attribute | Value |
|---|---|
| Data Type | Text(80) |
| Required | false |
| Unique | false |
| External ID | true |
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 |