Skip to main content

Enrollments

Enrollments link a Basis Theory card token to an agent through a network provider (Visa or Mastercard). During enrollment, the card brand is auto-detected and the card is registered with the corresponding network. The consumer must verify ownership before the enrollment can be used.

Authentication

All requests require a BT-API-KEY header with your Basis Theory API key.

All errors follow the standard error response format.

List Enrollments

Returns a paginated list of enrollments for your tenant.

GET
https://api.basistheory.com/agentic/enrollments
Copy

Permissions

enrollment:get

Request

curl 'https://api.basistheory.com/agentic/enrollments?limit=25' \
-H 'BT-API-KEY: <BT_API_KEY>'

Request Parameters

AttributeRequiredTypeDescription
limitNointegerNumber of results to return (default: 25, max: 100)
cursorNostringOpaque pagination cursor from a previous response

Response

Returns a paginated list of enrollment objects.

{
"data": [
{
"id": "enr_wNe75VKdzvojI9iD5fJxr",
"provider": "visa",
"status": "active",
"card": {
"brand": "visa",
"bin": "424032",
"last4": "0359",
"expiration_month": 11,
"expiration_year": 2029,
"display": {
"art_url": "https://assets.vims.visa.com/vims/cardart/abc123",
"background_color": "1A1F71",
"foreground_color": "FFFFFF",
"description": "Visa Signature",
"issuer_name": "Chase"
}
},
"created_at": "2026-01-15T10:31:00Z"
}
],
"pagination": {
"next_cursor": "eyJpZCI6ImVucl93TmU3NVZLZHp2b2pJOWlENWZKeHIifQ",
"has_more": false
}
}

Create Enrollment

Enrolls a card with a network provider. The card brand is auto-detected from the Basis Theory token data.

POST
https://api.basistheory.com/agentic/enrollments
Copy

Permissions

enrollment:create
Visa is fully supported. Mastercard support via Mastercard Agent Pay is available through a limited waitlist — contact support@basistheory.com to request access.

Request

curl -X POST https://api.basistheory.com/agentic/enrollments \
-H 'BT-API-KEY: <BT_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"token_id": "<TOKEN_ID>",
"consumer": {
"email": "consumer@example.com",
"id": "user-123",
"country_code": "US",
"language_code": "en"
},
"agent_ids": ["<AGENT_ID_1>", "<AGENT_ID_2>"]
}'

Request Parameters

AttributeRequiredTypeDescription
token_idYesstringThe Basis Theory card token ID
consumerYesobjectThe consumer object
agent_idNostringAssociate the enrollment with a single agent. Mutually exclusive with agent_ids
agent_idsNoarrayAssociate the enrollment with multiple agents (max 50). Mutually exclusive with agent_id. Duplicates are silently deduplicated

Consumer Object

AttributeRequiredTypeDescription
emailYesstringThe consumer's email address
idNostringAn identifier for the consumer in your system
country_codeNostringISO 3166-1 alpha-2 country code (default: US)
language_codeNostringLanguage code (default: en)

Response

Returns an enrollment object if successful. The enrollment will have pending_verification status until the consumer completes verification.

{
"id": "enr_wNe75VKdzvojI9iD5fJxr",
"provider": "visa",
"status": "pending_verification",
"card": {
"brand": "visa",
"bin": "424032",
"last4": "0359",
"expiration_month": 11,
"expiration_year": 2029,
"display": {
"art_url": "https://assets.vims.visa.com/vims/cardart/abc123",
"background_color": "1A1F71",
"foreground_color": "FFFFFF",
"description": "Visa Signature",
"issuer_name": "Chase"
}
},
"created_at": "2026-01-15T10:31:00Z"
}

Get Enrollment

Retrieves an enrollment by ID.

GET
https://api.basistheory.com/agentic/enrollments/{enrollment_id}
Copy

Permissions

enrollment:get

Request

curl https://api.basistheory.com/agentic/enrollments/enr_wNe75VKdzvojI9iD5fJxr \
-H 'BT-API-KEY: <BT_API_KEY>'

Request Parameters

AttributeRequiredTypeDescription
enrollment_idYesstringThe ID of the enrollment to retrieve

Response

Returns an enrollment object if successful.

{
"id": "enr_wNe75VKdzvojI9iD5fJxr",
"provider": "visa",
"status": "active",
"card": {
"brand": "visa",
"bin": "424032",
"last4": "0359",
"expiration_month": 11,
"expiration_year": 2029,
"display": {
"art_url": "https://assets.vims.visa.com/vims/cardart/abc123",
"background_color": "1A1F71",
"foreground_color": "FFFFFF",
"description": "Visa Signature",
"issuer_name": "Chase"
}
},
"created_at": "2026-01-15T10:31:00Z"
}

Delete Enrollment

Deletes an enrollment.

DELETE
https://api.basistheory.com/agentic/enrollments/{enrollment_id}
Copy

Permissions

enrollment:delete

Request

