---
title: "Get service hierarchical state machines for an organization"
method: GET
path: "/v1/{organization}/organization/service_hierarchical_state_machine"
tags: ["Organization"]
---

# Get service hierarchical state machines for an organization

`GET /v1/{organization}/organization/service_hierarchical_state_machine`

Return a list of service hierarchical state machines for the organization.

#### Permissions
This endpoint may be impacted by the following permissions:
* Only state machines that the authenticated user has the `Organization:GetServiceHierarchicalStateMachine` permission on will be returned.

## Path parameters

- `organization` string, required

## Query parameters

- `deprecated` boolean, nullable — Whether the state machine is deprecated.
- `id` string[] — The IDs of the state machines to filter for.
- `limit` integer — The maximum number of service hierarchical state machines to return.
- `continuation_token` integer — The continuation token from the previous request used to retrieve the next page of state machines.

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Response `200`

Succeeded.

- SrcAppEndpointsOrganizationGetServiceHierarchicalStateMachinesResponse
  - `service_hierarchical_state_machines` StateMachineInstance[], required — The state machines for this organization.
    - `id` string, required — The ID of the state machine.
    - `name` string, required — The name of the state machine.
    - `deprecated` boolean, required — Whether the state machine has been deprecated.
    - `latest_version` integer, nullable, required — The latest version of the state machine. If `None`, no version for the state machine exists.
  - `has_more` boolean, required — Whether there are more state machines to fetch.
  - `continuation_token` integer, nullable, required — A token to supply to the next request to retrieve the next page of state machines. Only populated if `has_more` is `True`.

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — The specified organization does not exist.
- `422` — Invalid request path parameter or query parameter failed validation.
- `429` — The user has exceeded the rate limit of 20 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

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