---
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`

## Request

- Base URL: `https://api.amigo.ai`
- URL: `https://api.amigo.ai/v1/{organization}/organization/service_hierarchical_state_machine`
- Auth: HTTP bearer and API key in header `X-ORG-ID` and HTTP basic
- TypeScript: <https://skmtc.dev/amigo/apis/amigo-api/docs/v1/:organization/organization/service_hierarchical_state_machine/get.ts> (a function with typed inputs; its response is checked against the schema)

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.dev/amigo/apis/amigo-api.md) - [All operations](https://skmtc.dev/amigo/apis/amigo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/amigo/apis/amigo-api/revisions/fd3c06d4bc2c?raw)
