Skip to main content

Instructions

Instructions define spending rules for a purchase. Each instruction is tied to an enrollment and specifies an amount, optional description, and optional expiration. The consumer must verify the instruction before virtual card credentials can be retrieved.

Authentication

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

All errors follow the standard error response format.

List Instructions

Returns a paginated list of instructions for an agent.

GET
https://api.basistheory.com/agentic/agents/{agent_id}/instructions
Copy

Permissions

agent:instruction:get

Request

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

Request Parameters

AttributeRequiredTypeDescription
agent_idYesstringThe ID of the agent
enrollment_idNostringFilter instructions by enrollment ID
limitNointegerNumber of results to return (default: 25, max: 100)
cursorNostringOpaque pagination cursor from a previous response

Response

Returns a paginated list of instruction objects.

{
"data": [
{
"id": "ins_luPDv2xm3Yb8RjFJz9oTC",
"enrollment_id": "enr_wNe75VKdzvojI9iD5fJxr",
"status": "approved",
"amount": {
"value": "500.00",
"currency": "USD"
},
"expires_at": "2026-02-20T00:00:00Z",
"created_at": "2026-01-15T10:35:00Z"
}
],
"pagination": {
"next_cursor": "eyJpZCI6Imluc19sdVBEdjJ4bTNZYjhSakZKejlvVEMifQ",
"has_more": false
}
}

Create Instruction

Creates a new purchase instruction for an enrollment.

POST
https://api.basistheory.com/agentic/agents/{agent_id}/instructions
Copy

Permissions

agent:instruction:create

Request

curl -X POST https://api.basistheory.com/agentic/agents/agt_fukICjsY2xzRCECiTCbKM/instructions \
-H 'BT-API-KEY: <BT_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"enrollment_id": "enr_wNe75VKdzvojI9iD5fJxr",
"amount": {
"value": "500.00",
"currency": "USD"
},
"description": "Purchase electronics",
"expires_at": "2026-02-20T00:00:00Z"
}'

Request Parameters

AttributeRequiredTypeDescription
agent_idYesstringThe ID of the agent
enrollment_idYesstringThe ID of the enrollment to create the instruction for
amountYesobjectThe amount object defining the spending limit
descriptionNostringA description of the purchase
expires_atNostringISO 8601 timestamp for when the instruction expires

Amount Object

AttributeRequiredTypeDescription
valueYesstringThe monetary amount (e.g., "500.00")
currencyNostringISO 4217 currency code (default: USD)

Response

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

{
"id": "ins_luPDv2xm3Yb8RjFJz9oTC",
"enrollment_id": "enr_wNe75VKdzvojI9iD5fJxr",
"status": "pending_verification",
"amount": {
"value": "500.00",
"currency": "USD"
},
"expires_at": "2026-02-20T00:00:00Z",
"created_at": "2026-01-15T10:35:00Z"
}

Get Instruction

Retrieves an instruction by ID.

GET
https://api.basistheory.com/agentic/agents/{agent_id}/instructions/{instruction_id}
Copy

Permissions

agent:instruction:get

Request

curl https://api.basistheory.com/agentic/agents/agt_fukICjsY2xzRCECiTCbKM/instructions/ins_luPDv2xm3Yb8RjFJz9oTC \
-H 'BT-API-KEY: <BT_API_KEY>'

Request Parameters

AttributeRequiredTypeDescription
agent_idYesstringThe ID of the agent
instruction_idYesstringThe ID of the instruction to retrieve

Response

Returns an instruction object if successful.

{
"id": "ins_luPDv2xm3Yb8RjFJz9oTC",
"enrollment_id": "enr_wNe75VKdzvojI9iD5fJxr",
"status": "approved",
"amount": {
"value": "500.00",
"currency": "USD"
},
"expires_at": "2026-02-20T00:00:00Z",
"created_at": "2026-01-15T10:35:00Z"
}

Update Instruction

Updates an existing instruction.

PATCH
https://api.basistheory.com/agentic/agents/{agent_id}/instructions/{instruction_id}
Copy

Permissions

agent:instruction:update

Request

