---
title: "sign_in_test_end_user"
description: "Generated reference for the management action sign_in_test_end_user: its description, access metadata, payload contract, and registration status."
slug: /reference/actions/sign-in-test-end-user
order: 81
visibility: public
redirects_from: []
---

# sign\_in\_test\_end\_user

Generated automatically from the [published contract sources](/cloud/reference/about/#contract-sources).

A script calls this action over HTTPS at `POST https://tzcloud.dev.turnzero.ai/v1/sign_in_test_end_user`, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool `tzcloud_sign_in_test_end_user`.

OAuth access tokens and minted tokens, including the turnzero command's computer token, are bearer credentials. The action determines which kinds, scopes and grants it accepts ([Sign-in, sessions, and tokens](/cloud/concepts/sign-in-sessions-and-tokens/)).

**Build metadata:** Registered in this build. Registration describes the default dispatcher in this build. It does not guarantee that a caller has the required credential or grant, that a tool is listed for that connection, or that the required service is configured.

## Contract description

Sign one of your test end users in for the turnzero command, without a mailbox\. With no shell, use `request_route` or `write_route` with `test_end_user` for one signed\-in call instead\. This call returns the command `turnzero session --origin https://dev.turnzero.ai` in four forms\. It signs nobody in yet\. Run one form once with turnzero 0\.37\.0 or later\. It writes the cookie to a jar that `curl -b` reads\. The value never reaches your tool\. The session ends at the earliest of one hour, the user's expiry and the realm token's life\.

The command uses `TURNZERO_CLOUD_MINTED_TOKEN`, or this computer's token if unset\. On production or `workforce` realms, its token needs `test_end_users`, even when your session requested the command\. Without the grant there, a minted token's call and command are refused `test_end_users_not_admitted`\. An expired or real user is refused `not_test_end_user`\.

## More about this action

The `environment` argument is required: pass `development` or `production`, the environment whose realm you address\. The development realm exists only after `create_environment` has turned development on\.

The command writes the cookie jar file into the folder above the one it runs in, under a name made from the end user\. Pass another `--out` to write it elsewhere\. The command refuses a path inside the folder it runs in where that folder has `package.json`\.

When the turnzero command runs, it calls this action on the HTTP action route with `delivery` set to `command`\. That call receives the session itself: the hostname, the end user, `expires_at`, and the cookie's name and value\. A tool call never passes `delivery`; one that does is refused `local_route_required`\.

On the command route, a minted token without the `test_end_users` grant is refused `test_end_users_not_admitted` where the command's detail says it needs the grant\. Use the returned command\. The server refuses a supported command identifier reporting a version below the compatibility floor of 0\.37\.0\. A sign\-in start past the address's hourly limit on code starts is refused `signin_code_rate_limited`\. The start also counts in the realm's per\-source limit on sign\-in starts, `signin_starts_per_hour`, under your source address, and past it is refused `signin_rate_limited`\. A suspended test end user is refused `user_suspended`\. Every call is recorded as an action, and no record contains the cookie's value\.

While `TEST_END_USERS` is off, sign\-in is refused `test_end_users_disabled`; the operator must turn it on\. A tool session without a grant token can use the test sign\-in page with `read_test_signin_code`, or `request_route` or `write_route` with `test_end_user`\.

## Access and action metadata

```json
{
  "name": "sign_in_test_end_user",
  "resource": "realm",
  "tier": "reversible",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "summary": "Sign one test end user of one realm of your account's own application in for the turnzero command, `application`, `environment`, and `end_user` all required, the user by its identifier or its label. A tool's call, and any call without `delivery`, returns the command `turnzero session --origin https://dev.turnzero.ai` in its four forms: run once, it signs the user in and writes the session's cookie into a cookie jar file `curl -b` reads, so the value passes through no tool. The turnzero command's own call on the HTTP action route, with `delivery` as `command`, returns the session: the hostname, the end user, `expires_at`, and the cookie's name and value, with no cookie set on the response. The session lasts one hour, or until the test end user's expiry, or the realm token's life where shorter. Admitted as `read_test_signin_code` is: the account's session, its account-wide token, or a token bounded to that application, `super_admin` widening it to no other account's application. The command is returned to the account's session and a token carrying `test_end_users` on every realm. On a production realm, and on a workforce application's realm, the command's detail says its token needs the grant. There a minted token without it is refused `test_end_users_not_admitted`, at the call and on the command route. Refused `local_route_required` where `delivery` reaches any surface but the HTTP action route, `not_test_end_user` for a user who is not an unexpired test end user, `test_end_users_disabled` while `TEST_END_USERS` reads `off`, and `command_too_old` on the command route below turnzero 0.37.0. The command route is also refused `signin_code_rate_limited` past the address's hourly starts, and `signin_code_invalid` or `user_suspended` from the confirmation. Every call is one action record, and no record carries the cookie's value.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": false,
    "openWorldHint": false
  }
}
```

## MCP catalog entry

```json
{
  "name": "sign_in_test_end_user",
  "title": "Sign in test app user",
  "tier": "reversible",
  "summary": "Sign one of your test end users in for the turnzero command, without a mailbox. With no shell, use `request_route` or `write_route` with `test_end_user` for one signed-in call instead. This call returns the command `turnzero session --origin https://dev.turnzero.ai` in four forms. It signs nobody in yet. Run one form once with turnzero 0.37.0 or later. It writes the cookie to a jar that `curl -b` reads. The value never reaches your tool. The session ends at the earliest of one hour, the user's expiry and the realm token's life.\n\nThe command uses `TURNZERO_CLOUD_MINTED_TOKEN`, or this computer's token if unset. On production or `workforce` realms, its token needs `test_end_users`, even when your session requested the command. Without the grant there, a minted token's call and command are refused `test_end_users_not_admitted`. An expired or real user is refused `not_test_end_user`.",
  "owners": [
    "ACS-L0-21",
    "ACS-L0-20",
    "ACS-L0-12",
    "PLD-L0-94"
  ],
  "scenario": "ACS-L0-21"
}
```

## request

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["application","environment","end\_user"\]<br>Additional properties: false |
| /<wbr>properties/<wbr>application | Your account's application `id` from `list_applications`, not its name or label\.<br><br>Type: string |
| /<wbr>properties/<wbr>environment | Required\. The environment whose realm the test end user signs in to, `development` or `production`\.<br><br>Type: string<br>Pattern: ^\(development\|production\)$ |
| /<wbr>properties/<wbr>end\_user | The test end user's id from `add_test_end_users` or `list_end_users`, or its label, the address's local part\. An identifier\-shaped value is read as an id; any other as a label\. An id no row holds is refused `no_such_end_user`\.<br><br>Type: string |
| /<wbr>properties/<wbr>delivery | Taken on the HTTP action route alone, from the turnzero command's `session` call: `command`, which makes the call return the session itself\. The MCP tool has no `delivery` member, and a call that passes it there is refused `local_route_required`; a tool takes the line form instead\.<br><br>Type: string<br>Allowed values: \["command"\]<br>HTTP action route only, never an MCP tool argument: true |

## response

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["contract\_version","application","environment","end\_user"\]<br>Additional properties: false |
| /<wbr>properties/<wbr>contract\_version | Required value: 1 |
| /<wbr>properties/<wbr>state | With the state `awaiting_command`, on a call without `delivery`: nothing is signed in until the line runs\.<br><br>Required value: awaiting\_command |
| /<wbr>properties/<wbr>application | The application id\.<br><br>Type: string |
| /<wbr>properties/<wbr>environment | The environment whose realm the test end user signs in to\.<br><br>Type: string<br>Pattern: ^\(development\|production\)$ |
| /<wbr>properties/<wbr>end\_user | Type: object<br>Required fields: \["id","label"\]<br>Additional properties: false |
| /<wbr>properties/<wbr>end\_user/<wbr>properties/<wbr>id | The test end user's opaque identifier\.<br><br>Type: string |
| /<wbr>properties/<wbr>end\_user/<wbr>properties/<wbr>label | The test end user's label, the local part of its address at the fixture domain\.<br><br>Type: string |
| /<wbr>properties/<wbr>command | With the state `awaiting_command`: one line, for macOS and Linux, `turnzero session --origin https://dev.turnzero.ai` with the application, the environment, the end user, and `--out`, the cookie jar file it writes in the folder above the one the line runs in\. It carries `--force`, so a later run replaces that file\. It ends with `--origin <origin>` when the responding origin is not the command's default\. Run it once under this computer's token or TURNZERO\_CLOUD\_MINTED\_TOKEN: it signs the user in and writes the cookie into the file in the form `curl -b` reads\. It carries no credential, and it needs turnzero 0\.37\.0 or later\.<br><br>Type: string |
| /<wbr>properties/<wbr>command\_windows | With the state `awaiting_command`: the same line for every Windows shell, with `turnzero.cmd` where its head says `turnzero`\.<br><br>Type: string |
| /<wbr>properties/<wbr>command\_npx | With the state `awaiting_command`: the same line run through npx, `npx --no-update-notifier -y turnzero@<tag>` in place of `turnzero`, the tag `latest` on production's platform and `next` on every other\. It is present exactly where `command` is\. Run this line first, or `command_npx_windows` on Windows; it runs whether or not the command is installed\. If npx can't run, use `command` where `turnzero --version` responds; else use `request_route` or `write_route` with `test_end_user` for one signed\-in call\. Run `npm install -g turnzero@<tag>` only if the person wants to keep it\. If your tool's permissions blocked the command, tell the person which route you took\. A person or a job may run any of the four forms\.<br><br>Type: string |
| /<wbr>properties/<wbr>command\_npx\_windows | With the state `awaiting_command`: `command_npx`'s line for every Windows shell, with `npx.cmd` where its head says `npx`\.<br><br>Type: string |
| /<wbr>properties/<wbr>status | On the turnzero command's own call, with `delivery` as `command`: the session is open, and this answer alone carries its cookie\.<br><br>Required value: signed\_in |
| /<wbr>properties/<wbr>hostname | With `status` `signed_in`: the realm's hostname, the cookie's domain in the jar, the production environment's custom domain while its identifier span runs\.<br><br>Type: string |
| /<wbr>properties/<wbr>expires\_at | With `status` `signed_in`: the session's expiry, as an ISO 8601 instant: one hour after the sign\-in, or the test end user's own expiry where sooner, or the sign\-in plus the realm token's life where that is shorter\.<br><br>Type: string |
| /<wbr>properties/<wbr>cookie | With `status` `signed_in`: the session cookie the command writes into its jar, the value in this answer and in no record\.<br><br>Type: object<br>Required fields: \["name","value","path","secure","http\_only"\]<br>Additional properties: false |
| /<wbr>properties/<wbr>cookie/<wbr>properties/<wbr>name | The realm session cookie's name, `__Host-turnzero_cloud_realm`\.<br><br>Type: string |
| /<wbr>properties/<wbr>cookie/<wbr>properties/<wbr>value | The session's signed token, the cookie's value: a credential, returned once, written into the jar and into nothing else\.<br><br>Type: string |
| /<wbr>properties/<wbr>cookie/<wbr>properties/<wbr>path | The cookie's path, `/`\.<br><br>Type: string |
| /<wbr>properties/<wbr>cookie/<wbr>properties/<wbr>secure | True: the cookie travels over https alone\.<br><br>Type: boolean |
| /<wbr>properties/<wbr>cookie/<wbr>properties/<wbr>http\_only | True: no page script reads the cookie, which the jar marks as curl does\.<br><br>Type: boolean |
| /<wbr>properties/<wbr>detail | Type: string |

