---
title: "Test action"
method: POST
path: "/api/configs/actions/test"
tags: ["Configs"]
---

# Test action

`POST /api/configs/actions/test`

Test an action script with a sample context.

## Request body

- object
  - `script` string, required — The action script to test.
  - `actionType` 'action.postFirstFactorVerification' | 'action.postSignIn', required — The action type to test.
  - `event` object, nullable, required — arbitrary JSON object
  - `environmentVariables` object — The environment variables for the action script.

## Response `200`

The result of the action script testing.

- object, nullable — arbitrary JSON object

## Other responses

- `204` — The action script returned no result.
- `400` — The request body or response body is invalid.
- `401` — Unauthorized
- `403` — Cloud connection does not have enough permission to perform the action or the tenant's subscription plan does not support this feature.
- `422` — The action script failed to execute.

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/revisions/a163dc77d842/schema)