curl -X PATCH https://api.basistheory.com/agentic/agents/agt_fukICjsY2xzRCECiTCbKM/instructions/ins_luPDv2xm3Yb8RjFJz9oTC \
-H 'BT-API-KEY: <BT_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"amount": {
"value": "750.00",
"currency": "USD"
},
"expires_at": "2026-03-20T00:00:00Z"
}'

Request Parameters

AttributeRequiredTypeDescription
agent_idYesstringThe ID of the agent
instruction_idYesstringThe ID of the instruction to update
amountNoobjectUpdated amount object
expires_atNostringUpdated ISO 8601 expiration timestamp

Response

Returns the updated instruction object if successful.

{
"id": "ins_luPDv2xm3Yb8RjFJz9oTC",
"enrollment_id": "enr_wNe75VKdzvojI9iD5fJxr",
"status": "approved",
"amount": {
"value": "750.00",
"currency": "USD"
},
"expires_at": "2026-03-20T00:00:00Z",
"created_at": "2026-01-15T10:35:00Z"
}

Delete Instruction

Deletes an instruction.

DELETE
https://api.basistheory.com/agentic/agents/{agent_id}/instructions/{instruction_id}
Copy

Permissions

agent:instruction:delete

Request

curl -X DELETE https://api.basistheory.com/agentic/agents/agt_fukICjsY2xzRCECiTCbKM/instructions/ins_luPDv2xm3Yb8RjFJz9oTC \
-H 'BT-API-KEY: <BT_API_KEY>'

Request Parameters

AttributeRequiredTypeDescription
agent_idYesstringThe ID of the agent
instruction_idYesstringThe ID of the instruction to delete

Response

Returns a 204 No Content response if successful.

Verify Instruction

Instruction verification is a multi-step flow that requires the consumer to authenticate via passkey. The @basis-theory/react-agentic SDK handles this flow automatically via the verifyInstruction() method. The individual endpoints are documented below for reference.

For frontend integration, use the verifyInstruction() method from the @basis-theory/react-agentic SDK's useBtAi hook. It handles the passkey authentication UI. See the Agentic Credentials guide for usage examples.

Verification Flow

  1. Start verificationPOST /agents/:id/instructions/:id/verify — initiates passkey challenge.
  2. Submit passkeyPOST /agents/:id/instructions/:id/verify/passkey — submits the passkey assertion.

Start Verification

Initiates the instruction verification flow.

POST
https://api.basistheory.com/agentic/agents/{agent_id}/instructions/{instruction_id}/verify
Copy

Permissions

agent:instruction:verify
curl -X POST https://api.basistheory.com/agentic/agents/agt_fukICjsY2xzRCECiTCbKM/instructions/ins_luPDv2xm3Yb8RjFJz9oTC/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": "verified" } if passkeys are bypassed, or a challenge response for passkey authentication.

Submit Passkey

Submits the passkey/FIDO assertion to complete instruction verification.

POST
https://api.basistheory.com/agentic/agents/{agent_id}/instructions/{instruction_id}/verify/passkey
Copy

Permissions

agent:instruction:verify
curl -X POST https://api.basistheory.com/agentic/agents/agt_fukICjsY2xzRCECiTCbKM/instructions/ins_luPDv2xm3Yb8RjFJz9oTC/verify/passkey \
-H 'BT-API-KEY: <BT_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"assurance_data": "<PASSKEY_ASSERTION>"
}'

After successful verification, the instruction status changes from pending_verification to approved. May return a PASSKEY_FAILED error if the assertion is invalid.

Instruction Object

AttributeTypeDescription
idstringUnique identifier of the instruction
enrollment_idstringThe ID of the enrollment this instruction belongs to
statusstringThe instruction status: pending, pending_verification, approved, expired, cancelled, or failed
amountobjectThe spending limit. See amount object
descriptionstringA description of the purchase (if provided during creation)
expires_atstringISO 8601 timestamp for when the instruction expires
created_atstringISO 8601 timestamp of when the instruction was created

Instruction Statuses

StatusDescription
pendingAwaiting provider approval
pending_verificationProvider approved; awaiting consumer verification via passkey
approvedConsumer verified; virtual card credentials can be retrieved
expiredPast the expires_at time; credentials can no longer be retrieved
cancelledCancelled before use
failedVerification or provider failure
Credentials can only be retrieved for instructions with approved status.

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.