## Complete payload contract

```json
{
  "request": {
    "type": "object",
    "required": [
      "application",
      "environment",
      "end_user"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "Your account's application `id` from `list_applications`, not its name or label."
      },
      "environment": {
        "type": "string",
        "pattern": "^(development|production)$",
        "description": "Required. The environment whose realm the test end user signs in to, `development` or `production`."
      },
      "end_user": {
        "type": "string",
        "description": "The test end user's id from `add_test_end_users` or `list_end_users`, or its label, the address's local part. An identifier-shaped value is read as an id; any other as a label. An id no row holds is refused `no_such_end_user`."
      },
      "delivery": {
        "type": "string",
        "enum": [
          "command"
        ],
        "x-wire-only": true,
        "description": "Taken on the HTTP action route alone, from the turnzero command's `session` call: `command`, which makes the call return the session itself. The MCP tool has no `delivery` member, and a call that passes it there is refused `local_route_required`; a tool takes the line form instead."
      }
    },
    "additionalProperties": false
  },
  "response": {
    "type": "object",
    "required": [
      "contract_version",
      "application",
      "environment",
      "end_user"
    ],
    "properties": {
      "contract_version": {
        "const": 1
      },
      "state": {
        "const": "awaiting_command",
        "description": "With the state `awaiting_command`, on a call without `delivery`: nothing is signed in until the line runs."
      },
      "application": {
        "type": "string",
        "description": "The application id."
      },
      "environment": {
        "type": "string",
        "pattern": "^(development|production)$",
        "description": "The environment whose realm the test end user signs in to."
      },
      "end_user": {
        "type": "object",
        "required": [
          "id",
          "label"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The test end user's opaque identifier."
          },
          "label": {
            "type": "string",
            "description": "The test end user's label, the local part of its address at the fixture domain."
          }
        },
        "additionalProperties": false
      },
      "command": {
        "type": "string",
        "description": "With the state `awaiting_command`: one line, for macOS and Linux, `turnzero session` with the application, the environment, the end user, and `--out`, the cookie jar file it writes in the folder above the one the line runs in. It carries `--force`, so a later run replaces that file. It ends with `--origin <origin>` when the responding origin is not the command's default. Run it once under this computer's token or TURNZERO_CLOUD_MINTED_TOKEN: it signs the user in and writes the cookie into the file in the form `curl -b` reads. It carries no credential, and it needs turnzero 0.37.0 or later."
      },
      "command_windows": {
        "type": "string",
        "description": "With the state `awaiting_command`: the same line for every Windows shell, with `turnzero.cmd` where its head says `turnzero`."
      },
      "command_npx": {
        "type": "string",
        "description": "With the state `awaiting_command`: the same line run through npx, `npx --no-update-notifier -y turnzero@<tag>` in place of `turnzero`, the tag `latest` on production's platform and `next` on every other. It is present exactly where `command` is. Run this line first, or `command_npx_windows` on Windows; it runs whether or not the command is installed. If npx can't run, use `command` where `turnzero --version` responds; else use `request_route` or `write_route` with `test_end_user` for one signed-in call. Run `npm install -g turnzero@<tag>` only if the person wants to keep it. If your tool's permissions blocked the command, tell the person which route you took. A person or a job may run any of the four forms (PLD-L0-94)."
      },
      "command_npx_windows": {
        "type": "string",
        "description": "With the state `awaiting_command`: `command_npx`'s line for every Windows shell, with `npx.cmd` where its head says `npx` (PLD-L0-94)."
      },
      "status": {
        "const": "signed_in",
        "description": "On the turnzero command's own call, with `delivery` as `command`: the session is open, and this answer alone carries its cookie."
      },
      "hostname": {
        "type": "string",
        "description": "With `status` `signed_in`: the realm's hostname, the cookie's domain in the jar, the production environment's custom domain while its identifier span runs."
      },
      "expires_at": {
        "type": "string",
        "description": "With `status` `signed_in`: the session's expiry, as an ISO 8601 instant: one hour after the sign-in, or the test end user's own expiry where sooner, or the sign-in plus the realm token's life where that is shorter."
      },
      "cookie": {
        "type": "object",
        "description": "With `status` `signed_in`: the session cookie the command writes into its jar, the value in this answer and in no record.",
        "required": [
          "name",
          "value",
          "path",
          "secure",
          "http_only"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The realm session cookie's name, `__Host-turnzero_cloud_realm`."
          },
          "value": {
            "type": "string",
            "description": "The session's signed token, the cookie's value: a credential, returned once, written into the jar and into nothing else."
          },
          "path": {
            "type": "string",
            "description": "The cookie's path, `/`."
          },
          "secure": {
            "type": "boolean",
            "description": "True: the cookie travels over https alone."
          },
          "http_only": {
            "type": "boolean",
            "description": "True: no page script reads the cookie, which the jar marks as curl does."
          }
        },
        "additionalProperties": false
      },
      "detail": {
        "type": "string"
      }
    },
    "additionalProperties": false
  }
}
```

## Shared contracts

- [Refusals](/cloud/reference/refusals/): every refusal, by surface, with its cause and its remedy
- [schemas/wire\_error\.schema\.json](/cloud/reference/sources/schemas/wire-error-schema/)
- [schemas/wire\_errors\.json](/cloud/reference/sources/schemas/wire-errors/)
- [schemas/action\_payloads\.json](/cloud/reference/sources/schemas/action-payloads/) (includes shared shapes)
- [management\_api\_contract\.md](/cloud/reference/sources/management-api-contract/)
