# Fetch one version of a text trigger

GET

/v1/text-triggers/{triggerId}/versions/{version}

```sh
curl --request GET \
  --url https://example.com/v1/text-triggers/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/versions/1 \
  --header 'Authorization: Bearer <token>'
```

A removed text trigger’s too, with no flag, carrying `unregisteredAt`: a run keeps the version it started from (its `trigger.version`), whatever became of the text trigger since. Reading it takes what reading the text trigger does.

## Authorizations

- **[bearerAuth](https://docs.kindgi.com/v0.8.1/reference/api.md#bearerauth)**

## Parameters

### Path Parameters

**triggerId**

required

string format: uuid

TriggerId — the trigger id (a UUID).

**version**

required

integer

\>= 1

The version’s number: 1 for the trigger’s first, one more for each after.

## Responses

### 200

The version.

application/json

One version of a text trigger: what it was from `createdAt` until the next. A text’s run uses the newest when it starts, and keeps it.

object

**triggerId**

required

string

**version**

required

Counts from 1, one more for each version.

integer

\>= 1

**createdAt**

required

string format: date-time

**createdBy**

Who made the change, as audit records name an actor (`user:<id>`, `service_account:<id>`, …). Absent on a version the runtime made (`first-fire`, `unversioned-edit`, `pin`).

string

**cause**

required

What made the version: `register` (the trigger’s first), `edit` (a change to it), `owner` (a take-over to another owner), `first-fire` (the runtime’s, at the first fire of a trigger from before versions, or a mail trigger’s first look at its mailbox), `unversioned-edit` (the runtime’s, at a fire or a mail trigger’s look at its mailbox, or just before an edit or take-over, when the trigger’s definition isn’t its newest version’s, as when a release from before versions changed it during an upgrade) or `pin` (the runtime’s, when it fixed a mail trigger to the one connection it could use).

string

Allowed values: register edit owner first-fire unversioned-edit pin

**unregisteredAt**

When the trigger was removed: only on a removed trigger’s version. A trigger’s versions are never removed one by one: they stay as long as the trigger does.

string format: date-time

**definition**

required

What a text trigger’s version runs, as whom, and which number it answers at what pace, as its record names them, and never its state (status, next or last fire).

object

**flowId**

Run a flow (with `flowVersion`).

string

\>= 1 characters

**flowVersion**

string

\>= 1 characters

**agentId**

Run an agent (instead of a flow): at `agentVersion`, else its pinned version.

string

\>= 1 characters

**agentVersion**

string

\>= 1 characters

**projectId**

required

The trigger’s project: its runs are this project’s.

string format: uuid

**owner**

required

Who its runs act as, with their connections. A service account owns a shared trigger: one named with `runAsServiceAccountId`, or the project’s own (`runAsProject`, `isProjectAccount`). Registered without either, the caller owns it. No edit moves it; only a take-over (`POST /v1/text-triggers/{triggerId}/owner`) does.

object

**kind**

required

string

Allowed values: user service

**id**

required

string

**displayName**

The owner’s name at the time of the response: the person’s display name, or the service account’s name. Absent when it can’t be read (no directory, a removed account) and from a runtime before Kindgi 0.1.6: show the id then.

string

**isProjectAccount**

Set when the owner is the trigger’s project’s own service account (`runAsProject`): the trigger is shared, and runs as the project. Show it as “This project”. Absent otherwise.

boolean

**connectionId**

required

The connection the texts come in on: one of the project’s company connections of app `texts` (`GET /v1/connection-choices/candidates`), one per business number. A person’s own connection is `400 bad-input`, and any other `404 connection-not-found`. One live text trigger answers a connection: another on it is `409 trigger-connection-taken`, which names that trigger (`details.heldBy`).

string format: uuid

**runsPerHour**

required

The most runs its texts start in an hour (default 60). Past it, a text’s fire is `refused` (`detail` starts `over-limit:`), and that text doesn’t run later.

integer

\>= 1 <= 600

**perSenderPerHour**

required

The most runs one sender’s texts start in an hour (default 10). Past it, a text’s fire is `refused` (`detail` starts `over-limit:`), and that text doesn’t run later.

integer

\>= 1 <= 60

**label**

required

string | null

**toolsAllowedUnattended**

The tools whose calls in this trigger’s runs don’t wait for a person’s yes, though a run a text started asks for one for every call that changes something, except handing the conversation to a person (`kindgi_hand_to_person`). Never `kindgi_send_text`. Absent: none. Each tool by its id, with no wildcard or pattern, and only tools this trigger’s flow or agent calls. It lifts only that wait: the workspace’s approval rules, the agent’s own rules, the permission check (as the trigger’s owner) and the tool’s own limits all still apply.

Array\<string>

<= 100 items unique items

##### Example

```json
{
  "cause": "register",
  "definition": {
    "owner": {
      "kind": "user",
      "isProjectAccount": true
    }
  }
}
```

### 400

`version` isn’t a positive integer (`bad-input`, `details.field`).

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 401

Missing / malformed / expired / revoked bearer token.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 404

No text trigger with that id, removed or not (`trigger-not-found`), or it has no version with that number (`trigger-version-not-found`).

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 429

`rate-limit-exceeded` with `details.limit: "api-requests"`, on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; `Retry-After` says when to send it again.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

#### Headers

**Retry-After**

integer

\>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

### 503

The database was too busy to answer in time (`database-busy`), or the authorization store couldn’t be reached (`authz-backend-unavailable`); `Retry-After` (whole seconds) says when to try again.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

#### Headers

**Retry-After**

integer

\>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

## See also

- [`GET /v1/text-triggers/{triggerId}`: Fetch a text trigger](https://docs.kindgi.com/v0.8.1/reference/api/operations/texttriggersget.md)
- [`PATCH /v1/text-triggers/{triggerId}`: Update a text trigger](https://docs.kindgi.com/v0.8.1/reference/api/operations/texttriggersupdate.md)
- [`POST /v1/text-triggers/{triggerId}/pause`: Pause a text trigger](https://docs.kindgi.com/v0.8.1/reference/api/operations/texttriggerspause.md)
- [`POST /v1/text-triggers/{triggerId}/resume`: Resume a text trigger](https://docs.kindgi.com/v0.8.1/reference/api/operations/texttriggersresume.md)
- [Error code `authz-backend-unavailable`](https://docs.kindgi.com/v0.8.1/reference/errors.md#authz-backend-unavailable)
- [Error code `bad-input`](https://docs.kindgi.com/v0.8.1/reference/errors.md#bad-input)
- [Error code `database-busy`](https://docs.kindgi.com/v0.8.1/reference/errors.md#database-busy)
- [Error code `rate-limit-exceeded`](https://docs.kindgi.com/v0.8.1/reference/errors.md#rate-limit-exceeded)
- [Error code `trigger-not-found`](https://docs.kindgi.com/v0.8.1/reference/errors.md#trigger-not-found)
- [Error code `trigger-version-not-found`](https://docs.kindgi.com/v0.8.1/reference/errors.md#trigger-version-not-found)
- [Every error code](https://docs.kindgi.com/v0.8.1/reference/errors.md)