curl -X DELETE https://api.basistheory.com/agentic/enrollments/enr_wNe75VKdzvojI9iD5fJxr \
-H 'BT-API-KEY: <BT_API_KEY>'

Request Parameters

AttributeRequiredTypeDescription
enrollment_idYesstringThe ID of the enrollment to delete

Response

Returns a 204 No Content response if successful.

Verify Enrollment

Enrollment verification is a multi-step flow that confirms the consumer owns the card. The @basis-theory/react-agentic SDK handles this entire flow automatically via the verifyEnrollment() method. The individual endpoints are documented below for reference.

For frontend integration, use the verifyEnrollment() method from the @basis-theory/react-agentic SDK's useBtAi hook. It handles the full verification UI including OTP entry and passkey creation. See the Agentic Credentials guide for usage examples.

Verification Flow

  1. Start verificationPOST /enrollments/:id/verify — returns available OTP methods (or auto-approves).
  2. Select methodPOST /enrollments/:id/verify/method — chooses SMS or email for OTP delivery.
  3. Submit OTPPOST /enrollments/:id/verify/otp — submits the one-time code.
  4. CompletePOST /enrollments/:id/verify/complete — finalizes verification after passkey creation.

Start Verification

Initiates the enrollment verification flow.

POST
https://api.basistheory.com/agentic/enrollments/{enrollment_id}/verify
Copy

Permissions

enrollment:verify
curl -X POST https://api.basistheory.com/agentic/enrollments/enr_wNe75VKdzvojI9iD5fJxr/verify \
-H 'BT-API-KEY: <BT_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"device_context": {
"ip_address": "192.168.1.1"
}
}'

Returns either { "status": "approved" } if the enrollment is auto-approved, or a challenge response with available OTP methods:

{
"status": "challenge",
"methods": [
{ "id": "method_sms_001", "type": "sms", "value": "***-***-1234" },
{ "id": "method_email_001", "type": "email", "value": "j***@example.com" }
]
}

Select OTP Method

Selects which method (SMS or email) to use for OTP delivery.

POST
https://api.basistheory.com/agentic/enrollments/{enrollment_id}/verify/method
Copy

Permissions

enrollment:verify
curl -X POST https://api.basistheory.com/agentic/enrollments/enr_wNe75VKdzvojI9iD5fJxr/verify/method \
-H 'BT-API-KEY: <BT_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"method_id": "method_sms_001"
}'

Returns confirmation that the OTP was sent:

{
"status": "otp_sent",
"method": {
"id": "method_sms_001",
"type": "sms",
"value": "***-***-1234"
}
}

Submit OTP

Submits the one-time code received by the consumer.

POST
https://api.basistheory.com/agentic/enrollments/{enrollment_id}/verify/otp
Copy

Permissions

enrollment:verify
curl -X POST https://api.basistheory.com/agentic/enrollments/enr_wNe75VKdzvojI9iD5fJxr/verify/otp \
-H 'BT-API-KEY: <BT_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"otp_code": "123456"
}'

Returns a verified status if the OTP is correct. May return INVALID_OTP, OTP_EXPIRED, or MAX_ATTEMPTS_EXCEEDED errors.

Complete Verification

Finalizes verification after passkey creation on the consumer's device.

POST
https://api.basistheory.com/agentic/enrollments/{enrollment_id}/verify/complete
Copy

Permissions

enrollment:verify
curl -X POST https://api.basistheory.com/agentic/enrollments/enr_wNe75VKdzvojI9iD5fJxr/verify/complete \
-H 'BT-API-KEY: <BT_API_KEY>'

After successful completion, the enrollment status changes from pending_verification to active.

Enrollment Object

AttributeTypeDescription
idstringUnique identifier of the enrollment
providerstringThe network provider (visa or mastercard)
statusstringThe enrollment status. See enrollment statuses
cardobjectCard display metadata. See card object
created_atstringISO 8601 timestamp of when the enrollment was created

Enrollment Statuses

StatusDescription
pending_verificationAwaiting consumer verification via OTP and passkey
activeConsumer verified; enrollment can be used to create instructions
suspendedSuspended by the card network (e.g., card reported lost or stolen)
deletedEnrollment has been deleted

Card Object

AttributeTypeDescription
brandstringCard brand (e.g., visa)
binstringBank identification number (first 6 digits)
last4stringLast four digits of the card number
expiration_monthintegerCard expiration month
expiration_yearintegerCard expiration year
displayobjectCard art and display metadata. See display object

Display Object

Card art and display metadata from the card network.

AttributeTypeDescription
art_urlstringURL to the card art image
background_colorstringHex color code for the card background
foreground_colorstringHex color code for the card foreground
descriptionstringCard product description (e.g., "Visa Signature")
issuer_namestringName of the card issuer

Pagination

List endpoints use cursor-based pagination.

AttributeTypeDescription
pagination.next_cursorstringOpaque cursor for the next page (absent when no more results)
pagination.has_morebooleanWhether there are more results beyond this page

Pass next_cursor as the cursor query parameter to retrieve the next page.