---
title: "Request to send a script to a device"
method: POST
path: "/sendScript"
---

# Request to send a script to a device

`POST /sendScript`

This method is used by TSH to provide a script to a device.

## Headers

- `x-pod` string, required

## Request body

- SendScriptReq
  - `requestHeader` RequestHeader, required
    - `requestId` string, required — Unique request identifier
    - `sessionId` string, required — Unique session identifier used to trace the calls across systems during a use case.
    - `generationDateTime` string, date-time — Date time representing when the request or response has been generated.<br/>RFC3339 format.<br/> Examples:<li>"2018-12-24T17:32:28Z"<li>"2019-10-02T10:00:00-05:00"
  - `taskId` string, required — Unique task identifier used to correlate a callback to a request.
  - `walletCardId` string, required — The Wallet Card Identifier. Unique for each wallet card.
  - `seId` string, required — Secure Element Identifier
  - `apduCommands` object[], required — List of APDU commands to send to a secure element.
    - `data` string, required — APDU command to execute on SE, encoded in Hex string.
    - `messageId` string, required — ID of the command to execute
    - `messageName` string — Descriptive name of the command that needs to be executed.

## Response `200`

sendScript response payload

- SendScriptRes
  - `responseHeader` object, required
    - `responseId` string, required — Unique response identifier
    - `sessionId` string, required — Unique session identifier used to trace the calls across systems during a use case.
    - `generationDateTime` string, date-time — Date time representing when the request or response has been generated.<br/>RFC3339 format.<br/> Examples:<li>"2018-12-24T17:32:28Z"<li>"2019-10-02T10:00:00-05:00"
    - `statusCode` number, required — Status code to the request |Status code | Description| |-------|-------| |0|OK| |111|Missing mandatory parameter| |112|Bad parameter format| |119|Unknown virtual card| |321|Operation already on-going for this device| |432|Operation is not allowed with current card state| |911|Operation failed| |921|Unexpected server error|
    - `statusMessage` string — Textual status message

## Other responses

- `500` — Internal Server Error

---

[API](https://skmtc.net/thalescloud/apis/d1-oauth-api.md) · [All operations](https://skmtc.net/thalescloud/apis/d1-oauth-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thalescloud/d1-oauth-api/versions/96089514858c/schema)
