Services
Understanding Amigo Services
Architectural Context Services are configured with Context Graphs (the API may refer to these as "state machines") that define how agents navigate problem spaces. Learn more about Context Graphs in our Conceptual Documentation.
Though services may be connected in a workflow (e.g., Meet & Greet leading to Adaptive Support), you must initiate conversations with the correct service ID to ensure proper user experience.
Service Routing Flow
Retrieving Available Services
To discover all available services for your organization:
curl --request GET \
--url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/service/?limit=10&is_active=true' \
--header 'Authorization: Bearer <AUTH-TOKEN-OF-USER>' \
--header 'Accept: application/json'from amigo_sdk import AmigoClient
from amigo_sdk.models import GetServicesParametersQuery
with AmigoClient() as client:
services = client.service.get_services(
GetServicesParametersQuery(limit=10, is_active=True)
)
for service in services.services:
print(f"Service: {service.name} (ID: {service.id})")Note: Async version also available with async with AsyncAmigoClient()
import { AmigoClient } from "@amigo-ai/sdk";
const client = new AmigoClient({ ...config });
const services = await client.services.getServices({
limit: 10,
is_active: true,
});
services.services?.forEach((service) => {
console.log(`Service: ${service.name} (ID: ${service.id})`);
});The response will contain a list of services with their respective IDs, names, and other metadata.
{
"services": [
{
"id": "6618791275130b73714e8d1c",
"name": "Meet & Greet",
"description": "A service that handles a scenario",
"icon": null,
"active_conversation_id": null,
"is_active": true,
"service_hierarchical_state_machine_id": "6618791375530b73714e8d1a",
"agent_id": "6618791275530b73714e9d18",
"conversation_metrics": []
}
]
}Retrieve a list of services in this organization.
Permissions
This endpoint is impacted by the following permissions:
- Only services that the authenticated user has the
Service:GetServicepermission for are returned.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.
The IDs of the services to retrieve.
[]Whether the service is active.
The fields to sort the services by. Supported fields are name and is_active. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.
[]The tags to filter the services by. Must be specified using the syntax key:value, which means to match all services with the given key and value pair among its tags. If value is *, it means the value does not matter. If value is empty, it matches against when the value is None.
[]The maximum number of services to return.
10The continuation token from the previous request used to retrieve the next page of services.
0The 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.
[]Succeeded.
Invalid authorization credentials.
Missing required permissions.
The specified organization does not exist.
Invalid request path parameter or request query parameter failed validation.
The user has exceeded the rate limit of 50 requests per minute for this endpoint.
The service is going through temporary maintenance.
GET /v1/{organization}/service/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
"services": [
{
"id": "text",
"name": "text",
"version_sets": {
"ANY_ADDITIONAL_PROPERTY": {
"agent_version_number": 1,
"service_hierarchical_state_machine_version_number": 1,
"llm_model_preferences": {
"ANY_ADDITIONAL_PROPERTY": {
"llm_name": "text",
"params": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
}
}
},
"description": "text",
"is_active": true,
"service_hierarchical_state_machine_id": "text",
"agent_id": "text",
"tags": [
{
"key": "text",
"value": "text"
}
]
}
],
"has_more": true,
"continuation_token": 1,
"filter_values": {
"tags": [
"text"
]
}
}Create a Service
curl --request POST \
--url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/service/' \
--header 'Authorization: Bearer <AUTH-TOKEN-OF-USER>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"service_hierarchical_state_machine_id": "8b5c6599bfb8ffc45646b289",
"agent_id": "0d0b781189c14189526c2603",
"name": "New Service",
"description": "A description",
"is_active": true,
}'
The response will contain the ID of the created service:
{
"id": "6618791275130b73714e8d1c"
}Create a new service. Depending on whether an active service with the same name already exists, the endpoint behaves differently:
- If
is_activeisFalse, creates an inactive new service. - If
is_activeisTrueand no active service with the given name exists, creates a new active service. - If
is_activeisTrueand an active service with the given name exists, this endpoint throws an error.
The new service will automatically contain an edge version set that uses the latest Agent and ServiceHierarchicalStateMachine versions with no LLM model preference.
It will also create a release version set, that will equal to what's specified in the request if the release_version_set is specified, or equal to edge if not.
Permissions
This endpoint requires the following permissions:
Service:CreateServicefor the service to create.Service:CreateVersionSetfor theedgeandreleaseversion sets.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.
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.
[]The ID of the state machine that this service uses.
^[a-f0-9]{24}$The ID of the agent that this service uses.
^[a-f0-9]{24}$The name of this service.
A description of this service.
Whether the newly-created service is active. Only active services are visible to users on the dashboard. You can later adjust the activeness of this service.
The release version set to use for this service. If not specified, the release version set will be the same as the edge version set, which uses the
latest agent and state machine versions with no model preference.
Succeeded.
This error could be thrown due to the following reasons:
- The specified ID for agent or service hierarchical state machine versions in the
releaseversion set does not belong to the agent or service hierarchical state machine of the service. - The specified agent or state machine doesn't have any versions.
- The specified LLM config is invalid.
Invalid authorization credentials.
Missing required permissions.
The specified organization, agent, or service hierarchical state machine do not exist.
An active service with the given name already exists.
Invalid request path parameter or request body failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
POST /v1/{organization}/service/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 403
{
"service_hierarchical_state_machine_id": "text",
"agent_id": "text",
"name": "text",
"description": "text",
"is_active": true,
"release_version_set": {
"agent_version_number": 1,
"service_hierarchical_state_machine_version_number": 1,
"llm_model_preferences": {
"ANY_ADDITIONAL_PROPERTY": {
"llm_name": "azure_gpt-4.1-2025-04-14",
"params": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
}
},
"tags": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}{
"id": "text"
}Update a Service
To update a service's non-functional metadata, use the following:
curl --request POST \
--url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/service/<SERVICE-ID>/' \
--header 'Authorization: Bearer <AUTH-TOKEN-OF-USER>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"is_active": false,
}'
To change a service's functional fields such as its agent ID, create a new service and delete the old service.
Update fields about a service.
Permissions
This endpoint requires the following permissions:
Service:UpdateServicefor the service.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.
The identifier of the service to update.
^[a-f0-9]{24}$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.
[]The name of the service. Only updated if not-null.
A description of this Service. Only updates if not-null.
The activeness of the service. Only updated if not-null.
If set to True and the service is currently inactive, no other service with the same name can be active.
If set to False and the service is currently active, it is deactivated. This will error if the service is used in a simulation unit test.
The ID of the agent that this service uses. Only updated if not-null.
^[a-f0-9]{24}$The ID of the service hierarchical state machine that this service uses. Only updated if not-null.
^[a-f0-9]{24}$The tags of this service. Only updated if not-null.
Succeeded.
This may occur for the following reasons:
- The request intends to activate a service that uses a deprecated agent, state machine, or LLM, or it uses an invalid agent or state machine.
- The request intends to deactivate a service that is used in a simulation unit test.
Invalid authorization credentials.
Missing required permissions.
The specified organization or service do not exist.
The request intends to activate a service that has an active service with the same name.
Invalid request path parameter or request body failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
POST /v1/{organization}/service/{service_id}/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 160
{
"name": "text",
"description": "text",
"is_active": true,
"agent_id": "text",
"service_hierarchical_state_machine_id": "text",
"tags": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}No content
Service Mapping Best Practices
Effective Service Routing
For effective service routing in your application:
Service ID Persistence: Store service IDs in your system with descriptive labels
User Journey Mapping: Create logical mappings between user states and appropriate services:
First-time users → Meet & Greet service (e.g. service ID:
67a23a08b02fe1e74341a6f8)Returning users → Reactive Support service (e.g. service ID:
675769a1d71dbf8cf042271f)
Dynamic Routing: Implement logic in your application to direct users to the appropriate service based on their status or needs
Service Versioning with Version Sets
Services use version sets to manage deployments across different environments. Each service can have multiple version sets (e.g., "release", "staging", "dev"), allowing you to test and promote changes without modifying the service ID.
What are Version Sets?
A version set is a named configuration that selects specific versions of:
Agent (agent_id + version number)
Context Graph (service_hierarchical_state_machine_id + version number)
LLM Model Preferences (model configuration for this deployment)
This enables safe, controlled deployment:
Service: "Customer Support"
├─ Version Set: "release" → Agent v2.1, Context Graph v3.0, gpt-5
├─ Version Set: "staging" → Agent v2.2, Context Graph v3.1, claude-sonnet-4-5
└─ Version Set: "dev" → Agent v3.0, Context Graph v4.0, gemini-2.5-proUsing Version Sets
When creating conversations, specify the version set:
service_version_set_name: The version set to use (typically"release"for production)service_id: The unique identifier for the service
Example:
{
"service_id": "6618791275130b73714e8d1c",
"service_version_set_name": "release"
}This approach ensures:
Stable production via the
"release"version setSafe testing via
"staging"or"dev"version setsZero-downtime deployments by updating version sets without changing service_id
Easy rollback by reverting version set configurations
For more on managing version sets and promotion workflows, see Version Sets Best Practices.
Last updated
Was this helpful?

