Skip to content

Stripe: Cancel a Verification Session

Stripe identity.postIdentityVerificationSessionsSessionCancel: arguments, response, policy and SDK examples.

← Identity operations · Get started

Operation stripe.postidentityverificationsessionssessioncancel

Provider route: POST /v1/identity/verification_sessions/{session}/cancel. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["identity"]["postIdentityVerificationSessionsSessionCancel"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.identity.postIdentityVerificationSessionsSessionCancel(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.identity.post_identity_verification_sessions_session_cancel(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.sessionstringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Cancel a Verification Session — response body

Referenced models: Cancel a Verification Session — response body

21 more schemas are linked from the tables above, on the schema pages.

Cancel a Verification Session — response body
FieldTypePresenceDescription and constraints
$objectRootA VerificationSession guides you through the process of collecting and verifying the identities
of your users. It contains details about the type of verification, such as what [verification
check](/docs/identity/verification-checks) to perform. Only create one VerificationSession for
each verification in your system.

A VerificationSession transitions through [multiple
statuses](/docs/identity/how-sessions-work) throughout its lifetime as it progresses through
the verification flow. The VerificationSession contains the user's verified data after
verification checks are complete.

Related guide: [The Verification Sessions API](https://docs.stripe.com/identity/verification-sessions)
client_reference_idJSONOptional
client_reference_id (anyOf 1)stringAlternativeA string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems.
Maximum length: 5000
client_reference_id (anyOf 2)nullAlternative
client_secretJSONOptional
client_secret (anyOf 1)stringAlternativeThe short-lived client secret used by Stripe.js to [show a verification modal](https://docs.stripe.com/js/identity/modal) inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on [passing the client secret to the frontend](https://docs.stripe.com/identity/verification-sessions#client-secret) to learn more.
Maximum length: 5000
client_secret (anyOf 2)nullAlternative
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
last_errorJSONOptional
last_error (anyOf 1)JSONAlternativeIf present, this property tells you the last error encountered when processing the verification.
last_error (anyOf 1) (anyOf 1)ModelAlternativeExpand Cancel a Verification Session — response body — last error value Shows last Verification Session error
last_error (anyOf 2)nullAlternative
last_verification_reportJSONOptional
last_verification_report (anyOf 1)JSONAlternativeID of the most recent VerificationReport. [Learn more about accessing detailed verification results.](https://docs.stripe.com/identity/verification-sessions#results)
last_verification_report (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
last_verification_report (anyOf 1) (anyOf 2)ModelAlternativeExpand Retrieve a Verification Report — response body
last_verification_report (anyOf 2)nullAlternative
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectRequired within parentSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Additional keys: see wildcard field
metadata.*stringAdditional keysMaximum length: 500
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: identity.verification_session
optionsJSONOptional
options (anyOf 1)JSONAlternativeA set of options for the session’s verification checks.
options (anyOf 1) (anyOf 1)ModelAlternativeExpand Cancel a Verification Session — response body — options value document, email, id number, matching, phone
options (anyOf 2)nullAlternative
provided_detailsJSONOptional
provided_details (anyOf 1)JSONAlternativeDetails provided about the user being verified. These details may be shown to the user.
provided_details (anyOf 1) (anyOf 1)ModelAlternativeExpand Cancel a Verification Session — response body — provided details value email, phone
provided_details (anyOf 2)nullAlternative
redactionJSONOptional
redaction (anyOf 1)JSONAlternativeRedaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
redaction (anyOf 1) (anyOf 1)ModelAlternativeExpand Cancel a VerificationSession — response body — redaction / value / status: processing, redacted, validated
redaction (anyOf 2)nullAlternative
related_customerJSONOptional
related_customer (anyOf 1)stringAlternativeCustomer ID
Maximum length: 5000
related_customer (anyOf 2)nullAlternative
related_customer_accountJSONOptional
related_customer_account (anyOf 1)stringAlternativeThe ID of the Account representing a customer.
Maximum length: 5000
related_customer_account (anyOf 2)nullAlternative
related_personModelOptionalExpand Cancel a Verification Session — response body — related person
statusstringRequired within parentStatus of this VerificationSession. [Learn more about the lifecycle of sessions](https://docs.stripe.com/identity/how-sessions-work).
Known values: canceled, processing, requires_input, verified
typestringRequired within parentThe type of [verification check](https://docs.stripe.com/identity/verification-checks) to be performed.
Known values: document, id_number, verification_flow
urlJSONOptional
url (anyOf 1)stringAlternativeThe short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on [verifying identity documents](https://docs.stripe.com/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe.
Maximum length: 5000
url (anyOf 2)nullAlternative
verification_flowstringOptionalThe configuration token of a verification flow from the dashboard.
Maximum length: 5000
verified_outputsJSONOptional
verified_outputs (anyOf 1)JSONAlternativeThe user’s verified data.
verified_outputs (anyOf 1) (anyOf 1)ModelAlternativeExpand Cancel a Verification Session — response body — verified outputs The user’s verified data address, dob, email, first name, id number, id number type, last name, phone, sex, unparsed place of birth, unparsed sex
verified_outputs (anyOf 2)nullAlternative

Referenced models: Cancel a Verification Session — response body — provided details value email, phone, Cancel a Verification Session — response body — related person, Cancel a Verification Session — response body — last error value Shows last Verification Session error, Cancel a Verification Session — response body — options value document, email, id number, matching, phone, Cancel a Verification Session — response body — verified outputs The user’s verified data address, dob, email, first name, id number, id number type, last name, phone, sex, unparsed place of birth, unparsed sex, Retrieve a Verification Report — response body, Cancel a VerificationSession — response body — redaction / value / status: processing, redacted, validated

Cancel a Verification Session — response body — provided details value email, phone
FieldTypePresenceDescription and constraints
$objectRoot
emailstringOptionalEmail of user being verified
Maximum length: 5000
phonestringOptionalPhone number of user being verified
Maximum length: 5000
Cancel a Verification Session — response body — related person
FieldTypePresenceDescription and constraints
$objectRoot
accountstringRequired within parentToken referencing the associated Account of the related Person resource.
Maximum length: 5000
personstringRequired within parentToken referencing the related Person resource.
Maximum length: 5000
Cancel a Verification Session — response body — last error value Shows last Verification Session error
FieldTypePresenceDescription and constraints
$objectRootShows last VerificationSession error
codeJSONOptional
code (anyOf 1)stringAlternativeA short machine-readable string giving the reason for the verification or user-session failure.
Known values: abandoned, consent_declined, country_not_supported, device_not_supported, document_expired, document_type_not_supported, document_unverified_other, email_unverified_other, email_verification_declined, id_number_insufficient_document_data, id_number_mismatch, id_number_unverified_other, phone_unverified_other, phone_verification_declined, selfie_document_missing_photo, selfie_face_mismatch, selfie_manipulated, selfie_unverified_other, under_supported_age
code (anyOf 2)nullAlternative
reasonJSONOptional
reason (anyOf 1)stringAlternativeA message that explains the reason for verification or user-session failure.
Maximum length: 5000
reason (anyOf 2)nullAlternative
Create a Payment Method — response body — zip
FieldTypePresenceDescription and constraints
$objectRoot

SDK function policy ID: stripe.postidentityverificationsessionssessioncancel. Catalog operation: PostIdentityVerificationSessionsSessionCancel. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.